-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstaDownloader.py
More file actions
50 lines (39 loc) · 1.18 KB
/
instaDownloader.py
File metadata and controls
50 lines (39 loc) · 1.18 KB
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
42
43
44
45
46
47
48
49
50
from tkinter import *
import instaloader
import urllib
from urllib.request import urlopen
from PIL import Image, ImageTk
import io
# instagram
insta = instaloader.Instaloader()
# window
window = Tk()
window.geometry("600x600")
window.maxsize(800,800)
window.minsize(400,400)
window.title("Instagram Profile Downloader")
label = Label(window,text="Type the username here: ")
label.pack()
label_pic = Label(window)
def buttonFunc():
# print("You pressed the button! >-<")
# button.config(text="Downloaded Already!")
profile = instaloader.Profile.from_username(insta.context,input.get())
# print(profile.followers)
# label.config(text=input.get())
username_link = profile.get_profile_pic_url()
# print(username)
username_url = urlopen(username_link)
data = username_url.read()
username_url.close()
img = Image.open(io.BytesIO(data))
profile_pic = ImageTk.PhotoImage(img)
label_pic.config(image=profile_pic)
label_pic.image = profile_pic
label_pic.pack()
button = Button(window,text="Click here to download",fg="white",bg="black",command=buttonFunc)
button.pack()
# button.place(300,300)
input = Entry(window)
input.pack()
window.mainloop()