Last active
April 24, 2018 10:51
-
-
Save sae13/f7013f2a340611183a05ecdb0fd947ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from subprocess import run, getoutput | |
from time import sleep | |
from pytg.sender import Sender | |
dlDir = "/tmp/es6/dl" | |
sentDir = "/tmp/es6/sent" | |
sender = Sender('localhost',6670) | |
to = "$050000007d208f3f0115b300fb607ab4" | |
ls = getoutput('find {} -name "*.*"'.format(dlDir)).splitlines() | |
for i in ls: | |
caption = i.split('/')[-1] | |
sent = sender.send_video(to,i,caption, | |
retry_connect=500,result_timeout=1000) | |
if sent: | |
run(['mv', i ,sentDir]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment