Skip to content

Commit

Permalink
fix: torbox faster (removed useless checks)
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy committed Jul 11, 2024
1 parent fa8ce05 commit dfaf12b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions comet/debrid/torbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,18 @@ async def generate_download_link(self, hash: str, index: str):
create_torrent = await create_torrent.json()
torrent_id = create_torrent["data"]["torrent_id"]

get_torrents = await self.session.get(
f"{self.api_url}/torrents/mylist?bypass_cache=true"
)
get_torrents = await get_torrents.json()
# get_torrents = await self.session.get(
# f"{self.api_url}/torrents/mylist?bypass_cache=true"
# )
# get_torrents = await get_torrents.json()

for torrent in get_torrents["data"]:
if torrent["id"] == torrent_id:
file_id = torrent["files"][int(index)]["id"]
# for torrent in get_torrents["data"]:
# if torrent["id"] == torrent_id:
# file_id = torrent["files"][int(index)]["id"]
# Useless, we already have file index

get_download_link = await self.session.get(
f"{self.api_url}/torrents/requestdl?token={self.debrid_api_key}&torrent_id={torrent_id}&file_id={file_id}&zip=false",
f"{self.api_url}/torrents/requestdl?token={self.debrid_api_key}&torrent_id={torrent_id}&file_id={index}&zip=false",
)
get_download_link = await get_download_link.json()

Expand Down

0 comments on commit dfaf12b

Please sign in to comment.