Fix media downloader

This commit is contained in:
Klaus-Uwe Mitterer 2017-03-29 15:37:25 +02:00
parent fb407786a6
commit f4c4dbf06c

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import argparse, dbtools, filters.filler, mediatools, requests, setuptools, time, twitools import httptools, argparse, dbtools, filters.filler, mediatools, requests, setuptools, time, twitools
def getTweets(db=dbtools.dbHelper(), user=twitools.twObject().whoami(), two=twitools.twObject()): def getTweets(db=dbtools.dbHelper(), user=twitools.twObject().whoami(), two=twitools.twObject()):
savepoint = db.getLatestTweet() + 1 savepoint = db.getLatestTweet() + 1
@ -53,7 +53,7 @@ def getMessages(db=dbtools.dbHelper(), two=twitools.twObject()):
if 'media' in m.entities: if 'media' in m.entities:
mid = 0 mid = 0
for med in m.entities['media']: for med in m.entities['media']:
downloadMedia(med['media_url'], "m%i" % int(m.id), mid) httptools.downloadMedia(med['media_url'], "m%i" % int(m.id), mid)
mid += 1 mid += 1
db.commit() db.commit()