File tree Expand file tree Collapse file tree 2 files changed +50
-1
lines changed
Expand file tree Collapse file tree 2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 2828insta_post = urlopen (url )
2929bs = BeautifulSoup (insta_post , "lxml" )
3030
31- ## Find Insta Post Image
31+ ## Find Insta Post Image URL
3232metatag = bs .find ("meta" , {"property" : "og:image" })
3333
3434if metatag is not None :
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+
3+ ## Instagram Post Video Downloader
4+ ## Install Python pip Modules
5+
6+ # Python2 (pip)
7+ ## pip install wget
8+ ## pip install beautifulsoup4
9+ ## pip install lxml
10+
11+ # Python3 (pip)
12+ ## pip3 install wget
13+ ## pip3 install beautifulsoup4
14+ ## pip3 install lxml
15+
16+ from bs4 import BeautifulSoup
17+ import wget
18+
19+ try : #python3
20+ from urllib .request import urlopen
21+ except : #python2
22+ from urllib2 import urlopen
23+ input = raw_input
24+
25+ ## User input
26+ url = input ("\033 [1;32mEnter a Instagram Post URL : \033 [1;m" )
27+
28+ insta_post = urlopen (url )
29+ bs = BeautifulSoup (insta_post , "lxml" )
30+
31+ ## Find Insta Post Video URL
32+ metatag = bs .find ("meta" , {"property" : "og:video:secure_url" })
33+
34+ if metatag is not None :
35+
36+ print (metatag ["content" ])
37+ print ("\n " )
38+
39+ print ("Video Started Downloading......." )
40+
41+ ## Download Image via Wget
42+ filename = wget .download (metatag ["content" ])
43+ print ("\n " )
44+
45+ print ("Done" )
46+ print ("\n " )
47+
48+ else :
49+ print ("Error" )
You can’t perform that action at this time.
0 commit comments