Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,8 +17,11 @@ logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %
|
|
| 17 |
# Function to search YouTube videos using yt-dlp for better reliability
|
| 18 |
def youtube_search(query, max_results=50):
|
| 19 |
ydl_opts = {
|
| 20 |
-
'quiet':
|
| 21 |
'extract_flat': 'in_playlist',
|
|
|
|
|
|
|
|
|
|
| 22 |
}
|
| 23 |
search_url = f"ytsearch{max_results}:{query}"
|
| 24 |
|
|
|
|
| 17 |
# Function to search YouTube videos using yt-dlp for better reliability
|
| 18 |
def youtube_search(query, max_results=50):
|
| 19 |
ydl_opts = {
|
| 20 |
+
'quiet': False, # Set to False to get more detailed output from yt-dlp
|
| 21 |
'extract_flat': 'in_playlist',
|
| 22 |
+
'logger': logging.getLogger(), # Use the logging module to capture yt-dlp logs
|
| 23 |
+
'simulate': True,
|
| 24 |
+
'noplaylist': True, # To avoid playlist entries
|
| 25 |
}
|
| 26 |
search_url = f"ytsearch{max_results}:{query}"
|
| 27 |
|