mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-29 21:57:50 +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:
@@ -1,7 +1,6 @@
|
||||
import itertools
|
||||
import json
|
||||
import random
|
||||
import re
|
||||
import string
|
||||
import time
|
||||
|
||||
@@ -379,6 +378,7 @@ class TikTokBaseIE(InfoExtractor):
|
||||
|
||||
class TikTokIE(TikTokBaseIE):
|
||||
_VALID_URL = r'https?://www\.tiktok\.com/(?:embed|@(?P<user_id>[\w\.-]+)/video)/(?P<id>\d+)'
|
||||
_EMBED_REGEX = [rf'<(?:script|iframe)[^>]+\bsrc=(["\'])(?P<url>{_VALID_URL})']
|
||||
|
||||
_TESTS = [{
|
||||
'url': 'https://www.tiktok.com/@leenabhushan/video/6748451240264420610',
|
||||
@@ -529,11 +529,6 @@ class TikTokIE(TikTokBaseIE):
|
||||
'only_matching': True
|
||||
}]
|
||||
|
||||
@classmethod
|
||||
def _extract_urls(cls, webpage):
|
||||
return [mobj.group('url') for mobj in re.finditer(
|
||||
rf'<(?:script|iframe)[^>]+\bsrc=(["\'])(?P<url>{cls._VALID_URL})', webpage)]
|
||||
|
||||
def _extract_aweme_app(self, aweme_id):
|
||||
try:
|
||||
aweme_detail = self._call_api('aweme/detail', {'aweme_id': aweme_id}, aweme_id,
|
||||
|
||||
Reference in New Issue
Block a user