cfangmeier / tuijam

A fancy TUI client for Google Play Music
MIT License
128 stars 9 forks source link

Required field '<obj>.entries[320].track.estimatedSize' is missing #50

Open rosshadden opened 4 years ago

rosshadden commented 4 years ago

I'm guessing the gmusic API changed because this used to work for me, so sorry in advance.

The error seems to be:

ERROR:gmusicapi.Mobileclient1:the response format for Search was not recognized.

Required field '<obj>.entries[320].track.estimatedSize' is missing

When I launch tuijam and search for an artist, it crashes with this in stdout:

starting up.
logging in.
enabling external control.
restoring queue
Something bad happened! :( see log file ($HOME/.config/tuijam/log.txt) for more information.
saving queue

Here is the log file output, which is much more useful:

ERROR:gmusicapi.Mobileclient1:the response format for Search was not recognized.

Required field '<obj>.entries[272].track.estimatedSize' is missing

First, try the develop branch. If you can recreate this error with the most recent code please [create an issue](http://goo.gl/qbAW8) that includes the above ValidationException and the following request/response:
{'method': 'GET', 'url': 'https://mclients.googleapis.com/sj/v2.5/query', 'params': {'ct': '1,2,3,4,6,7,8,9', 'q': 'bossfight', 'max-results': None, 'hl': 'en_US', 'dv': 0, 'tier': 'aa'}, 'headers': {'Authorization': '<omitted>'}}

'{"kind":"sj#searchresponse","entries":[{"type":"8","youtube_video":{"kind":"sj#video","id":"DAHQTWh3qcU","title":"Bossfight - Beat Down [Monstercat Release]","thumbnails":[{"url":"https://i.ytimg.com/vi/DAHQTWh3qcU/mqdefault.jpg","width":320,"height":180}]},"score":421.953125},{"type":"8","youtube_video":{"kind":"sj#video","id":"_5w8SJ3yVsc","title":"Bossfight - Milky Ways","thumbnails":[{"url":"https://i.ytimg.com/vi/_5w8SJ3yVsc/mqdefault.jpg","width":320,"height":180}]},"score":274.6331787109375},{"type":"8","youtube_video":{"kind":"sj#video","id":"JJ7hVHPFl4I","title":"Bossfight - Sovereign [Monstercat Release]","thumbnails":[{"url":"https://i.ytimg.com/vi/JJ7hVHPFl4I/mqdefault.jpg","width":320,"height":180}]},"score":17.634307861328125},{"type":"8","youtube_video":{"kind":"sj#video","id":"bV68_Vy0Uis","title":"Bossfight - Overdose (feat. Philip Strand) [Monstercat Release]","thumbnails":[{"url":"https://i.ytimg.com/vi/bV68_Vy0Uis/mqdefault.jpg","width":320,"height":180}]},"score":15.383153915405273},{"type":"8","youtube_video":{"kind":"sj#video","id":"ePv2X_CCaGg","title":"Bossfight - Nock Em","thumbnails":[{"url":"https://i.ytimg.com/vi/ePv2X_CCaGg/mqdefault.jpg","width":320,"height":180}]},"score":14.645415306091309},{"type":"8","youtube_video":{"kind":"sj#video","id":"UO8TQqheSBM","title":"Bossfight - Work [Monstercat Release]","thumbnails":[{"url":"https://i.ytimg.com/vi/UO8TQqheSBM/mqdefault.jpg","width":320,"height":180}]},"score":13.37255573272705},{"type":"8","youtube_video":{"kind":"sj#video","id":"RPf1oRvfiNQ","title":"Bossfight - Elevatia","thumbnails":[{"url":"https://i.ytimg.com/vi/RPf1oRvfiNQ/mqdefault.jpg","width":320,"height":180}]},"score":12.078020095825195},{"type":"8","youtube_video":{"kind":"sj#video","id":"54qwVeTgKng","title":"Bossfight - Work","thumbnails":[{"url":"https://i.ytimg.com/vi/54qwVeTgKng/mqdefault.jpg","width":320,"height":180}]},"score":9.385176658630371},{"type":"8","youtube_video":{"kind":"sj#video","id":"kwYpgmm1S2c","title":"Bossfight - Mescalink","thumbnails":[{"url":"https://i.ytimg.com/vi/kwYpgmm1S2c/mqdefault.jpg","width":320,"height":180}]},"score":8.75277328491211},{"type":"8","youtube_video":{"kind":"sj#video","id":"a_xUX7L9brE","title":"Bossfight - U Got Me [Monstercat Release]","thumbnails":[{"url":"https://i.ytimg.com/vi/a_xUX7L9brE/mqdefault.jpg","width":320,"height":180}]},"score":8.671975135803223},{"type":"8","youtube_video":{"kind":"sj#video","id":"F0PUVKfxkTM","title":"Bossfight - Nock Em","thumbnails":[{"url":"https://i.ytimg.com/vi/F0PUVKfxkTM/mqdefault.jpg","width":320,"height":180}]},"score":8.592018127441406},{"type":"8","youtube_video":{"kind":"sj#video","id":"sb_sRPQKS58","title":"Bossfight - No Sleep [Monstercat EP Release]","thumbnails":[{"url":"https://i.ytimg.com/vi/sb_sRPQKS58/mqdefault.jpg","width":320,"height":180}]},"score":7.663994789123535},{"type":"8","youtube_video":{"kind":"sj#video","id":"F0w08-xNV6k","title":"Bossfight - Dr. Finkelfracken\'s Cure","thumbnails":[{"url":"https://i.ytimg.com/vi/F0w08-xNV6k/mqdefault.jpg","width":320,"height":180}]},"score":7.503556728363037},{"type":"8","youtube_video":{"kind":"sj#video","id":"36hgL7bPDnk","title":"Bossfight - Badmash [Monstercat Release]","thumbnails":[{"url":"https://i.ytimg.com/vi/36hgL7bPDnk/mqdefault.jpg","width":320,"height":180}]},"score":7.435165882110596},{"type":"8","youtube_video":{"kind":"sj#video","id":"YknGGi--LPA","title":"Bossfight - Nowise","thumbnails":[{"url":"https://i.ytimg.com/vi/YknGGi--LPA/mqdefault.jpg","width":320,"height":180}]},"score":7.248588562011719},{"type":"8","youtube_video":{"kind":"sj#video","id":"PD_LKAFBsxk","title":"Bossfight - Helmut Haunter","thumbnails":[{"url":"https://i.ytimg.com/vi/PD_LKAFBsxk/mqdefault.jpg","width":320,"height":180}]},"score":7.141583442687988},{"type":"8","youtube_video":{"kind":"sj#video","id":"k2lAoxL7Frc","title":"Panda Eyes - Isolated [Bossfight Remix]","thumbnails":[{"url":"https://i.ytimg.com/vi/k2lAoxL7Frc/mqdefault.jpg","width":320,"height":180}]},"score":6.838003635406494},{"type":"8","youtube_video":{"kind":"sj#video","id":"-WZTlJXS-Gk","title":"Bossfight - Partyt Är Igång!","thumbnails":[{"url":"https://i.ytimg.com/vi/-WZTlJXS-Gk/mqdefault.jpg","width":320,"height":180}]},"score":6.529654026031494},{"type":"8","youtube_video":{"kind":"sj#video","id":"0U1qfCfRzF0","title":"Ephixa & Bossfight - Subside","thumbnails":[{"url":"https://i.ytimg.com/vi/0U1qfCfRzF0/mqdefault.jpg","width":320,"height":180}]},"score":6.3968186378479},{"type":"8","youtube_video":{"kind":"sj#video","id":"9wZreFTqSvc","title":"Dex Arson - Bipolar [Bossfight Remix]","thumbnails":[{"url":"https://i.ytimg.com/vi/9wZreFTqSvc/mqdefault.jpg","width":320,"height":180}]},"score":6.014991760253906},{"type":"1","track":{"kind":"sj#track","title":"Boss Fight","artist":"Serj Tankian","composer":"Serj Tankian","album":"Midnight Star (Original Game Soundtrack)","albumArtist":"Serj Tankian","year":2019,"trackNumber":16,"genre":"Soundtracks","durationMillis":"44000","albumArtRef":[{"kind":"sj#imageRef","url":"http://lh3.googleusercontent.com/pPM0CK0V00rDayve8NbaUFrKfvLwCal3IybKOEGT6AxmVxPTVXM8t2yz9dakLV6tzWTuQQ8rhpw","aspectRatio":"1","autogen":false}],"discNumber":1,"estimatedSize":"1781588","trackType":"7","storeId":"Tvpz54wejrdys2rx356ivf4i3qe","albumId":"yoaetdgp4cfhbkbbwiletxq2ae","artistId":["jsbe4fpgbl24bnsu3lhxu7orea"],"nid":"vpz54wejrdys2rx356ivf4i3qe","trackAvailableForSubscription":true,"trackAvailableForPurchase":true,"albumAvailableForPurchase":true,"explicitType":"2"}},{"type":"1","track":{"kind":"sj#track","title":"Boss Fight","artist":"Benjamin Wallfisch","composer":"","album":"Gamba (Original Motion Picture Soundtrack)","albumArtist":"Benjamin Wallfisch","year":2015,"trackNumber":3,"genre":"Soundtracks","durationMillis":"121000","albumArtRef":[{"kind":"sj#imageRef","url":"http://lh3.googleusercontent.com/1d5e_syKr-ggORtvctA8eTeNgq2vj76UiLAbxAP0O2gUTwo2bK8oAPxq2BefWFW-RQmuoKa7-0g","aspectRatio":"1","autogen":false}],"discNumber":1,"estimatedSize":"4859857","trackType":"7","storeId":"Tzocoed337cj63jznbbojvwy5ce","albumId":"mj4n5h2xt2vwkjzigtxb2z3bdy","artistId":["pqe76vwng2lmlgz4ay3yrs73au","57ksblx3gzeihxrarnodqtrzbu","4iaj36sgmxn2legoazbm7znepa"],"nid":"zocoed337cj63jznbbojvwy5ce","trackAvailableForSubscription":true,"trackAvailableForPurchase":true,"albumAvailableForPurchase":true,"explicitType":"2"}},{"type":"1","track":{"kind":"sj#track","title":"Boss Fight","artist":"Benjamin Wallfisch","composer":"","album":"Gamba (Original Motion Picture Soundtrack)","albumArtist":"Benjamin Wallfisch","year":2015,"trackNumber":3,"genre":"Soundtracks","durationMillis":"121000","albumArtRef":[{"kind":"sj#imageRef","url":"http://lh3.googleusercontent.com/8UJcCxRwUjL3SP6jF15N9i-ihH3rcphornoHalvsr2_vWwBiuhoLPE5qddaLdAQsrAIUGGtv","aspectRatio":"1","autogen":false}],"discNumber":1,"estimatedSize":"4859857","trackType":"7","storeId":"Thcmay2g6ilalraqqmk3mrnnwke","albumId":"s6q2hfxkz6p2w4hzqc2tlvboqm","artistId":["pqe76vwng2lmlgz4ay3yrs73au","57ksblx3gzeihxrarnodqtrzbu","4iaj36sgmxn2legoazbm7znepa"],"nid":"hcmay2g6ilalraqqmk3mrnnwke","trackAvailableForSubscription":true,"trackAvailableForPurchase":true,"albumAvailableForPurchase":true,"explicitType":"2"}},{"type":"1","track":{"kind":"sj#track","title":"Badmash","artist":"Bossfight","composer":"","album":"Monstercat Uncaged Vol. 6","albumArtist":"Monstercat","year":2019,"trackNumber":34,"genre":"Dance/Electronic","durationMillis":"186000","albumArtRef":[{"kind":"sj#imageRef","url":"http://lh3.googleusercontent.com/py50Lr5flRCGNFgqduKYHGMkYa25ESEZY353QZRV5gCGWKrWtiTDqyKIdMT59Mfqwd57xYFwq20","aspectRatio":"1","autogen":false}],"discNumber":1,"estimatedSize":"7445980","trackType":"7","storeId":"T3dryggi7tosrmjwof34v2yeqeq","albumId":"6horl3ekr4kly4ra3dhawsnsxm","artistId":["p6i4fcgw3c6ihjau2k2t6lillq"],"nid":"3dryggi7tosrmjwof34v2yeqeq","trackAvailableForSubscription":true,"trackAvailableForPurchase":true,"albumAvailableForPurchase":true,"explicitType":"2"}},{"type":"1","track":{"kind":"sj#track","title":"Charge","artist":"Bossfight","composer":"","album":"Rocket League x Monstercat Vol. 4","albumArtist":"Various Artists","year":2018,"trackNumber":5,"genre":"Dance/Electronic","durationMillis":"203000","albumArtRef":[{"kind":"sj#imageRef","url":"http://lh3.googleusercontent.com/rbs5yibJ7ZB_8665IwZxgAclLDKGrniGJecDiVSrAaEO-6S7W3uIxXpSkFIjfcjSnkXf3i4q","aspectRatio":"1","autogen":false}],"discNumber":1,"estimatedSize":"8131433","trackType":"7","storeId":"Tupx6ds63uh5lcigyjylphfihpq","albumId":"wdhpkgmakaekzjgmksffqzlh4m","artistId":["p6i4fcgw3c6ihjau2k2t6lillq"],"nid":"upx6ds63uh5lcigyjylphfihpq","trackAvailableForSubscription":true,"trackAvailableForPurchase":true,"albumAvailableForPurchase":true,"explicitType":"2"}},{"type":"1","track":{"kind":"sj#track","title":"Charge","artist":"Bossfight","composer":"","album":"Charge","albumArtist":"Bossfight","year":2018,"trackNumber":1,"genre":"Dance/Electronic","durationMillis":"203000","albumArtRef":[{"kind":"sj#imageRef","url":"http://lh3.googleusercontent.com/ka1OcH_igIPHbGnn0U6mpqiGokn6ON9XT1Fd2RuegfNXezGu9d6w0j_rf-p3QzOEkiwckj6D4CI","aspectRatio":"1","autogen":false}],"discNumber":1,"estimatedSize":"8131433","trackType":"7","storeId":"T6ydpx2xc2azxkehgde6a2f43xu","albumId":"ydplukqsctjs54m7724hwcjuqa","artistId":["p6i4fcgw3c6ihjau2k2t6lillq"],"nid":"6ydpx2xc2azxkehgde6a2f43xu","trackAvailableForSubscription":true,"trackAvailableForPurchase":true,"albumAvailableForPurchase":true,"explicitType":"2"}},{"type":"1","track":{"kind":"sj#track","title":"Beat Down","artist":"Bossfight","composer":"","album":"Beat Down","albumArtist":"Bossfight","year":2019,"trackNumber":1,"genre":"Dance/Electronic","durationMillis":"258000","albumArtRef":[{"kind":"sj#imageRef","url":"http://lh3.googleusercontent.com/_FNVyH-7_1sQKJTqzkls7CCZDgPTPnxqN0IG2wQ6zqJy5wMdjSXsYYqTM4xB0hxCosAbK0emHBE","aspectRatio":"1","autogen":false}],"discNumber":1,"estimatedSize":"10337212","trackType":"7","store...'

A traceback follows:
Traceback (most recent call last):
  File "/home/ross/.local/lib/python3.7/site-packages/gmusicapi-11.0.0-py3.7.egg/gmusicapi/protocol/mobileclient.py", line 640, in validate
    return validictory.validate(msg, cls._res_schema)
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/__init__.py", line 43, in validate
    return v.validate(data, schema)
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 618, in validate
    self.__validate("data", {"data": data}, schema, '<obj>')
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 660, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 293, in validate_properties
    path + '.' + property)
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 660, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 327, in validate_items
    '{0}[{1}]'.format(path, index))
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 660, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 293, in validate_properties
    path + '.' + property)
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 660, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 293, in validate_properties
    path + '.' + property)
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 660, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 337, in validate_required
    exctype=RequiredFieldValidationError)
  File "/home/ross/.local/lib/python3.7/site-packages/validictory-1.1.2-py3.7.egg/validictory/validator.py", line 206, in _error
    raise err
validictory.validator.RequiredFieldValidationError: Required field '<obj>.entries[272].track.estimatedSize' is missing

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ross/.local/lib/python3.7/site-packages/gmusicapi-11.0.0-py3.7.egg/gmusicapi/protocol/shared.py", line 249, in perform
    cls.validate(response, parsed_response)
  File "/home/ross/.local/lib/python3.7/site-packages/gmusicapi-11.0.0-py3.7.egg/gmusicapi/protocol/mobileclient.py", line 642, in validate
    raise_from(ValidationException(str(e)), e)
  File "<string>", line 3, in raise_from
gmusicapi.exceptions.ValidationException: Required field '<obj>.entries[272].track.estimatedSize' is missing
WARNING:googleapiclient.discovery_cache:file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth
Traceback (most recent call last):
  File "/home/ross/.local/lib/python3.7/site-packages/google_api_python_client-1.7.4-py3.7.egg/googleapiclient/discovery_cache/__init__.py", line 36, in autodetect
    from google.appengine.api import memcache
ModuleNotFoundError: No module named 'google.appengine'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ross/.local/lib/python3.7/site-packages/google_api_python_client-1.7.4-py3.7.egg/googleapiclient/discovery_cache/file_cache.py", line 33, in <module>
    from oauth2client.contrib.locked_file import LockedFile
ModuleNotFoundError: No module named 'oauth2client.contrib.locked_file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ross/.local/lib/python3.7/site-packages/google_api_python_client-1.7.4-py3.7.egg/googleapiclient/discovery_cache/file_cache.py", line 37, in <module>
    from oauth2client.locked_file import LockedFile
ModuleNotFoundError: No module named 'oauth2client.locked_file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ross/.local/lib/python3.7/site-packages/google_api_python_client-1.7.4-py3.7.egg/googleapiclient/discovery_cache/__init__.py", line 41, in autodetect
    from . import file_cache
  File "/home/ross/.local/lib/python3.7/site-packages/google_api_python_client-1.7.4-py3.7.egg/googleapiclient/discovery_cache/file_cache.py", line 41, in <module>
    'file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth')
ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth
ERROR:root:<HttpError 400 when requesting https://www.googleapis.com/youtube/v3/search?q=bossfight&type=video&order=relevance&part=id%2Csnippet&maxResults=50&key=AIzaSyBtETg1PDC124WUAZ5JhJH_pu2xboHVIS0&alt=json returned "Bad Request">
Traceback (most recent call last):
  File "/home/ross/.local/lib/python3.7/site-packages/tuijam-0.3.4-py3.7.egg/EGG-INFO/scripts/tuijam", line 1329, in main
  File "/usr/lib/python3.7/site-packages/urwid/main_loop.py", line 286, in run
    self._run()
  File "/usr/lib/python3.7/site-packages/urwid/main_loop.py", line 384, in _run
    self.event_loop.run()
  File "/usr/lib/python3.7/site-packages/urwid/main_loop.py", line 1005, in run
    reraise(*exc_info)
  File "/usr/lib/python3.7/site-packages/urwid/compat.py", line 58, in reraise
    raise value
  File "/usr/lib/python3.7/site-packages/urwid/main_loop.py", line 1018, in wrapper
    return f(*args,**kargs)
  File "/usr/lib/python3.7/site-packages/urwid/main_loop.py", line 938, in io_callback
    callback()
  File "/usr/lib/python3.7/site-packages/urwid/raw_display.py", line 404, in <lambda>
    event_loop, callback, self.get_available_raw_input())
  File "/usr/lib/python3.7/site-packages/urwid/raw_display.py", line 502, in parse_input
    callback(processed, processed_codes)
  File "/usr/lib/python3.7/site-packages/urwid/main_loop.py", line 411, in _update
    self.process_input(keys)
  File "/usr/lib/python3.7/site-packages/urwid/main_loop.py", line 511, in process_input
    k = self._topmost_widget.keypress(self.screen_size, k)
  File "/home/ross/.local/lib/python3.7/site-packages/tuijam-0.3.4-py3.7.egg/EGG-INFO/scripts/tuijam", line 902, in keypress
  File "/home/ross/.local/lib/python3.7/site-packages/tuijam-0.3.4-py3.7.egg/EGG-INFO/scripts/tuijam", line 358, in keypress
  File "/home/ross/.local/lib/python3.7/site-packages/tuijam-0.3.4-py3.7.egg/EGG-INFO/scripts/tuijam", line 985, in search
  File "/home/ross/.local/lib/python3.7/site-packages/tuijam-0.3.4-py3.7.egg/EGG-INFO/scripts/tuijam", line 969, in youtube_search
  File "/home/ross/.local/lib/python3.7/site-packages/google_api_python_client-1.7.4-py3.7.egg/googleapiclient/_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/ross/.local/lib/python3.7/site-packages/google_api_python_client-1.7.4-py3.7.egg/googleapiclient/http.py", line 842, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://www.googleapis.com/youtube/v3/search?q=bossfight&type=video&order=relevance&part=id%2Csnippet&maxResults=50&key=AIzaSyBtETg1PDC124WUAZ5JhJH_pu2xboHVIS0&alt=json returned "Bad Request">
cfangmeier commented 4 years ago

Just to clarify: by "search for an artist", you mean you type the name of an artist into the search box and press enter, as opposed to "expanding" on an artist from a previous search result. Does this happen for any artist or just a specific one? If specific, which one?

rosshadden commented 4 years ago

Yes it's when I type an artist into the search box and press enter. And it seems to be any artist.

cfangmeier commented 4 years ago

I haven't been able to reproduce this error on my system. Can you share the output of

pip freeze

so I can compare which versions of packages you have?

What OS are you using, and how did you install tuijam?