diff options
Diffstat (limited to 'youtube')
-rw-r--r-- | youtube/watch.py | 4 | ||||
-rw-r--r-- | youtube/yt_data_extract/watch_extraction.py | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/youtube/watch.py b/youtube/watch.py index 8ef9448..11ef9f2 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -226,9 +226,9 @@ def extract_info(video_id, use_invidious, playlist_id=None, index=None): return {'error': 'Failed to parse json response'} info = yt_data_extract.extract_watch_info(polymer_json) - # request player if it's missing + # request player urls if it's missing # see https://github.com/user234683/youtube-local/issues/22#issuecomment-706395160 - if info['age_restricted'] or info['player_response_missing']: + if info['age_restricted'] or info['player_urls_missing']: if info['age_restricted']: print('Age restricted video. Fetching get_video_info page') else: diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py index 5e57c15..12a3bf8 100644 --- a/youtube/yt_data_extract/watch_extraction.py +++ b/youtube/yt_data_extract/watch_extraction.py @@ -478,10 +478,6 @@ def extract_watch_info(polymer_json): else: embedded_player_response = {} - # see https://github.com/user234683/youtube-local/issues/22#issuecomment-706395160 - info['player_response_missing'] = not ( - player_response or embedded_player_response) - # captions info['automatic_caption_languages'] = [] info['manual_caption_languages'] = [] @@ -514,6 +510,10 @@ def extract_watch_info(polymer_json): if not info['formats']: _extract_formats(info, player_response) + # see https://github.com/user234683/youtube-local/issues/22#issuecomment-706395160 + info['player_urls_missing'] = ( + not info['formats'] and not embedded_player_response) + # playability errors _extract_playability_error(info, player_response) |