prasanth.thangavel commited on
Commit
ee37f40
·
1 Parent(s): 34ceb7c

Change app.py to older approach, and update README

Browse files
README.md CHANGED
@@ -15,6 +15,8 @@ This application uses
15
  - [`yt_dlp`](https://github.com/yt-dlp/yt-dlp) - For downloading Audio/Video from YouTube and YoutTube Music.
16
  - HF [`gradio`](https://www.gradio.app/) - For UI.
17
 
 
 
18
  # Running locally
19
  ## Installation
20
  - First, install `python 3.11.5` (preferrably in a virtual environment).
@@ -30,10 +32,16 @@ or
30
  python app.py
31
  ```
32
 
 
 
 
33
  # Running in Hugging Face Spaces
34
  ## Cookies setup details
35
  > [!NOTE]
36
- > This setup is only needed if running in hugging face (HF) spaces or other deployments to avoid bot related errors. If running locally, the code will work right away.
 
 
 
37
 
38
  > [!CAUTION]
39
  > Using this approach in publicly deployed services is discouraged, as the YouTube algorithm may disable the entire YouTube account from which the cookies are downloaded after continued use.
@@ -47,7 +55,7 @@ python app.py
47
  - Uncomment the `# Convert cookie file to env and save locally` section and run the code
48
  - Remember to comment the code once the `.env` file is updated.
49
  3. **Set up or Update the Secrets in HF**
50
- - Copy the `.env` content (only the value, and not the key) and paste it inside the Secrets (Private) > `FIREFOX_COOKIES` in Hugging Face space.
51
  4. **Deploy the changes to HF space, and Voila!**
52
 
53
  ## `.env` file structure
 
15
  - [`yt_dlp`](https://github.com/yt-dlp/yt-dlp) - For downloading Audio/Video from YouTube and YoutTube Music.
16
  - HF [`gradio`](https://www.gradio.app/) - For UI.
17
 
18
+ ![Gradio UI screenshot - Sample 1](attachments/gradio-ui-screenshot-sample-1.png)
19
+
20
  # Running locally
21
  ## Installation
22
  - First, install `python 3.11.5` (preferrably in a virtual environment).
 
32
  python app.py
33
  ```
34
 
35
+ ## View in browser
36
+ Hit the browser at http://127.0.0.1:7860/
37
+
38
  # Running in Hugging Face Spaces
39
  ## Cookies setup details
40
  > [!NOTE]
41
+ > If running locally, the code will work right away. This setup is only needed if running in hugging face (HF) spaces or other deployments to avoid bot related errors as shown below.
42
+ ```
43
+ ERROR - Download error: AAq06bS8UZM: Sign in to confirm you’re not a bot. Use --cookies-from-browser or --cookies for the authentication. See https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp for how to manually pass cookies. Also see https://github.com/yt-dlp/yt-dlp/wiki/Extractors#exporting-youtube-cookies for tips on effectively exporting YouTube cookies
44
+ ```
45
 
46
  > [!CAUTION]
47
  > Using this approach in publicly deployed services is discouraged, as the YouTube algorithm may disable the entire YouTube account from which the cookies are downloaded after continued use.
 
55
  - Uncomment the `# Convert cookie file to env and save locally` section and run the code
56
  - Remember to comment the code once the `.env` file is updated.
57
  3. **Set up or Update the Secrets in HF**
58
+ - Copy the `.env` content (only the value, and not the key) and paste it inside the HF Secrets (Private) > `FIREFOX_COOKIES` in Hugging Face space.
59
  4. **Deploy the changes to HF space, and Voila!**
60
 
61
  ## `.env` file structure
app.py CHANGED
@@ -217,6 +217,10 @@ def create_browser_ui():
217
  with gr.Column(scale=1):
218
  status_text = gr.Textbox(label="Converting Status", interactive=False)
219
  output_file = gr.File(label="Download to your device ...")
 
 
 
 
220
 
221
  download_button.click(
222
  fn=download_for_browser,
 
217
  with gr.Column(scale=1):
218
  status_text = gr.Textbox(label="Converting Status", interactive=False)
219
  output_file = gr.File(label="Download to your device ...")
220
+ gr.Markdown("""### ⓘ Note:
221
+ The downloader currently works only when running locally.<br>
222
+ To run it in HF deployed space, cookies are required to access YouTube.<br>
223
+ For more details, visit [README](https://huggingface.co/spaces/prasanthntu/youtube-downloader/blob/main/README.md)""", label="Note", show_label=True, container=True)
224
 
225
  download_button.click(
226
  fn=download_for_browser,
attachments/gradio-ui-screenshot-sample-1.png ADDED