mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-30 06:05:13 +00:00
[extractors] Use new framework for existing embeds (#4307)
`Brightcove` is difficult to migrate because it's subclasses may depend on the signature of the current functions. So it is left as-is for now Note: Tests have not been migrated
This commit is contained in:
@@ -104,7 +104,7 @@ class MegaTVComEmbedIE(MegaTVComBaseIE):
|
||||
IE_NAME = 'megatvcom:embed'
|
||||
IE_DESC = 'megatv.com embedded videos'
|
||||
_VALID_URL = r'(?:https?:)?//(?:www\.)?megatv\.com/embed/?\?p=(?P<id>\d+)'
|
||||
_EMBED_RE = re.compile(rf'''<iframe[^>]+?src=(?P<_q1>["'])(?P<url>{_VALID_URL})(?P=_q1)''')
|
||||
_EMBED_REGEX = [rf'''<iframe[^>]+?src=(?P<_q1>["'])(?P<url>{_VALID_URL})(?P=_q1)''']
|
||||
|
||||
_TESTS = [{
|
||||
'url': 'https://www.megatv.com/embed/?p=2020520979',
|
||||
@@ -134,11 +134,6 @@ class MegaTVComEmbedIE(MegaTVComBaseIE):
|
||||
},
|
||||
}]
|
||||
|
||||
@classmethod
|
||||
def _extract_urls(cls, webpage):
|
||||
for mobj in cls._EMBED_RE.finditer(webpage):
|
||||
yield unescapeHTML(mobj.group('url'))
|
||||
|
||||
def _match_canonical_url(self, webpage):
|
||||
LINK_RE = r'''(?x)
|
||||
<link(?:
|
||||
|
||||
Reference in New Issue
Block a user