nilfoer / gwaripper

Tool for conveniently downloading audios from r/gonewildaudio and similar subreddits
MIT License
30 stars 5 forks source link

Uncaught exception: download_hls_ffmpeg #11

Closed lightninghydra24 closed 1 year ago

lightninghydra24 commented 1 year ago

I'm not too sure why this happens but it seems both audio links in the post play at least; I can help debug to the best of my ability. Downloading of subsequent posts halts after this though sadly as the app exits

03:00:12 - INFO - Starting download of collection: https://www.reddit.com/r/GoneWildAudioGay/comments/w0q4bb/mm4moc_a_shy_twin_and_a_devious_twin_and_they/
03:00:35 - INFO - File was already downloaded, skipped URL: https://soundgasm.net/u/PerchanceToDream/MM4MOC-A-shy-twin-and-a-devious-twin-and-they-both-want-you-Mdom-Msub-speakers-Power-bottom-Incest-Twins-Blowjob-Anal-Threesome-Blackmail-Dubcon-Rape
03:00:47 - INFO - Downloading: [MM4M][OC] A shy twin and a devious twin, and they both want you_ [Mdo_02_A shy twin and a devious twin, and they both want you_.mp4..., File 2 of 2
Downloading TS-parts of the m3u8 playlist:
49/6403:02:28 - INFO - Download report was written to folder _reports
03:02:28 - INFO - The last backup date is not yet 5.0 days old! The next backup will be in  4.82 days!
03:02:28 - CRITICAL - Uncaught exception:
Traceback (most recent call last):
  File "/app/gwaripper-runner.py", line 23, in <module>
    main()
  File "/app/gwaripper/cli.py", line 239, in main
    args.func(args)
  File "/app/gwaripper/cli.py", line 309, in _cl_sub
    download_all_subs(sublist, args)
  File "/app/gwaripper/cli.py", line 275, in download_all_subs
    gw.download_all(sublist)
  File "/app/gwaripper/gwaripper.py", line 258, in download_all
    self.parse_and_download_submission(sub)
  File "/app/gwaripper/gwaripper.py", line 173, in parse_and_download_submission
    self.download(info)
  File "/app/gwaripper/gwaripper.py", line 264, in download
    self._download_collection(info, None)
  File "/app/gwaripper/gwaripper.py", line 433, in _download_collection
    self._download_file(
  File "/app/gwaripper/gwaripper.py", line 312, in _download_file
    return self._download_file_hls(info, author_name, top_collection,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/gwaripper/gwaripper.py", line 393, in _download_file_hls
    success = dl.download_hls_ffmpeg(info.direct_url, os.path.abspath(os.path.join(mypath, filename)))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/gwaripper/download.py", line 239, in download_hls_ffmpeg
    raise e
  File "/app/gwaripper/download.py", line 229, in download_hls_ffmpeg
    download_in_chunks(url, full_fn, headers=DEFAULT_HEADERS)
  File "/app/gwaripper/download.py", line 104, in download_in_chunks
    with urllib.request.urlopen(req) as response:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/urllib/request.py", line 525, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/urllib/request.py", line 634, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/urllib/request.py", line 563, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
nilfoer commented 1 year ago

The error with that specific audio here seems to be on erocast's side, since you can't listen to the audio at around ~15:50 on the site itself. So you'd have to report this to them.

The download should now continue properly after a failed erocast/hls download. Thank you for the report!

lightninghydra24 commented 1 year ago

Ahh, I see! Thank you for making it so that it would go past a broken file and continue on its journey. 😊 I'll see if I can reach out to erocast