[fix] youtube_noapi engine

This commit is contained in:
Alexandre Flament 2020-12-07 17:44:31 +01:00
parent cdceec1cbb
commit 34df0f7910

View file

@ -49,7 +49,7 @@ def response(resp):
results = [] results = []
results_data = resp.text[resp.text.find('ytInitialData'):] results_data = resp.text[resp.text.find('ytInitialData'):]
results_data = results_data[results_data.find('{'):results_data.find(';\n')] results_data = results_data[results_data.find('{'):results_data.find(';</script>')]
results_json = loads(results_data) if results_data else {} results_json = loads(results_data) if results_data else {}
sections = results_json.get('contents', {})\ sections = results_json.get('contents', {})\