[tiktok] Fix vm.tiktok URLs

Closes #2396
This commit is contained in:
pukkandan 2022-02-13 20:11:03 +05:30
parent 57ebfca39b
commit 88afe05695
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39
2 changed files with 11 additions and 0 deletions

View File

@ -1613,6 +1613,7 @@
TikTokSoundIE, TikTokSoundIE,
TikTokEffectIE, TikTokEffectIE,
TikTokTagIE, TikTokTagIE,
TiktokVMIE,
DouyinIE, DouyinIE,
) )
from .tinypic import TinyPicIE from .tinypic import TinyPicIE

View File

@ -14,6 +14,7 @@
) )
from ..utils import ( from ..utils import (
ExtractorError, ExtractorError,
HEADRequest,
int_or_none, int_or_none,
join_nonempty, join_nonempty,
LazyList, LazyList,
@ -817,3 +818,12 @@ def _real_extract(self, url):
render_data_json, video_id, transform_source=compat_urllib_parse_unquote) render_data_json, video_id, transform_source=compat_urllib_parse_unquote)
return self._parse_aweme_video_web( return self._parse_aweme_video_web(
traverse_obj(render_data, (..., 'aweme', 'detail'), get_all=False), url) traverse_obj(render_data, (..., 'aweme', 'detail'), get_all=False), url)
class TiktokVMIE(InfoExtractor):
_VALID_URL = r'https?://vm.tiktok.com/(?P<id>\w+)'
IE_NAME = 'vm.tiktok'
def _real_extract(self, url):
return self.url_result(self._request_webpage(
HEADRequest(url), self._match_id(url), headers={'User-Agent': 'facebookexternalhit/1.1'}).geturl(), TikTokIE)