From 0551511b45f7847f40e4314aa9e624e80d086539 Mon Sep 17 00:00:00 2001 From: Elyse <26639800+elyse0@users.noreply.github.com> Date: Fri, 10 Mar 2023 01:12:38 -0600 Subject: [PATCH 001/873] [extractor/twitch] Fix `is_live` (#6500) Closes #6494 Authored by: elyse0 --- yt_dlp/extractor/twitch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/extractor/twitch.py b/yt_dlp/extractor/twitch.py index efc7db2c9b..6321297bb1 100644 --- a/yt_dlp/extractor/twitch.py +++ b/yt_dlp/extractor/twitch.py @@ -456,7 +456,7 @@ def _extract_info_gql(self, info, item_id): thumbnail = url_or_none(info.get('previewThumbnailURL')) is_live = None if thumbnail: - if thumbnail.endswith('/404_processing_{width}x{height}.png'): + if re.findall(r'/404_processing_[^.?#]+\.png', thumbnail): is_live, thumbnail = True, None else: is_live = False From 871c907454693940cb56906ed9ea49fcb7154829 Mon Sep 17 00:00:00 2001 From: makeworld <25111343+makeworld-the-better-one@users.noreply.github.com> Date: Fri, 10 Mar 2023 02:53:19 -0500 Subject: [PATCH 002/873] [extractor/cbc:gem] Update `_VALID_URL` (#6499) Authored by: makeworld-the-better-one Closes #6395 --- yt_dlp/extractor/cbc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/cbc.py b/yt_dlp/extractor/cbc.py index 210f5f8eea..eadb3f8c02 100644 --- a/yt_dlp/extractor/cbc.py +++ b/yt_dlp/extractor/cbc.py @@ -202,7 +202,7 @@ def _real_extract(self, url): class CBCGemIE(InfoExtractor): IE_NAME = 'gem.cbc.ca' - _VALID_URL = r'https?://gem\.cbc\.ca/media/(?P[0-9a-z-]+/s[0-9]+[a-z][0-9]+)' + _VALID_URL = r'https?://gem\.cbc\.ca/(?:media/)?(?P[0-9a-z-]+/s[0-9]+[a-z][0-9]+)' _TESTS = [{ # This is a normal, public, TV show video 'url': 'https://gem.cbc.ca/media/schitts-creek/s06e01', @@ -245,6 +245,9 @@ class CBCGemIE(InfoExtractor): }, 'params': {'format': 'bv'}, 'skip': 'Geo-restricted to Canada', + }, { + 'url': 'https://gem.cbc.ca/nadiyas-family-favourites/s01e01', + 'only_matching': True, }] _GEO_COUNTRIES = ['CA'] From ab1de9cb1e39cf421c2b7dc6756c6ff1955bb313 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 10 Mar 2023 14:12:08 +0530 Subject: [PATCH 003/873] Support loading info.json with a list at it's root --- yt_dlp/YoutubeDL.py | 23 ++++++++++++----------- yt_dlp/__init__.py | 2 ++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index f701738c96..a7dced8e88 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -3376,18 +3376,19 @@ def download_with_info_file(self, info_filename): [info_filename], mode='r', openhook=fileinput.hook_encoded('utf-8'))) as f: # FileInput doesn't have a read method, we can't call json.load - info = self.sanitize_info(json.loads('\n'.join(f)), self.params.get('clean_infojson', True)) - try: - self.__download_wrapper(self.process_ie_result)(info, download=True) - except (DownloadError, EntryNotInPlaylist, ReExtractInfo) as e: - if not isinstance(e, EntryNotInPlaylist): - self.to_stderr('\r') - webpage_url = info.get('webpage_url') - if webpage_url is not None: + infos = [self.sanitize_info(info, self.params.get('clean_infojson', True)) + for info in variadic(json.loads('\n'.join(f)))] + for info in infos: + try: + self.__download_wrapper(self.process_ie_result)(info, download=True) + except (DownloadError, EntryNotInPlaylist, ReExtractInfo) as e: + if not isinstance(e, EntryNotInPlaylist): + self.to_stderr('\r') + webpage_url = info.get('webpage_url') + if webpage_url is None: + raise self.report_warning(f'The info failed to download: {e}; trying with URL {webpage_url}') - return self.download([webpage_url]) - else: - raise + self.download([webpage_url]) return self._download_retcode @staticmethod diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index 9ef31601c9..bdac1212c6 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -952,6 +952,8 @@ def _real_main(argv=None): parser.destroy() try: if opts.load_info_filename is not None: + if all_urls: + ydl.report_warning('URLs are ignored due to --load-info-json') return ydl.download_with_info_file(expand_path(opts.load_info_filename)) else: return ydl.download(all_urls) From e6ab678e36c40ded0aae305bbb866cdab554d417 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 10 Mar 2023 17:27:43 +0530 Subject: [PATCH 004/873] [extractor/hidive] Fix login Fixes https://github.com/yt-dlp/yt-dlp/issues/6493#issuecomment-1462906556 --- yt_dlp/extractor/hidive.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/hidive.py b/yt_dlp/extractor/hidive.py index 8a8749859c..df6868df65 100644 --- a/yt_dlp/extractor/hidive.py +++ b/yt_dlp/extractor/hidive.py @@ -47,15 +47,16 @@ def _perform_login(self, username, password): login_webpage = self._download_webpage( self._LOGIN_URL, None, 'Logging in', data=urlencode_postdata(data)) # If the user has multiple profiles on their account, select one. For now pick the first profile. - profile_id = self._search_regex(r'