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

Sudden failures of ITV shows #205

Closed
pmhird opened this issue Oct 14, 2018 · 38 comments
Closed

Sudden failures of ITV shows #205

pmhird opened this issue Oct 14, 2018 · 38 comments

Comments

@pmhird
Copy link

pmhird commented Oct 14, 2018

All of a sudden ITV shows have started failing for me. I'm using Mc OS 10.11, and GIA 1.13.15. The show appears to download normally to 100% and creates a file with an .MP4 extension, but as soon as the download reaches 100% it reports download failed. The resultant file is not added to iTunes, and cannot be played by iTunes, but can be played perfectly well by VLC. It seems to me (a complete coding numpty) that the software is not converting the downloaded file to a usable tv show, and the log doesn;t help, it just says download failed, problem unknown.

BBC shows are unaffected and both BBC radio and TV work fine.

Any ideas?

@Vangelis66
Copy link

The show appears to download normally to 100% and creates a file with an .MP4 extension
(snip)
The resultant file is not added to iTunes, and cannot be played by iTunes, but can be played perfectly well by VLC.

Hi 😄 ... By what you say, it looks to me as if, for some obscure reason, the downloaded MPEG-TS container file is not remuxed to the MP4 container that iTunes can import and play back (don't worry if you don't understand the terminology I used, the maintainer and several other members here do and should be able to help... 😉 )...

Can you post the complete filename of the ITV downloaded file (that would play in VLC but not in iTunes)?
More importantly, could you be so kind as to install MediaInfo for Mac and then inspect that problematic file? Please attach its inspection log here, so we could see what sort of media file it is...

and the log doesn;t help, it just says download failed, problem unknown.

Have you tried generating a verbose log ? It will divulge more useful info about what is failing in your setup (please attach it here or paste it to a GitHub gist; DO NOT post it in the body of your comment/reply)...

Regards

@skovatch
Copy link

Can you please be specific about which show isn't working for you? I'm not seeing any problems in general with ITV shows, though one show (Take the Tower) fails to download.

@pmhird
Copy link
Author

pmhird commented Oct 15, 2018 via email

@blloyd78
Copy link

I am finding that all ITV shows fail to download. The process begins and then exits after reaching approx. 0.4%. I am left with a number of temporary files after the process exits. Shows I am having problems with include:
613338 - Doc Martin
2a3969a0002 - The Loch
2a39690001 - The Loch
613341 - Doc Martin
613340 - Doc Martin
2a3969a0004 - The Loch
2a3969a0003 - The Loch
2a5287a0005 - Strangers

I have tried reinstalling GetiPlayerAutomator but that has not resolved the issue.

@Vangelis66
Copy link

I am finding that all ITV shows fail to download.
The process begins and then exits after reaching approx. 0.4%.
(snip)
2a5287a0005 - Strangers

Hi Ben 😄 - you appear to be located within the UK, so geo-blocking shouldn't be an issue in your case 😉 ...
I understand my reply is not much help, but using the standalone latest (2018.10.05) version of youtube-dl (on Windows) and a whitelisted UK VPN (that won't be named...), I find the download progress passes the 0.4% point...

youtube-dl --console-title --hls-prefer-native --hls-use-mpegts -c --no-part --fixup never "https://www.itv.com/hub/strangers/2a5287a0005" --write-sub --convert-subs=srt -o "ITV1_Strangers_Se1Ep5_201810082100[2a5287a0005].ts" =>

[ITV] 2a5287a0005: Downloading webpage
[ITV] 2a5287a0005: Downloading XML
WARNING: Unable to download XML: HTTP Error 504: Gateway Time-out
[ITV] 2a5287a0005: Downloading JSON metadata
[ITV] 2a5287a0005: Downloading m3u8 information
[info] Writing video subtitles to: ITV1_Strangers_Se1Ep5_201810082100[2a5287a000
5].en.vtt
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 225
[download] Destination: ITV1_Strangers_Se1Ep5_201810082100[2a5287a0005].ts
[download]   1.8% of ~488.69MiB at 442.72KiB/s ETA 28:24

youtube-dl is the helper tool used inside GiA to actually manage ITVHub fetches...

OT: Notice to overseas users: During the last 7-10 days, ITV have unleashed a new round of blocking, in a blanket fashion, many commercial UK VPN/Proxy servers; all services hosted on Digital Ocean (DO) UK nodes took a direct blow and no longer work (they get stopped at the Downloading JSON metadata stage); so if you find your ITV shows to suddenly NOT download at ALL (not start and stall), first place to look is your UK VPN... 😠

@pmhird
Copy link
Author

pmhird commented Oct 15, 2018 via email

@blloyd78
Copy link

OK, the fault is entirely mine. Two firewall rules were at fault. After I enabled access to the following addresses, Get iPlayer Automator began functioning correctly:

  • itvpnp.live.ott.irdeto.com
  • a955.w10.akamai.net

Other users experiencing similar problems may want to check their firewall rules and content blocker settings.

@Vangelis66
Copy link

tvpnp.live.ott.irdeto.com

... that explains it then! 👍 For those who want a detailed explanation:

itvpnp.live.ott.irdeto.com is the hostname of the URI to the AES-128 decryption key issuer, of the template:

https://itvpnp.live.ott.irdeto.com/HLS/GetKey.aspx?CrmId=itvpnp&AccountId=itvpnp&ContentId=<programme-specific-string>

(this is in fact contained inside the HLSe variant playlist...); GiA (actually youtube-dl) successfully downloads the first encrypted HLSe segment (roughly 0.4% of total file size), requests (on-the-fly) the keys to decrypt it, but because access to the lic server is firewalled, fails to do so, hence it aborts the whole download...
Nice detective work done there, Ben 😄

... Now back to trying to solve OP's predicament 😕

@pmhird
Copy link
Author

pmhird commented Oct 15, 2018

Hi again, an example of the filename it downloads is:

Bad Move.s02e01.Episode 1.mp4

However the computer doesn't automatically recognise it as an iTunes compatible file and won't play it except with VLC. It is however 100% complete.

@msg362
Copy link

msg362 commented Oct 16, 2018

I'm using a VPN (UK) in Thaland. ITV stopped working two days ago. Switching off the firewall (iMac) made no difference. BBC is working fine
'download failed' Unknown PID Not found, trying to downoad 'butterfly' but no prgramme is downloadable
Untitled.pdf

untitled

@pmhird
Copy link
Author

pmhird commented Oct 16, 2018 via email

@msg362
Copy link

msg362 commented Oct 16, 2018

It seems to be that ITV have blocked many VPNs but I'm not sure

@naq59
Copy link

naq59 commented Oct 17, 2018

Contact your VPN provider. I heard that some have already fixed the ITV issue

@msg362
Copy link

msg362 commented Oct 17, 2018 via email

@naq59
Copy link

naq59 commented Oct 17, 2018

Try version 1.13.10 of GIA. That might work better

@pmhird
Copy link
Author

pmhird commented Oct 17, 2018 via email

@msg362
Copy link

msg362 commented Oct 17, 2018 via email

@Vangelis66
Copy link

@pmhird wrote:

my original issue has nothing to do with VPNs so please start a separate thread for those.

You're absolutely correct ! 👍 However, @msg362 did as advised and opened #206; this was closed, in the assumption it is VPN related, due to the NOTE proviso in Reporting-Issues... I am confident the maintainer discourages further VPN-related discussions, but if anyone feels absolutely compelled to add something provenly helpful to Mike's predicament, issue 206 is the better place for that... 😉

an example of the filename it downloads is: Bad Move.s02e01.Episode 1.mp4

The filename looks OK; still, it can be a misnamed MPEG-TS file... For the more tech savvy:
ITVHub streams downloaded by youtube-dl (inside GiA) are in reality encrypted AppleHLS (HLSe) streams; yt-dl has a tendency to append the .mp4 file extension even to .ts files; two years ago I filed this yt-dl bug, you can follow the discussion there if you will, bottomline is it's still obscure/unresolved...
Immediately after yt-dl has completed the download of the ITV programme, the file extension might be ".mp4", but the media file is at that point still a ".ts" file; yt-dl relies on ffmpeg to remux (losslessly convert/repackage) to the MPEG4 container, so that the end file is indeed a "true" .mp4 one that can be imported (and be playable) by iTunes...

Your reported symptoms lead me to believe that this final remux for some reason fails to happen; but this is just an educated guess on my part; you have yet to share results from the troubleshooting steps you were advised to take previously in this thread, for now only speculations can be offered...

Even if your troubleshooting sustains my hypothesis, it'd be difficult for me to offer definitive cure, especially since I know very little about the insides of a Mac (despite being savvy on streaming methodologies and media file manipulation)... Other members here will have to intervene, but that's the joy of a joint effort 😜

By the looks of it, your copy of FFmpeg misbehaves on those ITV downloaded files, but what I am puzzled about is that the same thing does not happen with Beeb files (that also undergo similar remux):

BBC shows are unaffected and both BBC radio and TV work fine.

Cheers

@pmhird
Copy link
Author

pmhird commented Oct 19, 2018

This has now progressed to not even downloading the incomplete file. Any attempt to download an ITV show (I'm in the UK) just fails instantly now.

@msg362
Copy link

msg362 commented Oct 19, 2018 via email

@pmhird
Copy link
Author

pmhird commented Oct 19, 2018

I have just upgraded to GIA 1.13.16 but its made no difference. BBC shows are still fine.

@pmhird
Copy link
Author

pmhird commented Oct 19, 2018

Heres a PDF of my Verbose log

verbose log1.pdf

@skovatch
Copy link

Okay, that's helpful -- youtube-dl is trying to launch ffmpeg to convert the downloaded file into something that can be used by iTunes, but is failing for some reason.

This bug from youtube-dl looks like it might be related: ytdl-org/youtube-dl#7172 -- you're on macOS 10.11 which might be related here.

In Terminal, can you try brew install libav and see if that helps?

@skovatch
Copy link

I may have to include libav in the package if it does, but it will be tough to test as I don't have any machines with that OS on it.

@pmhird
Copy link
Author

pmhird commented Oct 19, 2018 via email

@pmhird
Copy link
Author

pmhird commented Oct 19, 2018

So i pasted that brew command into Terminal and that faulted too...

Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Failure while executing; git config --local --replace-all homebrew.analyticsmessage true exited with 1.
==> Installing dependencies for libav: faac, fdk-aac, libpng, freetype, lame, libogg, libvorbis, libvpx, opus, x264 and xvid
==> Installing libav dependency: faac
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Failure while executing; git config --local --replace-all homebrew.private true exited with 1.

@skovatch
Copy link

Oh, brew wants you to have Xcode installed. That makes sense, as it's mainly used by developers to get libraries or other tools for building applications, but I won't ask you to install a 5 GB app just so we can build a library. Let me look into some other possibilities.

@pmhird
Copy link
Author

pmhird commented Oct 29, 2018

Any news on this? My GIA is now updated to latest release, and any attempt to download from ITV just fails without any file being downloaded at all now.

@pmhird
Copy link
Author

pmhird commented Oct 29, 2018

This seems to be where it fails in the log:

ValueError: insecure string pickle

Any ideas what that means?

@msg362
Copy link

msg362 commented Oct 30, 2018 via email

@skovatch
Copy link

@pmhird My apologies for dropping this; the problem is your python installation doesn't have the necessary libraries to launch ffmpeg to convert the downloaded file into something iTunes can use. I was trying to find a solution that doesn't require you to install anything more than you need but I'm not sure that's going to be possible yet. Right now the only solutions I can think of are installing Xcode so you can use the brew install libav, or updating your OS or python.

How old is your hardware? Can you update to a newer OS?

@msg362
Copy link

msg362 commented Oct 30, 2018 via email

@pmhird
Copy link
Author

pmhird commented Oct 30, 2018 via email

@skovatch
Copy link

skovatch commented Nov 2, 2018

I don’t want to upgrade to a newer Os if possible as I am still using some legacy software that won’t work under a newer environment.

That's completely understandable. It does make it a bit harder to find a non-complicated solution, but I wouldn't do it either if I didn't have to.

Originally my problem was downloading an episode and not converting but now it fails before it’s even downloaded a file. Are we sure it’s an FFMPEG issue therefore?

Hmm... can you post another verbose log? Make sure ITV caching is enabled.

Regarding the conversion, It's not so much an ffmpeg version as it is a Python problem, which is what youtube-dl is based on. youtube-dl is trying to figure out what version of ffmpeg is available but that's failing for some reason.

@hugofalkman
Copy link

hugofalkman commented Nov 2, 2018

GiA 1.13.16 MacOS 10.14.1 Dark Heart Episode 1 and other ITV videos -- BBC works fine.
Attached log speaks for itself, I just kept restarting the download without erasing the parts already downloaded, until download completed successfully.

Downie is less affected than GiA, Downie finished downloading the Dark Heart episode on second try.
Charlie Monroe, the creator of Downie writes: "There can be multiple reasons for this behavior, ranging from a bug in macOS, networking issue to itv.com servers actively holding connections in order to prevent DDoS attacks (this is a common prevention - DDoS is based on many connections being made to a server until it crashes. This prevention increases delay with which it answers to each connection from the same IP address.)."

Does yt-dl have an option to increase the size of the time-out interval? Or decrease the number of concurrently downloaded fragments?

Edit: Switching DNS service fixed this for me.

Verbose Log.txt

@pmhird
Copy link
Author

pmhird commented Nov 2, 2018 via email

@pmhird
Copy link
Author

pmhird commented Nov 15, 2018

OK, i had to reset a few things due to some other software issues I was having with iTunes, and randomly GIA is now fully operational, downloading ITV and importing to iTunes! I have no idea why it didn't work or indeed why it now does but never mind, and apologies for wasting your time. Thanks for all the tips though!

@pmhird pmhird closed this as completed Nov 15, 2018
@hugofalkman
Copy link

@pmhird I don't think you should close this issue (yet). The problems with ITV come and go, yes this morning it worked flawlessly, but only yesterday I still had problems.

What I have done is to in Preferences set the option "Auto-retry Failed Downloads After" to 15 seconds (0.25 minutes). Most of the time this works even on bad ITV days, and when it doesn't I download with Downie.

My earlier questions remain: "Does yt-dl have an option to increase the size of the time-out interval? Or decrease the number of concurrently downloaded fragments?"

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

7 participants