Download app.py from Geek7/dl1: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/spaces/Geek7/dl1/resolve/main/app.py
- Command line
-
hf download hf://spaces/Geek7/dl1/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Geek7/dl1/resolve/main/app.py
1.3 kB
| import streamlit as st | |
| from insta_reels import InstaReels | |
| hide_streamlit_style = """ | |
| <style> | |
| #MainMenu {visibility: hidden;} | |
| footer {visibility: hidden;} | |
| .stApp{ | |
| background-image: linear-gradient(115deg,#FFAF00,#FFC500,#FFD600,#FCED00,#F9F380,#F6F7CD); | |
| animation: rotate 7s linear infinite; | |
| } | |
| @keyframes rotate { | |
| 100%{ | |
| filter: hue-rotate(-360deg) | |
| } | |
| } | |
| </style> | |
| """ | |
| st.markdown(hide_streamlit_style, unsafe_allow_html=True) | |
| class InstagramDownloader: | |
| def run(): | |
| st.header("") | |
| post_url = st.text_input("Enter Instagram post URL") | |
| start_button = st.button("Start") | |
| if start_button: | |
| if post_url: | |
| InstagramDownloader.download_content(post_url) | |
| InstagramDownloader.helper_message() | |
| st.markdown("") | |
| def download_content(post_url): | |
| with st.spinner("Downloading..."): | |
| insta_reels = InstaReels(post_url) | |
| insta_reels.download("/Users/user/Pictures/Instagram") | |
| st.success("Downloaded the specified media") | |
| def helper_message(cls): | |
| st.write( | |
| "> Check the specified destination folder for the downloaded media." | |
| ) | |
| if __name__ == "__main__": | |
| InstagramDownloader.run() |