mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 00:33:58 +03:00
[twitter] if the tweet contains video from another tweet, download it
This commit is contained in:
parent
9f608990ee
commit
8ef66a3173
@ -62,6 +62,13 @@ def twitter_download(url, output_dir='.', merge=True, info_only=False, **kwargs)
|
|||||||
# if the tweet contains media, download them
|
# if the tweet contains media, download them
|
||||||
media = info['globalObjects']['tweets'][item_id]['extended_entities']['media']
|
media = info['globalObjects']['tweets'][item_id]['extended_entities']['media']
|
||||||
|
|
||||||
|
elif 'entities' in info['globalObjects']['tweets'][item_id]:
|
||||||
|
# if the tweet contains video from another tweet, download it
|
||||||
|
# FIXME: multiple urls?
|
||||||
|
expanded_url = info['globalObjects']['tweets'][item_id]['entities']['urls'][0]['expanded_url']
|
||||||
|
item_id = r1(r'/(\d+)/video', expanded_url)
|
||||||
|
assert False
|
||||||
|
|
||||||
elif info['globalObjects']['tweets'][item_id].get('is_quote_status') == True:
|
elif info['globalObjects']['tweets'][item_id].get('is_quote_status') == True:
|
||||||
# if the tweet does not contain media, but it quotes a tweet
|
# if the tweet does not contain media, but it quotes a tweet
|
||||||
# and the quoted tweet contains media, download them
|
# and the quoted tweet contains media, download them
|
||||||
|
Loading…
Reference in New Issue
Block a user