Skip to content

Commit 6501dfa

Browse files
authored
Update Instagram Profile Pic Downloader.py
1 parent c9380ae commit 6501dfa

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed
Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
#use the following command to install instaloader
2-
#pip3 install instaloader
1+
# It will download image in hd
32

4-
import instaloader
5-
username = str(input('Enter username: '))
6-
x = instaloader.Instaloader()
7-
print(x.download_profile(username, profile_pic_only=True))
3+
import requests
4+
from bs4 import BeautifulSoup as soup
5+
6+
7+
if __name__ == '__main__':
8+
uname = str(input("Enter the username : "))
9+
new = requests.get('https://www.instadp.com/fullsize/{}'.format(uname))
10+
imgsoup = soup(new.content,'lxml')
11+
imglink = imgsoup.find('img',{'class':'picture'})['src']
12+
imgfind = requests.get(imglink)
13+
photo = open('photo.png','wb')
14+
photo.write(imgfind.content)
15+
photo.close()
16+

0 commit comments

Comments
 (0)