Spaces:
Sleeping
Sleeping
fredcaixeta commited on
Commit ·
a492299
1
Parent(s): e0a1392
url
Browse files
app.py
CHANGED
|
@@ -89,6 +89,12 @@ def download_audio_from_url(url: str, output_path: str = "temp_audio"):
|
|
| 89 |
"""Baixa áudio com retry, proxy e DNS fallback."""
|
| 90 |
if not os.path.exists(output_path):
|
| 91 |
os.makedirs(output_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
# Configurações com fallback DNS/proxy
|
| 94 |
proxies = {
|
|
|
|
| 89 |
"""Baixa áudio com retry, proxy e DNS fallback."""
|
| 90 |
if not os.path.exists(output_path):
|
| 91 |
os.makedirs(output_path)
|
| 92 |
+
|
| 93 |
+
if url:
|
| 94 |
+
if "youtube.com" in url or "youtu.be" in url:
|
| 95 |
+
url = url.replace('youtube.com', 'piped.video')
|
| 96 |
+
url = url.replace('youtu.be', 'piped.video')
|
| 97 |
+
|
| 98 |
|
| 99 |
# Configurações com fallback DNS/proxy
|
| 100 |
proxies = {
|