mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 13:35:16 +03:00
[twitter] show the warning message if login required
This commit is contained in:
parent
43e14887a3
commit
355e22584c
@ -51,7 +51,12 @@ def twitter_download(url, output_dir='.', merge=True, info_only=False, **kwargs)
|
||||
api_content = get_content(api_url, headers={'authorization': authorization, 'x-guest-token': guest_token})
|
||||
|
||||
info = json.loads(api_content)
|
||||
if 'extended_entities' in info['globalObjects']['tweets'][item_id]:
|
||||
if item_id not in info['globalObjects']['tweets']:
|
||||
# something wrong here
|
||||
log.w(info['timeline']['instructions'][0]['addEntries']['entries'][0]['content']['item']['content']['tombstone']['tombstoneInfo']['richText']['text'])
|
||||
return
|
||||
|
||||
elif 'extended_entities' in info['globalObjects']['tweets'][item_id]:
|
||||
# if the tweet contains media, download them
|
||||
media = info['globalObjects']['tweets'][item_id]['extended_entities']['media']
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user