mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-28 11:36:22 +00:00
** Added contentLocation and poi fields to info.json of tiktok videos which have the field defined.
This commit is contained in:
parent
b77e5a553a
commit
0bf675ee55
@ -232,6 +232,15 @@ class TikTokBaseIE(InfoExtractor):
|
|||||||
self.report_warning(f'{message}. {self._login_hint()}')
|
self.report_warning(f'{message}. {self._login_hint()}')
|
||||||
return video_data, status
|
return video_data, status
|
||||||
|
|
||||||
|
# this is the area the main video info is being extracted from
|
||||||
|
# in the present case data from TikTok is being extracted from
|
||||||
|
# a series of "script" tags with types application/json
|
||||||
|
# locationCreated is the tag being looked for to retrieve
|
||||||
|
# location tag from and is housed under
|
||||||
|
# __UNIVERSAL_DATA_FOR_REHYDRATION__
|
||||||
|
# again.
|
||||||
|
# tags includedin the finished video_data such as "author" seem to be
|
||||||
|
# included in this section.
|
||||||
if universal_data := self._get_universal_data(webpage, video_id):
|
if universal_data := self._get_universal_data(webpage, video_id):
|
||||||
self.write_debug('Found universal data for rehydration')
|
self.write_debug('Found universal data for rehydration')
|
||||||
status = traverse_obj(universal_data, ('webapp.video-detail', 'statusCode', {int})) or 0
|
status = traverse_obj(universal_data, ('webapp.video-detail', 'statusCode', {int})) or 0
|
||||||
@ -580,11 +589,16 @@ class TikTokBaseIE(InfoExtractor):
|
|||||||
'uploader_id': (('authorId', 'uid', 'id'), {str_or_none}),
|
'uploader_id': (('authorId', 'uid', 'id'), {str_or_none}),
|
||||||
}), get_all=False)
|
}), get_all=False)
|
||||||
|
|
||||||
|
streetAddress = traverse_obj(aweme_detail,('contentLocation','address'))
|
||||||
|
pointOfInterest = traverse_obj(aweme_detail,('poi'))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'formats': None if extract_flat else self._extract_web_formats(aweme_detail),
|
'formats': None if extract_flat else self._extract_web_formats(aweme_detail),
|
||||||
'subtitles': None if extract_flat else self.extract_subtitles(aweme_detail, video_id, None),
|
'subtitles': None if extract_flat else self.extract_subtitles(aweme_detail, video_id, None),
|
||||||
'http_headers': {'Referer': webpage_url},
|
'http_headers': {'Referer': webpage_url},
|
||||||
|
'contentLocation':streetAddress,
|
||||||
|
'pointOfInterest':pointOfInterest,
|
||||||
**author_info,
|
**author_info,
|
||||||
'channel_url': format_field(author_info, 'channel_id', self._UPLOADER_URL_FORMAT, default=None),
|
'channel_url': format_field(author_info, 'channel_id', self._UPLOADER_URL_FORMAT, default=None),
|
||||||
'uploader_url': format_field(
|
'uploader_url': format_field(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user