diff options
author | Jesús <heckyel@hyperbola.info> | 2022-12-01 23:33:30 +0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-12-01 23:33:30 +0800 |
commit | ef1a420d6de7876b7b6732abc8ab78351c5a2bfc (patch) | |
tree | 9ba7d8409aa5baa696f5fb10db5d395c2f050276 /yt_dlp/extractor/kinja.py | |
parent | 16e8548f6a720a78679e417a20a300db2036bf6c (diff) | |
parent | ddf1e22d48530819d60220d0bdc36e20f5b8483b (diff) | |
download | hypervideo-pre-ef1a420d6de7876b7b6732abc8ab78351c5a2bfc.tar.lz hypervideo-pre-ef1a420d6de7876b7b6732abc8ab78351c5a2bfc.tar.xz hypervideo-pre-ef1a420d6de7876b7b6732abc8ab78351c5a2bfc.zip |
update from upstream 2022-12-01 UTC+8
Diffstat (limited to 'yt_dlp/extractor/kinja.py')
-rw-r--r-- | yt_dlp/extractor/kinja.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/yt_dlp/extractor/kinja.py b/yt_dlp/extractor/kinja.py index c00abfbc1..df1386fb8 100644 --- a/yt_dlp/extractor/kinja.py +++ b/yt_dlp/extractor/kinja.py @@ -1,5 +1,3 @@ -import re - from .common import InfoExtractor from ..compat import ( compat_str, @@ -10,8 +8,6 @@ from ..utils import ( parse_iso8601, strip_or_none, try_get, - unescapeHTML, - urljoin, ) @@ -55,6 +51,7 @@ class KinjaEmbedIE(InfoExtractor): vine| youtube-(?:list|video) )-(?P<id>[^&]+)''' % (_DOMAIN_REGEX, _COMMON_REGEX) + _EMBED_REGEX = [rf'(?x)<iframe[^>]+?src=(?P<q>["\'])(?P<url>(?:(?:https?:)?//{_DOMAIN_REGEX})?{_COMMON_REGEX}(?:(?!\1).)+)\1'] _TESTS = [{ 'url': 'https://kinja.com/ajax/inset/iframe?id=fb-10103303356633621', 'only_matching': True, @@ -119,12 +116,6 @@ class KinjaEmbedIE(InfoExtractor): 'youtube-video': ('youtube.com/embed/', 'Youtube'), } - @staticmethod - def _extract_urls(webpage, url): - return [urljoin(url, unescapeHTML(mobj.group('url'))) for mobj in re.finditer( - r'(?x)<iframe[^>]+?src=(?P<q>["\'])(?P<url>(?:(?:https?:)?//%s)?%s(?:(?!\1).)+)\1' % (KinjaEmbedIE._DOMAIN_REGEX, KinjaEmbedIE._COMMON_REGEX), - webpage)] - def _real_extract(self, url): video_type, video_id = self._match_valid_url(url).groups() @@ -156,7 +147,6 @@ class KinjaEmbedIE(InfoExtractor): formats.extend(self._extract_m3u8_formats( m3u8_url, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False)) - self._sort_formats(formats) thumbnail = None poster = data.get('poster') or {} @@ -204,8 +194,6 @@ class KinjaEmbedIE(InfoExtractor): 'url': fallback_rendition_url, }) - self._sort_formats(formats) - return { 'id': video_id, 'title': title, |