Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ from typing import Tuple
|
|
| 12 |
import time
|
| 13 |
import requests
|
| 14 |
import os
|
| 15 |
-
from urllib.parse import
|
| 16 |
|
| 17 |
logging.getLogger('numba').setLevel(logging.WARNING)
|
| 18 |
|
|
@@ -77,7 +77,7 @@ def download_audio(url):
|
|
| 77 |
|
| 78 |
def downloadTubeUpload(query):
|
| 79 |
# Step 1: Search for videos with the given query
|
| 80 |
-
search_url = f"https://draw-8fj.begin.app/api/search/{
|
| 81 |
search_response = requests.get(search_url).json()
|
| 82 |
print('1=>', search_response)
|
| 83 |
# Step 2: Find the first video with duration less than 10 minutes and extract its ID
|
|
|
|
| 12 |
import time
|
| 13 |
import requests
|
| 14 |
import os
|
| 15 |
+
from urllib.parse import quote
|
| 16 |
|
| 17 |
logging.getLogger('numba').setLevel(logging.WARNING)
|
| 18 |
|
|
|
|
| 77 |
|
| 78 |
def downloadTubeUpload(query):
|
| 79 |
# Step 1: Search for videos with the given query
|
| 80 |
+
search_url = f"https://draw-8fj.begin.app/api/search/{quote(query)}"
|
| 81 |
search_response = requests.get(search_url).json()
|
| 82 |
print('1=>', search_response)
|
| 83 |
# Step 2: Find the first video with duration less than 10 minutes and extract its ID
|