mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 11:24:02 +03:00
[twitter] small fix
This commit is contained in:
parent
8ef66a3173
commit
e674bfbc2b
@ -63,11 +63,15 @@ def twitter_download(url, output_dir='.', merge=True, info_only=False, **kwargs)
|
|||||||
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]:
|
elif 'entities' in info['globalObjects']['tweets'][item_id]:
|
||||||
# if the tweet contains video from another tweet, download it
|
# if the tweet contains media from another tweet, download it
|
||||||
# FIXME: multiple urls?
|
expanded_url = None
|
||||||
expanded_url = info['globalObjects']['tweets'][item_id]['entities']['urls'][0]['expanded_url']
|
for j in info['globalObjects']['tweets'][item_id]['entities']['urls']:
|
||||||
item_id = r1(r'/(\d+)/video', expanded_url)
|
if re.match(r'^https://twitter.com/.*', j['expanded_url']):
|
||||||
assert False
|
# FIXME: multiple valid expanded_url's?
|
||||||
|
expanded_url = j['expanded_url']
|
||||||
|
if expanded_url is not None:
|
||||||
|
item_id = r1(r'/status/(\d+)', 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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user