Make search() compatible with upload-bearing accounts

This commit is contained in:
sigma67 2020-03-09 15:16:54 +01:00
commit b3444c8700
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0

View file

@ -101,7 +101,12 @@ class YTMusic:
response = self.__send_request(endpoint, body)
try:
results = response['contents']['sectionListRenderer']['contents']
if 'tabbedSearchResultsRenderer' in response['contents']:
results = response['contents']['tabbedSearchResultsRenderer']['tabs'][0]['tabRenderer']['content']
else:
results = response['contents']
results = results['sectionListRenderer']['contents']
# no results
if len(results) == 1 and 'itemSectionRenderer' in results: