diff options
author | xarantolus <xarantolus@protonmail.com> | 2020-07-30 16:38:56 +0200 |
---|---|---|
committer | xarantolus <xarantolus@protonmail.com> | 2020-09-06 09:22:46 +0200 |
commit | f536080701c29829d6eebefeb4915307ee44e7d8 (patch) | |
tree | d9b1fdea19d0f29f9dd43e3344f256c129502df1 | |
parent | 5c430b67bd6befe4c5f257ba40b8d51979c1028c (diff) | |
download | hypervideo-pre-f536080701c29829d6eebefeb4915307ee44e7d8.tar.lz hypervideo-pre-f536080701c29829d6eebefeb4915307ee44e7d8.tar.xz hypervideo-pre-f536080701c29829d6eebefeb4915307ee44e7d8.zip |
Run formatter
-rw-r--r-- | youtube_dl/extractor/youtube.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 64c4ef32c..d97e0ab4e 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -3314,7 +3314,7 @@ class YoutubeFeedsInfoExtractor(YoutubeBaseInfoExtractor): """ _LOGIN_REQUIRED = True _FEED_DATA = r'window\[\"ytInitialData\"\]\W?=\W?({.*?});' - _YTCFG_DATA = r"ytcfg.set\(({.*?})\)" + _YTCFG_DATA = r"ytcfg.set\(({.*?})\)" @property def IE_NAME(self): @@ -3323,10 +3323,9 @@ class YoutubeFeedsInfoExtractor(YoutubeBaseInfoExtractor): def _real_initialize(self): self._login() - def _find_videos_in_json(self, extracted): videos = [] - continuation = None + continuation = None def _real_find(obj): if obj is None or isinstance(obj, str): @@ -3340,19 +3339,19 @@ class YoutubeFeedsInfoExtractor(YoutubeBaseInfoExtractor): if "videoId" in obj: videos.append(obj) return - + if "nextContinuationData" in obj: nonlocal continuation continuation = obj["nextContinuationData"] - return - + return + for _, o in obj.items(): _real_find(o) _real_find(extracted) return videos, continuation - + def _entries(self, page): info = [] @@ -3363,14 +3362,14 @@ class YoutubeFeedsInfoExtractor(YoutubeBaseInfoExtractor): for page_num in itertools.count(1): video_info, continuation = self._find_videos_in_json(search_response) - new_info = [] + new_info = [] for v in video_info: v_id = try_get(v, lambda x: x['videoId']) if not v_id: continue - have_video = False + have_video = False for old in info: if old['videoId'] == v_id: have_video = True @@ -3406,7 +3405,7 @@ class YoutubeFeedsInfoExtractor(YoutubeBaseInfoExtractor): "X-YouTube-Device": try_get(yt_conf, lambda x: x["DEVICE"]), "X-YouTube-Page-CL": try_get(yt_conf, lambda x: x["PAGE_CL"]), "X-YouTube-Page-Label": try_get(yt_conf, lambda x: x["PAGE_BUILD_LABEL"]), - "X-YouTube-Variants-Checksum": try_get(yt_conf, lambda x: x["VARIANTS_CHECKSUM"]), + "X-YouTube-Variants-Checksum": try_get(yt_conf, lambda x: x["VARIANTS_CHECKSUM"]), }) def _real_extract(self, url): |