danilotpnta commited on
Commit
f80a7eb
·
1 Parent(s): afbb88c

update dependency

Browse files
Files changed (2) hide show
  1. app.py +10 -1
  2. environment.yml +3 -2
app.py CHANGED
@@ -3,9 +3,18 @@ import gradio as gr
3
  import os
4
  import asyncio
5
 
6
- # Import the async download function from your download script
 
 
 
 
 
 
 
 
7
  from download_video import download_mp3_playwright
8
 
 
9
  # Function to download the audio, title, and thumbnail from YouTube
10
  async def download_video_info(url):
11
  try:
 
3
  import os
4
  import asyncio
5
 
6
+ import subprocess
7
+
8
+ # Ensure Playwright is installed and browsers are downloaded
9
+ try:
10
+ subprocess.run(["pip", "install", "playwright"], check=True)
11
+ subprocess.run(["playwright", "install"], check=True)
12
+ except subprocess.CalledProcessError as e:
13
+ print(f"Error during Playwright setup: {e}")
14
+
15
  from download_video import download_mp3_playwright
16
 
17
+
18
  # Function to download the audio, title, and thumbnail from YouTube
19
  async def download_video_info(url):
20
  try:
environment.yml CHANGED
@@ -11,7 +11,8 @@ dependencies:
11
  - pytube==15.0.0
12
  - git+https://github.com/openai/whisper.git
13
  - torch==2.0.1
14
- - pydantic==1.10 # Use Pydantic v1 to avoid incompatibility issues
 
15
  - BeautifulSoup4
16
- - playwright # Required for Playwright-based scraping and downloads
17
  - requests # Used for handling HTTP requests during downloads
 
11
  - pytube==15.0.0
12
  - git+https://github.com/openai/whisper.git
13
  - torch==2.0.1
14
+ # - yt-dlp
15
+ - pydantic==1.10 # Use Pydantic v1 to avoid the incompatibility
16
  - BeautifulSoup4
17
+ - git+https://github.com/microsoft/playwright-python.git
18
  - requests # Used for handling HTTP requests during downloads