-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuploader.py
36 lines (34 loc) · 1.38 KB
/
uploader.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
from instagrapi import Client
from instagrapi.types import Usertag,Location
import os
import json
from details import username, password
from extras import remove_uploaded
def upload():
cl = Client()
print(cl)
cl.login(username, password)
os.chdir("tooUpload")
li = os.listdir("readytoupload")
print(li)
f = open('info.json',"r")
data = json.loads(f.read())
caption = '''{0}
follow me now :- @legendarymemezs
.
.
it is a re-reddit postedt by {1}
.
.
#memeimages #newestmemes #todaymemes #recentmemes #decentmemes #memearmy #memedose #memehumor #questionablememes #sickmeme #oldmeme #unusualmeme #memeculture #memehour #bizarrememe #scarymeme #sarcasm #goofymemes #entertaining #ironic #stupidmemes #crazymemes #lightmeme #annoyingthings #memehearted #wtfmeme #dogmemes #catmeme #fortnitememes #clevermemes'''
print ("start to upload")
for l in li:
a = l.split(".")
if a[1] == "mp4" and len(a) == 2 :
print("upload reel")
media = cl.clip_upload("readytoupload/{0}".format(str(l)),caption.format(data[int(a[0])][1],data[int(a[0])][2]),location=Location(name='USA', lat=40.71, lng=74.00))
elif a[1] == "jpg" and len(a) == 2:
print("upload pic")
media = cl.photo_upload("readytoupload/{0}".format(str(l)),caption.format(data[int(a[0])][1],data[int(a[0])][2]),location=Location(name='USA',lat=40.71, lng=74.00))
else:
print ("unknown")