diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-10-09 16:09:36 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-09 16:09:36 +0530 |
commit | ade1fa70cbaaaadaa4772e5f0564870cea3167ef (patch) | |
tree | 84dc8012237bfcf73bf2ff98b390ce480eb8e54f /yt_dlp/extractor/common.py | |
parent | 4c9a1a3ba56c2906f9ef8d768de7f8e5a2361144 (diff) |
[extractor/generic] Separate embed extraction into own function (#5176)
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r-- | yt_dlp/extractor/common.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 18a52a855..10d44d95a 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -66,6 +66,7 @@ from ..utils import ( sanitize_filename, sanitize_url, sanitized_Request, + smuggle_url, str_or_none, str_to_int, strip_or_none, @@ -3873,6 +3874,12 @@ class InfoExtractor: def RetryManager(self, **kwargs): return RetryManager(self.get_param('extractor_retries', 3), self._error_or_warning, **kwargs) + def _extract_generic_embeds(self, url, *args, info_dict={}, note='Extracting generic embeds', **kwargs): + display_id = traverse_obj(info_dict, 'display_id', 'id') + self.to_screen(f'{format_field(display_id, None, "%s: ")}{note}') + return self._downloader.get_info_extractor('Generic')._extract_embeds( + smuggle_url(url, {'block_ies': [self.ie_key()]}), *args, **kwargs) + @classmethod def extract_from_webpage(cls, ydl, url, webpage): ie = (cls if isinstance(cls._extract_from_webpage, types.MethodType) |