Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import streamlit as st
|
2 |
-
from
|
3 |
|
4 |
hide_streamlit_style = """
|
5 |
<style>
|
@@ -29,28 +29,23 @@ class InstagramDownloader:
|
|
29 |
|
30 |
if start_button:
|
31 |
if post_url:
|
32 |
-
InstagramDownloader.
|
33 |
InstagramDownloader.helper_message()
|
34 |
|
35 |
st.markdown("")
|
36 |
|
37 |
@staticmethod
|
38 |
-
def
|
39 |
-
post = Post(post_url)
|
40 |
-
video_url = post.video_url
|
41 |
-
|
42 |
with st.spinner("Downloading..."):
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
st.success("Downloaded")
|
48 |
|
49 |
@classmethod
|
50 |
def helper_message(cls):
|
51 |
st.write(
|
52 |
-
">
|
53 |
-
"click the vertical ... icon (aka hamburger button) in the bottom-right corner (in the video above) and click download."
|
54 |
)
|
55 |
|
56 |
if __name__ == "__main__":
|
|
|
1 |
import streamlit as st
|
2 |
+
from instascrape import Instascraper
|
3 |
|
4 |
hide_streamlit_style = """
|
5 |
<style>
|
|
|
29 |
|
30 |
if start_button:
|
31 |
if post_url:
|
32 |
+
InstagramDownloader.download_content(post_url)
|
33 |
InstagramDownloader.helper_message()
|
34 |
|
35 |
st.markdown("")
|
36 |
|
37 |
@staticmethod
|
38 |
+
def download_content(post_url):
|
|
|
|
|
|
|
39 |
with st.spinner("Downloading..."):
|
40 |
+
with Instascraper() as insta:
|
41 |
+
post = insta.post(post_url)
|
42 |
+
post.download(dest="/Users/user/Pictures/Instagram")
|
43 |
+
st.success("Downloaded the specified media")
|
|
|
44 |
|
45 |
@classmethod
|
46 |
def helper_message(cls):
|
47 |
st.write(
|
48 |
+
"> Check the specified destination folder for the downloaded media."
|
|
|
49 |
)
|
50 |
|
51 |
if __name__ == "__main__":
|