Geek7 commited on
Commit
0cfdbdb
·
1 Parent(s): 90d1a25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -13
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import streamlit as st
2
- from instascraper import Post
3
 
4
  hide_streamlit_style = """
5
  <style>
@@ -29,28 +29,23 @@ class InstagramDownloader:
29
 
30
  if start_button:
31
  if post_url:
32
- InstagramDownloader.download_video(post_url)
33
  InstagramDownloader.helper_message()
34
 
35
  st.markdown("")
36
 
37
  @staticmethod
38
- def download_video(post_url):
39
- post = Post(post_url)
40
- video_url = post.video_url
41
-
42
  with st.spinner("Downloading..."):
43
- # Perform your download logic here using the video_url
44
- # For example, you can use requests library to download the video content
45
- # Ensure you handle the download process appropriately
46
- # Here's a placeholder for demonstration purposes:
47
- st.success("Downloaded")
48
 
49
  @classmethod
50
  def helper_message(cls):
51
  st.write(
52
- "> To save to the local computer, "
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__":