Spaces:
Building
Building
nits
Browse files- app.py +1 -1
- entrypoint.sh +12 -0
app.py
CHANGED
@@ -13,7 +13,7 @@ def download_audio(url):
|
|
13 |
try:
|
14 |
# Configure YouTube client
|
15 |
logger.info("Initializing YouTube object...")
|
16 |
-
yt = YouTube(url)
|
17 |
|
18 |
# Get best audio stream
|
19 |
audio_stream = yt.streams.filter(only_audio=True).order_by('abr').desc().first()
|
|
|
13 |
try:
|
14 |
# Configure YouTube client
|
15 |
logger.info("Initializing YouTube object...")
|
16 |
+
yt = YouTube(url, 'WEB')
|
17 |
|
18 |
# Get best audio stream
|
19 |
audio_stream = yt.streams.filter(only_audio=True).order_by('abr').desc().first()
|
entrypoint.sh
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
set -e
|
3 |
+
|
4 |
+
# Configure X11 to use TCP instead of UNIX sockets
|
5 |
+
export DISPLAY=:99
|
6 |
+
Xvfb $DISPLAY -screen 0 1920x1080x24 -ac +extension GLX +render -noreset -listen tcp &
|
7 |
+
|
8 |
+
# Human-like random delay
|
9 |
+
sleep $(( RANDOM % 3 + 1 ))
|
10 |
+
|
11 |
+
# Execute command with explicit Python path
|
12 |
+
exec "$@"
|