Fix media downloader
This commit is contained in:
parent
fb407786a6
commit
f4c4dbf06c
1 changed files with 2 additions and 2 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue