twitools/mediatools/__init__.py

7 lines
237 B
Python

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])