Ascoware / get-iplayer-automator

The goal of Get iPlayer Automator is to allow iTunes and your Mac to become the hub for your British Television experience regardless of where in the world you are. Currently, Get iPlayer Automator allows you to download and watch BBC and ITV shows on your Mac. Series-Link/PVR functionality ensures you will never miss your favourite shows. Programmes are fully tagged and added to iTunes automatically upon completion. It is simple and easy to use, and runs on any machine running Mac OS X 10.7 or later. And since the shows are in iTunes, it is extremely easy to transfer them to your iPod, iPhone, or Apple TV allowing you to enjoy your shows on the go or on your television.
GNU General Public License v3.0
146 stars 26 forks source link

Subtitle failures cause the download to report as failed. #389

Open ghjimmy opened 2 years ago

ghjimmy commented 2 years ago

What steps will reproduce the problem? Be specific, and provide as much detail as possible. Download Episode of Midsomer Murders from ITV with subtitle preferences on. e.g.: 'Second Sight'

What is the expected output? What do you see instead? Expected download with subtitles, but get a file without subtitles and an error message 'Problem Unknown'

What version of GiA are you using? On what version of OS X? GiA 1.22.1 and MacOS 12.2.1

Are you using a web proxy? DNS proxy? VPN? VPS? No

What program are you attempting to download (full title, series and episode)? Provide only ONE program as an example. https://www.itv.com/hub/midsomer-murders/561396 Please provide any additional information below.

Extract from the debug log:

[info] Writing video subtitles to: /Users/user/Movies/TV Shows/Midsomer Murders/Midsomer Murders.s08e05.Second Sight.en.vtt
Subtitle path = /Users/user/Movies/TV Shows/Midsomer Murders/Midsomer Murders.s08e05.Second Sight.en.vtt
WARNING: Unable to download subtitle for "en": Unable to download webpage: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

[ deleted ]

[debug] ffmpeg command line: ffmpeg -i 'file:/Users/user/Movies/TV Shows/Midsomer Murders/Midsomer Murders.s08e05.Second Sight.mp4'
[ffmpeg] Fixing malformed AAC bitstream in "/Users/user/Movies/TV Shows/Midsomer Murders/Midsomer Murders.s08e05.Second Sight.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:/Users/iser/Movies/TV Shows/Midsomer Murders/Midsomer Murders.s08e05.Second Sight.mp4' -c copy -f mp4 '-bsf:a' aac_adtstoasc 'file:/Users/user/Movies/TV Sho
ws/Midsomer Murders/Midsomer Murders.s08e05.Second Sight.temp.mp4'
[ffmpeg] Embedding subtitles in '/Users/user/Movies/TV Shows/Midsomer Murders/Midsomer Murders.s08e05.Second Sight.mp4'
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/__main__.py", line 19, in <module>
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/__init__.py", line 475, in main
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/__init__.py", line 465, in _real_main
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/YoutubeDL.py", line 2060, in download
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/YoutubeDL.py", line 799, in extract_info
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/YoutubeDL.py", line 806, in wrapper
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/YoutubeDL.py", line 838, in __extract_info
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/YoutubeDL.py", line 872, in process_ie_result
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/YoutubeDL.py", line 1683, in process_video_result
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/YoutubeDL.py", line 2041, in process_info
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/YoutubeDL.py", line 2106, in post_process
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 426, in run
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 210, in run_ffmpeg_multiple_files
  File "/Applications/Get iPlayer Automator.app/Contents/Resources/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 210, in <genexpr>
OSError: [Errno 2] No such file or directory: '/Users/user/Movies/TV Shows/Midsomer Murders/Midsomer Murders.s08e05.Second Sight.en.vtt'
youtube-dl finished downloading

At the end, the dialog appears with Problem Unknown and the programme is not tagged either. If I remove the Download and Embed tag from the General settings, it does work correctly.

ejstubbs commented 2 years ago

I downloaded that episode last year. There were no subtitles with it then, and there aren't any on ITV Hub now, despite the subtitle toggle being presented in the playback window. (This is fairly typical of the flaky way that ITV curate the catch-up of stuff broadcast on ITV3 IME. They totally failed to put the second series of the Michael Gambon Maigret on ITV Hub recently, despite it being broadcast in January this year, apparently getting it confused with the Rowan Atkinson one which AFAIK hasn't been broadcast for months .)

Anyway, the point is that my download of Second Sight worked fine back in July last year, despite it not having subtitles. Unfortunately I don't have any GiA logs from back then so I can't have a nosy to see how it handled the lack of subtitles on that occasion. So I can't be sure whether it's ITV that's changed how the programmes are served, or GiA (of ffmpeg, which seems to be the culprit in this case) that's tripping over the lack of a vtt file when it didn't before. Either way, something has changed so that it no longer works as it used to.

The problem definitely occurs with the latest series 10 re-runs. Although GiA reports the download as failed I've found that, so long as the download process ran to completion (i.e. reached 100%) the MP4 file is present as it should be, although without subtitles. What is unhelpful is that GiA regards it as having failed so, if you are using series link, it continually re-lists the episode for downloading every time it refreshes the cache, until you mark it to be skipped permanently.

Bottom line, though, IMO, is that something has changed in the handling of missing vtt files between July last year and now.