Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails downloading all parts and crashes #94

Closed
Quicksilver151 opened this issue Dec 26, 2022 · 4 comments
Closed

Fails downloading all parts and crashes #94

Quicksilver151 opened this issue Dec 26, 2022 · 4 comments

Comments

@Quicksilver151
Copy link
Contributor

Describe the bug

  • some parts (.ts files) fail to download
  • but the program continues to download until it thinks all parts have been downloaded
  • program crashes after trying to combine all parts and running into a file missing

To Reproduce
Steps to reproduce the behavior:

  1. run anipy-cli in download mode
  2. have slow internet or something
  3. parts fail to download and crash during the combining processs

Expected behavior
combine parts successfully

Crash message

Downloading  Part: 329/355
Parts Downloaded                                                                                                                                             
Traceback (most recent call last):                                                                                                                           
  File "./anipy_cli.py", line 14, in <module>                                                                                                                
    main()                                                                                                                                                   
  File "./anipy_cli.py", line 8, in main                                                                                                                     
    cli.main()                                                                                                                                               
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/cli.py", line 692, in main                                                                               
    seasonal_cli(args.quality, args.no_kitsu, args.ffmpeg, args.auto_update, player)                                                                         
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/cli.py", line 239, in seasonal_cli                                                                       
    s.take_input()
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/cli.py", line 266, in take_input
    self.download_latest()
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/cli.py", line 360, in download_latest
    download(show_entry, self.ffmpeg).download()
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/download.py", line 82, in download
    self.multithread_m3u8_dl()
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/download.py", line 297, in multithread_m3u8_dl
    self.ffmpeg_merge(input_file, audio_input_file)
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/download.py", line 134, in ffmpeg_merge
    merged_video_ts = self.merge_ts_files(input_file)
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/download.py", line 179, in merge_ts_files
    with open(ts_file, "rb") as mergefile:
FileNotFoundError: [Errno 2] No such file or directory: '/home/renderinguser/GIT/anipy-cli/anipy_cli/download/Bocchi the Rock!/11_temp/2ebfa29b-8370-11ed-93b4-a0369ffdb630-000062.ts'

Platform

  • OS: Kubuntu (linux)

Additional context
suggestion

  • restarting the download of the specific episode for some reason downloads only the missing parts and then the recombination becomes successful.
  • so, before combining all .ts files, have a check to see if there is a correct number of parts downloaded
  • re-run the download process if number of parts downloaded do not match the number of parts expected
  • you might have fast enough internet connection that makes it so that this process is not repeatable naturally, so during testing, delete some .ts files during the download process to see if the changes work.

also quick question
which version of python is this program compatible with
i run Python 3.8.10 but downloads are successful if i manually retry enough
but manually retrying is annoying when you're downloading a full seasonal batch of anime

tl;dr: add auto restarting failed downloads

@VoidAny
Copy link
Contributor

VoidAny commented Dec 26, 2022

Sounds like an interesting problem. I'll work on it

@VoidAny VoidAny mentioned this issue Dec 26, 2022
@VoidAny
Copy link
Contributor

VoidAny commented Dec 26, 2022

It was simpler that I thought to fix. Thanks for your suggestions!

@Quicksilver151
Copy link
Contributor Author

nice
lemmie test it

@Quicksilver151
Copy link
Contributor Author

works nicely

sdaqo added a commit that referenced this issue Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants