twitools/mediatools/__init__.py

8 lines
237 B
Python
Raw Normal View History

import httptools, youtube_dl
def photoHandler(url, tid, mid):
return httptools.downloadMedia(url, tid, mid)
def videoHandler(url, tid, mid):
youtube_dl.YoutubeDL({"outtmpl": "media/%s_%s.%s" % (tid, mid, "%(ext)s")}).download([url])