Use new channel api endpoint now that browse_ajax is disabled

Fixes channel pages > 1

Signed-off-by: Jesús <heckyel@hyperbola.info>
This commit is contained in:
James Taylor
2021-03-02 18:54:22 -08:00
committed by Jesús
parent c45f60d3f5
commit 2df4238924
2 changed files with 26 additions and 4 deletions

View File

@@ -339,6 +339,11 @@ def extract_item_info(item, additional_info={}):
def extract_response(polymer_json):
'''return response, error'''
# /youtubei/v1/browse endpoint returns response directly
if isinstance(polymer_json, dict) and 'responseContext' in polymer_json:
# this is the response
return polymer_json, None
response = multi_deep_get(polymer_json, [1, 'response'], ['response'])
if response is None:
return None, 'Failed to extract response'