Skip to content

Instantly share code, notes, and snippets.

@sae13
Last active April 24, 2018 10:51
Show Gist options
  • Save sae13/f7013f2a340611183a05ecdb0fd947ea to your computer and use it in GitHub Desktop.
Save sae13/f7013f2a340611183a05ecdb0fd947ea to your computer and use it in GitHub Desktop.
#!/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