Skip to content

Commit

Permalink
Fix season handling in PikPak & Fix Real-Debrid mimeType check
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdzumair committed Dec 30, 2024
1 parent f933ddf commit 931cb6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions streaming_providers/pikpak/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,13 @@ async def retrieve_or_download_file(
magnet_link: str,
info_hash: str,
stream: TorrentStreams,
season: int | None,
episode: int | None,
max_retries: int,
retry_interval: int,
):
selected_file = await find_file_in_folder_tree(
pikpak, my_pack_folder_id, info_hash, filename, episode
pikpak, my_pack_folder_id, info_hash, filename, season, episode
)
if not selected_file:
await free_up_space(pikpak, stream.size)
Expand All @@ -281,7 +282,7 @@ async def retrieve_or_download_file(
pikpak, info_hash, max_retries, retry_interval
)
selected_file = await find_file_in_folder_tree(
pikpak, my_pack_folder_id, info_hash, filename, episode
pikpak, my_pack_folder_id, info_hash, filename, season, episode
)
if selected_file is None:
raise ProviderException(
Expand Down Expand Up @@ -329,6 +330,7 @@ async def get_video_url_from_pikpak(
user_data: UserData,
stream: TorrentStreams,
filename: str,
season: int | None,
episode: int | None,
max_retries=1,
retry_interval=0,
Expand All @@ -345,6 +347,7 @@ async def get_video_url_from_pikpak(
magnet_link,
info_hash,
stream,
season,
episode,
max_retries,
retry_interval,
Expand Down
4 changes: 2 additions & 2 deletions streaming_providers/realdebrid/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ async def create_download_link(

response = await rd_client.create_download_link(torrent_info["links"][link_index])

if not response.get("mimeType").startswith("video"):
await rd_client.delete_torrent(torrent_info["id"])
if not response.get("mimeType", "").startswith("video"):
# await rd_client.delete_torrent(torrent_info["id"])
raise ProviderException(
f"Requested file is not a video file, deleting torrent and retrying. {response['mimeType']}",
"torrent_not_downloaded.mp4",
Expand Down

0 comments on commit 931cb6b

Please sign in to comment.