-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (37 loc) · 823 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
from red import download
import img1
import json
import vidg
from uploader import upload
from extras import remove_uploaded
# download from redit
# correct ratio
# upload to instagram
def main():
download()
#os.chdir("/home/img/downloads")
print("downloads completed")
f = open('info.json',"r")
data = json.loads(f.read())
#print(data)
files = os.listdir("downloads")
for fi in files:
name,ext = fi.split(".")
print("starting to process {0}". format (fi))
if ext == "mp4":
vidg.pura_vid(name)
elif ext == "jpeg":
img1.ratio_img(name)
elif ext=="json":
continue
else:
print("filename error")
print("{0} done".format(fi))
upload()
f = open('info.json',"r")
for name in f:
remove_uploaded(name)
def main2():
upload()
main()