mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-26 03:56:49 -05:00
[fix] python 2 "url" field is missing or empty
`try_get` fails for `expected_type=str`, because in python 2 string has `unicode` type. This commit removes the `expected_type` to disable the comparison.
This commit is contained in:
parent
6255e567d9
commit
b19eec0d33
@ -34,7 +34,7 @@ class TikTokBaseIE(InfoExtractor):
|
|||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
formats.append({
|
formats.append({
|
||||||
'url': try_get(video_info, lambda x: x['video']['urls'][0], str),
|
'url': try_get(video_info, lambda x: x['video']['urls'][0]),
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'height': height,
|
'height': height,
|
||||||
'width': width
|
'width': width
|
||||||
@ -47,7 +47,7 @@ class TikTokBaseIE(InfoExtractor):
|
|||||||
'id': str_or_none(video_info.get('id')),
|
'id': str_or_none(video_info.get('id')),
|
||||||
'like_count': int_or_none(video_info.get('diggCount')),
|
'like_count': int_or_none(video_info.get('diggCount')),
|
||||||
'repost_count': int_or_none(video_info.get('shareCount')),
|
'repost_count': int_or_none(video_info.get('shareCount')),
|
||||||
'thumbnail': try_get(video_info, lambda x: x['covers'][0], str),
|
'thumbnail': try_get(video_info, lambda x: x['covers'][0]),
|
||||||
'timestamp': timestamp,
|
'timestamp': timestamp,
|
||||||
'width': width,
|
'width': width,
|
||||||
'title': self._og_search_title(webpage),
|
'title': self._og_search_title(webpage),
|
||||||
|
Loading…
Reference in New Issue
Block a user