Update main.py

This commit is contained in:
Goldy
2024-06-14 18:06:25 +02:00
committed by GitHub
parent e8ff59e5c9
commit 0a477ea6e8
+4 -3
View File
@@ -100,7 +100,8 @@ async def manifest(b64config: str):
}
async def getJackett(session: aiohttp.ClientSession, indexers: list, query: str):
response = await session.get(f"{os.getenv('JACKETT_URL')}/api/v2.0/indexers/all/results?apikey={os.getenv('JACKETT_KEY')}&Query={query}&Tracker[]={'&Tracker[]='.join(indexer for indexer in indexers)}")
timeout = aiohttp.ClientTimeout(total=int(os.getenv("JACKETT_TIMEOUT")))
response = await session.get(f"{os.getenv('JACKETT_URL')}/api/v2.0/indexers/all/results?apikey={os.getenv('JACKETT_KEY')}&Query={query}&Tracker[]={'&Tracker[]='.join(indexer for indexer in indexers)}", timeout=timeout)
return response
async def getTorrentHash(session: aiohttp.ClientSession, url: str):
@@ -266,7 +267,7 @@ async def stream(request: Request, b64config: str, type: str, id: str):
rankedFiles = set()
for hash in files:
try:
rankedFile = rtn.rank(files[hash]["title"], hash, correct_title=name, remove_trash=True)
rankedFile = rtn.rank(files[hash]["title"], hash, remove_trash=True) # , correct_title=name - removed because it's not working great
rankedFiles.add(rankedFile)
except:
continue
@@ -403,4 +404,4 @@ async def stream(b64config: str, hash: str, index: str):
downloadLink = await generateDownloadLink(session, config["debridApiKey"], hash, index)
downloadLinks[(hash, index)] = downloadLink
return RedirectResponse(downloadLink, status_code=302)
return RedirectResponse(downloadLink, status_code=302)