hopefully this fixes
@@ -11,22 +11,21 @@ from __future__ import print_function
import json
import fileinput
-for line in fileinput.input():
+for line in fileinput.input(openhook=fileinput.hook_encoded("utf8")):
tweet = json.loads(line)
+ id = tweet['id_str']
if 'media' in tweet['entities']:
for media in tweet['entities']['media']:
if media['type'] == 'photo':
- print(media['media_url_https'])
+ print(id, media['media_url_https'])
if 'extended_entities' in tweet and 'media' in tweet['extended_entities']:
for media in tweet['extended_entities']['media']:
if media['type'] == 'animated_gif':
- print(media['media_url_https'])
+ print(id, media['media_url_https'])
if 'video_info' in media:
for v in media['video_info']['variants']:
- print(v['url'])
-
-
+ print(id, v['url'])
