youtube-dl: itvhub download stopped working

When I try to download from itvhub now I get this response

$ yt-dlp https://www.itv.com/watch/the-amazing-spider-man-2/2a3878
[generic] 2a3878: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] 2a3878: Extracting information
ERROR: Unsupported URL: https://www.itv.com/watch/the-amazing-spider-man-2/2a3878

everything was fine until today.

Im running MX-Linux and yt-dlp version

$ yt-dlp -U
Latest version: 2022.11.11, Current version: 2022.11.11
yt-dlp is up to date (2022.11.11)

TIA

Brian

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 37 (11 by maintainers)

Most upvoted comments

As noted here, now that ITVX has been launched officially (and without a -) the formats that could be found previously are still available, though probably not for Premium content (untested).

Here’s an example from the yt-dlp thread accessed from the UK:

$ python -m youtube_dl -v -F 'https://www.itv.com/watch/family-guy/2a4259/2a4259a0399' --no-geo-bypass
[debug] System config: [u'--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://www.itv.com/watch/family-guy/2a4259/2a4259a0399', u'--no-geo-bypass']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 774b346f9
[debug] Python version 2.7.18 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[ITV] 2a4259a0399: Downloading webpage
[ITV] 2a4259a0399: Downloading JSON metadata
[ITV] 2a4259a0399: Downloading m3u8 information
[info] Available formats for 2a4259a0399:
format code  extension  resolution note
hls-68       mp4        audio only   68k , mp4a.40.2@ 64k
hls-102      mp4        audio only  102k , mp4a.40.2@ 96k
hls-285      mp4        512x288     285k , avc1.4D401F@ 203k, 25.0fps, mp4a.40.2@ 64k
hls-636      mp4        512x288     636k , avc1.4D401F@ 503k, 25.0fps, mp4a.40.2@ 96k
hls-848      mp4        512x288     848k , avc1.4D401F@ 703k, 25.0fps, mp4a.40.2@ 96k
hls-1272     mp4        896x504    1272k , avc1.4D401F@1103k, 25.0fps, mp4a.40.2@ 96k
hls-1909     mp4        896x504    1909k , avc1.4D401F@1704k, 25.0fps, mp4a.40.2@ 96k (best)
$

The extractor will get updated in due course.

@Vangelis66 Just seen your message at 13:50pm today. Thank you so much Vangelis for that. You’ve always been helpful in the past & now. I shall go & do what you say & hopefully get back to normal. And thanks to all that have contributed to the various software which like I’ve said I’m not experienced enough yet to contribute.

Yup, I didn’t have pycryptodome installed… I thought I did but must have removed it at one from my python3 at one point.

Good to know. We also need to set _GEO_BYPASS = False in the extractor to disable XFF and to detect the geo-block. What does the extractor report without VPN using --no-geo-bypass?

Although it would only affect the diagnostic, it would be interesting to know if a logged-in user can use the site from outside UK.

Maybe the answers to the above (Outside the UK? ... you can only watch ITVX in the UK, No) are here.

I just patched the master code for the quoted test, but the changes will apply to the PR easily.

🎅 🎅

--no-geo-bypass as I’m in the UK

Sadly, that flag (which provides an X-Forwarded-For request header on geo-sensitive APIs) doesn’t do anything these days for “overseas” users, because both the playlist API (magni.itv.com) as well as ALL the stream CDNs:

itvpnpmobile.content.itv.com (Akamai_1: 23.37.230.32, 23.37.230.42), itvpnpmobile.blue.content.itv.com (Akamai_2: 23.204.145.10, 23.204.145.19), itvpnpmobile.cdn1.content.itv.com (CloudFront: 13.35.125.20, 13.35.125.31, 13.35.125.54, 13.35.125.102)

hard-geoblock (i.e. can’t be fooled by a spoofed X-F-F request header); thus, a true whitelisted UK IP address is required for geo-block circumvention; keeping the function inside itv.py does no harm, it simply doesn’t work any more as designed (😞) …

and setting a UA to avoid CloudFlare blocking

I thought PR #30266 (specifically c6001d5) had already addressed that 😉 ; unless your test above did not use that PR’s code (why not?) …

Festive greetings 🎅 …

Thanks for the suggestion but I’ve never had to sign in to download from the itvhub and I’m afraid don’t know what to do with the cookies.txt file or where to get one from.

Brian

@MysticMerlin some ITV programs (including ITN news) are available at https://www.stv.tv/ (the scottish version of ITV), and youtube-dl currently still supports this, so you can use that site to download some of the programmes you want to watch until a fix is found for ITV hub.