diff options
author | dirkf <fieldhouse@gmx.net> | 2025-03-26 12:17:49 +0000 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2025-03-26 12:17:49 +0000 |
commit | c1ea7f5a242dbaad3a4646d73bb1cae22439a788 (patch) | |
tree | 2bc9c5942b7a5764bf937c74ae63b5ec0caa16f3 | |
parent | 2b4fbfce25902d557b86b003cf48f738129efce4 (diff) |
[ITV] Mark ITVX not working
* update old shim
* correct [_]IE_DESC
-rw-r--r-- | youtube_dl/extractor/itv.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/youtube_dl/extractor/itv.py b/youtube_dl/extractor/itv.py index c64af3be6..2510ad887 100644 --- a/youtube_dl/extractor/itv.py +++ b/youtube_dl/extractor/itv.py @@ -35,15 +35,6 @@ from ..utils import ( class ITVBaseIE(InfoExtractor): - def _search_nextjs_data(self, webpage, video_id, **kw): - transform_source = kw.pop('transform_source', None) - fatal = kw.pop('fatal', True) - return self._parse_json( - self._search_regex( - r'''<script\b[^>]+\bid=('|")__NEXT_DATA__\1[^>]*>(?P<js>[^<]+)</script>''', - webpage, 'next.js data', group='js', fatal=fatal, **kw), - video_id, transform_source=transform_source, fatal=fatal) - def __handle_request_webpage_error(self, err, video_id=None, errnote=None, fatal=True): if errnote is False: return False @@ -109,7 +100,9 @@ class ITVBaseIE(InfoExtractor): class ITVIE(ITVBaseIE): _VALID_URL = r'https?://(?:www\.)?itv\.com/(?:(?P<w>watch)|hub)/[^/]+/(?(w)[\w-]+/)(?P<id>\w+)' - _IE_DESC = 'ITVX' + IE_DESC = 'ITVX' + _WORKING = False + _TESTS = [{ 'note': 'Hub URLs redirect to ITVX', 'url': 'https://www.itv.com/hub/liar/2a4547a0012', @@ -270,7 +263,7 @@ class ITVIE(ITVBaseIE): 'ext': determine_ext(href, 'vtt'), }) - next_data = self._search_nextjs_data(webpage, video_id, fatal=False, default='{}') + next_data = self._search_nextjs_data(webpage, video_id, fatal=False, default={}) video_data.update(traverse_obj(next_data, ('props', 'pageProps', ('title', 'episode')), expected_type=dict)[0] or {}) title = traverse_obj(video_data, 'headerTitle', 'episodeTitle') info = self._og_extract(webpage, require_title=not title) @@ -323,7 +316,7 @@ class ITVIE(ITVBaseIE): class ITVBTCCIE(ITVBaseIE): _VALID_URL = r'https?://(?:www\.)?itv\.com/(?!(?:watch|hub)/)(?:[^/]+/)+(?P<id>[^/?#&]+)' - _IE_DESC = 'ITV articles: News, British Touring Car Championship' + IE_DESC = 'ITV articles: News, British Touring Car Championship' _TESTS = [{ 'note': 'British Touring Car Championship', 'url': 'https://www.itv.com/btcc/articles/btcc-2018-all-the-action-from-brands-hatch', |