Skip to content

Commit

Permalink
Update stream indexing due to changes in RUV backend. Handle when m3u…
Browse files Browse the repository at this point in the history
…8 downloading fails
  • Loading branch information
HaukurPall committed Jun 5, 2022
1 parent 0397cb8 commit 2556671
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ruv_dl/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ffpb
from tqdm import tqdm

QUALITIES_INT_TO_STR = {0: "240p", 1: "360p", 2: "480p", 3: "720p", 4: "1080p"}
QUALITIES_INT_TO_STR = {0: "1080p", 1: "720p", 2: "480p"}
QUALITIES_STR_TO_INT = {value: key for key, value in QUALITIES_INT_TO_STR.items()}


Expand Down
8 changes: 5 additions & 3 deletions src/ruv_dl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ def download_program(
skipped_episodes.append(episode)
append_downloaded_episode(config.download_log, episode)

download_m3u8_file(episode.url, QUALITIES_STR_TO_INT[episode.quality_str], output_file=output_file)
downloaded_episodes.append(episode)
append_downloaded_episode(config.download_log, episode)
if download_m3u8_file(episode.url, QUALITIES_STR_TO_INT[episode.quality_str], output_file=output_file):
downloaded_episodes.append(episode)
append_downloaded_episode(config.download_log, episode)
else:
log.error(f"Unable to download m3u8. Check the url with ffmpeg: {episode.url}")

except KeyboardInterrupt:
log.warning("Stopping.")
Expand Down

0 comments on commit 2556671

Please sign in to comment.