diff options
Diffstat (limited to 'youtube/watch.py')
| -rw-r--r-- | youtube/watch.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/youtube/watch.py b/youtube/watch.py index 2fbc1fc..360fbc9 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -431,14 +431,20 @@ def extract_info(video_id, use_invidious, playlist_id=None, index=None): # Fallback to 'ios' if no valid URLs are found if not info.get('formats') or info.get('player_urls_missing'): print(f"No URLs found in '{primary_client}', attempting with '{fallback_client}'.") - player_response = fetch_player_response(fallback_client, video_id) or {} - yt_data_extract.update_with_new_urls(info, player_response) + try: + player_response = fetch_player_response(fallback_client, video_id) or {} + yt_data_extract.update_with_new_urls(info, player_response) + except util.FetchError as e: + print(f"Fallback '{fallback_client}' failed: {e}") # Final attempt with 'tv_embedded' if there are still no URLs if not info.get('formats') or info.get('player_urls_missing'): print(f"No URLs found in '{fallback_client}', attempting with '{last_resort_client}'") - player_response = fetch_player_response(last_resort_client, video_id) or {} - yt_data_extract.update_with_new_urls(info, player_response) + try: + player_response = fetch_player_response(last_resort_client, video_id) or {} + yt_data_extract.update_with_new_urls(info, player_response) + except util.FetchError as e: + print(f"Fallback '{last_resort_client}' failed: {e}") # signature decryption if info.get('formats'): |
