Skip to content

Commit

Permalink
fix: torrents faster
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy committed Jul 19, 2024
1 parent f1358f7 commit ef53efe
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions comet/debrid/torbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def check_premium(self):
async def get_instant(self, chunk: list):
try:
response = await self.session.get(
f"{self.api_url}/torrents/checkcached?hash={','.join(chunk)}&list_files=true"
f"{self.api_url}/torrents/checkcached?hash={','.join(chunk)}&format=list&list_files=true"
)
return await response.json()
except Exception as e:
Expand Down Expand Up @@ -71,9 +71,9 @@ async def get_files(
continue

if type == "series":
for hash in result["data"]:
hash_files = result["data"][hash]["files"]
for file in hash_files:
for torrent in result["data"]:
torrent_files = torrent["files"]
for file in torrent_files:
filename = file["name"].split("/")[1]

if not is_video(filename):
Expand All @@ -89,24 +89,24 @@ async def get_files(
if kitsu and filename_parsed.season != []:
continue

files[hash] = {
"index": hash_files.index(file),
files[torrent["hash"]] = {
"index": torrent_files.index(file),
"title": filename,
"size": file["size"],
}

continue

for hash in result["data"]:
hash_files = result["data"][hash]["files"]
for file in hash_files:
for torrent in result["data"]:
torrent_files = torrent["files"]
for file in torrent_files:
filename = file["name"].split("/")[1]

if not is_video(filename):
continue

files[hash] = {
"index": hash_files.index(file),
files[torrent["hash"]] = {
"index": torrent_files.index(file),
"title": filename,
"size": file["size"],
}
Expand Down

0 comments on commit ef53efe

Please sign in to comment.