Skip to content

Commit eb545f7

Browse files
committed
Added Instagram Profile Downloader in Automation Scripts
1 parent 744b3cf commit eb545f7

File tree

15 files changed

+217
-0
lines changed

15 files changed

+217
-0
lines changed
103 KB
Loading
60.1 KB
Loading
107 KB
Loading
191 KB
Loading
97.1 KB
Loading
122 KB
Loading
133 KB
Loading
112 KB
Loading
150 KB
Loading
116 KB
Loading
147 KB
Loading
55.8 KB
Loading
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# ✔ INSTAGRAM PROFILE DOWNLOADER
2+
- ### An "Instagram Profile Downloader" is an Automation Script created in python with tkinter gui and OpenCv library.
3+
- ### In this application user will be able to download the profile of any instagram user using his/her insta user name.
4+
- ### User will also be able to see the profile pic of that user and also get the insta user id also.
5+
6+
****
7+
8+
# REQUIREMENTS :
9+
- ### python 3
10+
- ### tkinter module
11+
- ### filedialog from tkinter
12+
- ### messagebox
13+
- ### from PIL import Image, ImageTk
14+
- ### cv2
15+
- ### glob
16+
- ### webbrowser
17+
- ### instaloader
18+
19+
****
20+
21+
# HOW TO Use it :
22+
- ### User just need to download the file, and run the instagram_profile_downloader.py, on local system.
23+
- ### After running a GUI window appears, where user can start the application by clicking on the START button.
24+
- ### Before that if user wants to go to instagram through this window, he/she can go by clicking on GO TO INSTAGRAM button.
25+
- ### when user clicks on the START, a new GUI window will open, in which user will have buttons like DOWNLOAD, PROFILE, CLEAR and EXIT.
26+
- ### First user needs to enter the insta user name, and can download the profile using DOWNLOAD button.
27+
- ### The profile will download and saved to the project directory.
28+
- ### Also user will be able to see the INSTA user ID while the download is completed.
29+
- ### Along with that, user can also see the profile pic by clicking on the PROFILE button, which will show image of that user profile.
30+
- ### Also there is a CLEAR button, clicking on which user can clear username entry that user has entered previously.
31+
- ### Also there is an EXIT button clicking opn which user can exit from the application.
32+
33+
# Purpose :
34+
- ### This scripts helps user to easily to download the profile of any Instagram user and get the insta id and profile pic.
35+
36+
# Compilation Steps :
37+
- ### Install tkinter, PIL, cv2, glob, webbrowser, instaloader
38+
- ### After that download the code file, and run instagram_profile_downloader.py on local system.
39+
- ### Then the script will start running and user can explore it by entering any insta user name, and dowloading the profile for the same.
40+
41+
****
42+
43+
# SCREENSHOTS :
44+
****
45+
46+
<p align="center">
47+
<img width = 1000 src="Images/1.jpg" /><br>
48+
<img width = 1000 src="Images/2.jpg" /><br>
49+
<img width = 1000 src="Images/3.jpg" /><br>
50+
<img width = 1000 src="Images/4.jpg" /><br>
51+
<img width = 1000 src="Images/5.jpg" /><br>
52+
<img width = 1000 src="Images/6.jpg" /><br>
53+
<img width = 1000 src="Images/7.jpg" /><br>
54+
<img width = 1000 src="Images/8.jpg" /><br>
55+
<img width = 1000 src="Images/9.jpg" /><br>
56+
<img width = 1000 src="Images/10.jpg" /><br>
57+
<img width = 1000 src="Images/11.jpg" /><br>
58+
</p>
59+
60+
****
61+
62+
# Name :
63+
- ### Akash Ramanand Rajak
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
2+
# INSTAGRAM PROFILE DOWNLOADER
3+
4+
# imported necessary library
5+
from tkinter import *
6+
import tkinter as tk
7+
import tkinter.messagebox as mbox
8+
from pil import ImageTk, Image
9+
import cv2
10+
import glob
11+
import webbrowser
12+
import instaloader
13+
14+
15+
# Main Window & Configuration
16+
window = tk.Tk() # created a tkinter gui window frame
17+
window.title("Instagram File Downloader")
18+
window.geometry('1000x710')
19+
20+
#Define a callback function
21+
def callback(url):
22+
webbrowser.open_new_tab(url)
23+
24+
# top label
25+
start1 = tk.Label(text = "INSTA", font=("Arial", 45), fg="magenta3") # same way bg
26+
start1.place(x = 30, y = 10)
27+
28+
# top label
29+
start1 = tk.Label(text = "PROFILE", font=("Arial", 45), fg="VioletRed1") # same way bg
30+
start1.place(x = 240, y = 10)
31+
32+
# top label
33+
start1 = tk.Label(text = "DOWNLOADER", font=("Arial", 45), fg="gold2") # same way bg
34+
start1.place(x = 530, y = 10)
35+
36+
37+
def start_fun():
38+
window.destroy()
39+
40+
# start button created
41+
startb = Button(window, text="▶\nSTART",command=start_fun,font=("Arial", 25), bg = "light green", fg = "blue", borderwidth=3, relief="raised")
42+
startb.place(x =50 , y =320 )
43+
44+
# goto button created
45+
gotob = Button(window, text="GO TO INSTAGRAM",command=lambda:callback("https://www.instagram.com/"),font=("Arial", 25), bg = "orange", fg = "blue", borderwidth=3, relief="raised")
46+
gotob.place(x =335 , y =615 )
47+
48+
# image on the main window
49+
path = "Images/front.png"
50+
# Creates a Tkinter-compatible photo image, which can be used everywhere Tkinter expects an image object.
51+
img1 = ImageTk.PhotoImage(Image.open(path))
52+
# The Label widget is a standard Tkinter widget used to display a text or image on the screen.
53+
panel = tk.Label(window, image = img1)
54+
panel.place(x = 250, y = 80)
55+
56+
# function created for exiting
57+
def exit_win():
58+
if mbox.askokcancel("Exit", "Do you want to exit?"):
59+
window.destroy()
60+
61+
# exit button created
62+
exitb = Button(window, text="❌\n EXIT ",command=exit_win,font=("Arial", 25), bg = "red", fg = "blue", borderwidth=3, relief="raised")
63+
exitb.place(x =820 , y = 320 )
64+
window.protocol("WM_DELETE_WINDOW", exit_win)
65+
window.mainloop()
66+
67+
# Main Window & Configuration
68+
window1 = tk.Tk() # created a tkinter gui window frame
69+
window1.title("Instagram File Downloader") # title given is "DICTIONARY"
70+
window1.geometry('1000x700')
71+
72+
73+
def preview_fun():
74+
global entered_user_name
75+
76+
path1 = "./" + entered_user_name + "/*.jpg"
77+
# print(path1)
78+
# print(glob.glob(path1))
79+
for img in glob.glob(path1):
80+
# print("ksjd")
81+
cv_img = cv2.imread(img)
82+
cv2.imshow("Profile Pic", cv_img)
83+
84+
def down_fun():
85+
global entered_user_name
86+
entered_user_name = str(path_text.get("1.0", "end-1c"))
87+
88+
ig = instaloader.Instaloader()
89+
ig.download_profile(entered_user_name, profile_pic_only=True)
90+
91+
path = "./" + entered_user_name + "/id"
92+
# print(path)
93+
file1 = open(path, "r")
94+
# print(file1.read())
95+
id1.configure(text=str(file1.read()))
96+
mbox.showinfo("Success",entered_user_name + "'s Profile Downloaded Successfully.\n\nAnd Saved to Project Directory.")
97+
98+
start1 = tk.Label(text = "INSTAGRAM", font=("Arial", 55), fg="magenta3") # same way bg
99+
start1.place(x = 80, y = 10)
100+
101+
# top label
102+
start1 = tk.Label(text = "PROFILE", font=("Arial", 55), fg="VioletRed1") # same way bg
103+
start1.place(x = 570, y = 10)
104+
105+
# top label
106+
start1 = tk.Label(text = "DOWNLOADER", font=("Arial", 55), fg="gold2") # same way bg
107+
start1.place(x = 220, y = 90)
108+
109+
lbl1 = tk.Label(text="Enter Insta User Name...", font=("Arial", 30),fg="brown") # same way bg
110+
lbl1.place(x=80, y=220)
111+
112+
path_text = tk.Text(window1, height=1, width=37, font=("Arial", 30), bg="light yellow", fg="orange",borderwidth=2, relief="solid")
113+
path_text.place(x=80, y = 280)
114+
115+
lbl1 = tk.Label(text="Insta User ID : ", font=("Arial", 30),fg="brown") # same way bg
116+
lbl1.place(x=80, y=400)
117+
118+
id1 = tk.Label(font=("Arial", 30),fg="orange") # same way bg
119+
id1.place(x=360, y=400)
120+
121+
# Get Images Button
122+
getb=Button(window1, text="DOWNLOAD",command=down_fun, font=("Arial", 25), bg = "light green", fg = "blue")
123+
getb.place(x = 400, y = 500)
124+
125+
# Get Images Button
126+
getb=Button(window1, text="PROFILE",command=preview_fun, font=("Arial", 25), bg = "orange", fg = "blue")
127+
getb.place(x = 100, y = 590)
128+
129+
def clear_fun():
130+
path_text.delete("1.0", "end")
131+
132+
# Get Images Button
133+
clearb=Button(window1, text="CLEAR",command=clear_fun, font=("Arial", 25), bg = "yellow", fg = "blue")
134+
clearb.place(x = 445, y = 590)
135+
136+
def exit_win1():
137+
if mbox.askokcancel("Exit", "Do you want to exit?"):
138+
window1.destroy()
139+
140+
# Get Images Button
141+
getb=Button(window1, text="EXIT",command=exit_win1, font=("Arial", 25), bg = "red", fg = "blue")
142+
getb.place(x = 780, y = 590)
143+
144+
window1.protocol("WM_DELETE_WINDOW", exit_win1)
145+
window1.mainloop()
146+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
libraries used : tkinter
2+
from tkinter import filedialog
3+
import tkinter.messagebox
4+
from PIL import ImageTk, Image
5+
cv2
6+
glob
7+
webbrowser
8+
instaloader

0 commit comments

Comments
 (0)