Skip to content

Commit

Permalink
fix: wrong debrid stream proxy password warning being showed everytime
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy committed Jul 8, 2024
1 parent 4399f1f commit 0514484
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
12 changes: 8 additions & 4 deletions comet/api/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ async def stream(request: Request, b64config: str, type: str, id: str):

results = []
if (
settings.PROXY_DEBRID_STREAM
config["debridStreamProxyPassword"] != ""
and settings.PROXY_DEBRID_STREAM
and settings.PROXY_DEBRID_STREAM_PASSWORD
!= config["debridStreamProxyPassword"]
):
Expand Down Expand Up @@ -193,9 +194,11 @@ async def stream(request: Request, b64config: str, type: str, id: str):
search_response = await asyncio.gather(*tasks)
else:
logger.info(f"No indexer selected by user for {log_name}")

if settings.ZILEAN_URL:
zilean_torrents = await asyncio.create_task(get_zilean(session, indexer_manager_type, name, log_name))
zilean_torrents = await asyncio.create_task(
get_zilean(session, indexer_manager_type, name, log_name)
)

if search_indexer:
for results in search_response:
Expand Down Expand Up @@ -296,7 +299,8 @@ async def stream(request: Request, b64config: str, type: str, id: str):

results = []
if (
settings.PROXY_DEBRID_STREAM
config["debridStreamProxyPassword"] != ""
and settings.PROXY_DEBRID_STREAM
and settings.PROXY_DEBRID_STREAM_PASSWORD
!= config["debridStreamProxyPassword"]
):
Expand Down
2 changes: 0 additions & 2 deletions comet/debrid/alldebrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ async def get_instant(self, chunk: list):
logger.warning(
f"Exception while checking hashes instant availability on All-Debrid: {e}"
)
return

async def get_files(
self, torrent_hashes: list, type: str, season: str, episode: str
Expand Down Expand Up @@ -152,4 +151,3 @@ async def generate_download_link(self, hash: str, index: str):
logger.warning(
f"Exception while getting download link from All-Debrid for {hash}|{index}: {e}"
)
return
2 changes: 0 additions & 2 deletions comet/debrid/premiumize.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ async def get_instant(self, chunk: list):
logger.warning(
f"Exception while checking hash instant availability on Premiumize: {e}"
)
return

async def get_files(
self, torrent_hashes: list, type: str, season: str, episode: str
Expand Down Expand Up @@ -147,4 +146,3 @@ async def generate_download_link(self, hash: str, index: str):
logger.warning(
f"Exception while getting download link from Premiumize for {hash}|{index}: {e}"
)
return
2 changes: 0 additions & 2 deletions comet/debrid/realdebrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ async def get_instant(self, chunk: list):
logger.warning(
f"Exception while checking hash instant availability on Real-Debrid: {e}"
)
return

async def get_files(
self, torrent_hashes: list, type: str, season: str, episode: str
Expand Down Expand Up @@ -157,4 +156,3 @@ async def generate_download_link(self, hash: str, index: str):
logger.warning(
f"Exception while getting download link from Real-Debrid for {hash}|{index}: {e}"
)
return
11 changes: 6 additions & 5 deletions comet/utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,7 @@ async def get_indexer_manager(

response = await session.get(
f"{settings.INDEXER_MANAGER_URL}/api/v1/search?query={query}&indexerIds={'&indexerIds='.join(str(indexer_id) for indexer_id in indexers_id)}&type=search",
headers={
"X-Api-Key": settings.INDEXER_MANAGER_API_KEY
},
headers={"X-Api-Key": settings.INDEXER_MANAGER_API_KEY},
)
response = await response.json()

Expand All @@ -245,7 +243,9 @@ async def get_indexer_manager(
return results


async def get_zilean(session: aiohttp.ClientSession, indexer_manager_type: str, name: str, log_name: str):
async def get_zilean(
session: aiohttp.ClientSession, indexer_manager_type: str, name: str, log_name: str
):
results = []
try:
get_dmm = await session.post(
Expand All @@ -254,7 +254,8 @@ async def get_zilean(session: aiohttp.ClientSession, indexer_manager_type: str,
get_dmm = await get_dmm.json()

if isinstance(get_dmm, list):
for result in get_dmm[: settings.ZILEAN_TAKE_FIRST]:
take_first = get_dmm[: settings.ZILEAN_TAKE_FIRST]
for result in take_first:
if indexer_manager_type == "jackett":
object = {
"Title": result["filename"],
Expand Down

0 comments on commit 0514484

Please sign in to comment.