rckclmbr / pyportify

App to transfer your spotify playlists to Google Play Music
Apache License 2.0
779 stars 58 forks source link

No Playlists Showing #15

Closed albersonn closed 8 years ago

albersonn commented 9 years ago

I just tried to transfer some playlists but none is showing in step 3.

this is what terminal shows me:

[20/Feb/2015:17:59:29] ENGINE Bus STARTING
[20/Feb/2015:17:59:29] ENGINE Started monitor thread 'Autoreloader'.
[20/Feb/2015:17:59:29] ENGINE Started monitor thread '_TimeoutMonitor'.
[20/Feb/2015:17:59:29] ENGINE Serving on http://0.0.0.0:3132
[20/Feb/2015:17:59:29] ENGINE Bus STARTED
/usr/local/lib/python2.7/dist-packages/pyportify/static
2015-02-20 18:00:22 [6305] [ERROR] base.py:231:handle_uncaught_exception Internal Server Error: /spotify/playlists
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pyportify/views.py", line 132, in spotify_playlists
    playlist.load()
  File "/usr/local/lib/python2.7/dist-packages/spotify/playlist.py", line 117, in load
    return utils.load(self._session, self, timeout=timeout)
  File "/usr/local/lib/python2.7/dist-packages/spotify/utils.py", line 240, in load
    raise spotify.Timeout(timeout)
Timeout: Operation did not complete in 10.000s
rckclmbr commented 9 years ago

Do you by chance have a lot of playlists, or playlists with a lot of songs?

rckclmbr commented 9 years ago

If you could do one thing for me:

Open up /usr/local/lib/python2.7/dist-packages/pyportify/views.py and on line 132, change

playlist.load()

to

playlist.load(timeout=60)

Run that and let me know if that works for you

albersonn commented 9 years ago

Well, I have like LOTS of songs in LOTS of playlists. That time is in seconds? I guess I'll make it higher.

rckclmbr commented 9 years ago

Yep, in seconds. Make it higher, and let me know what you set it to, I'll make it a permanent thing

albersonn commented 9 years ago

Hehehe. Changed it to an hour (3600) and timed out. But this is my crazy long playlists. I'll set it to 10 hours and leave it overnight. Thank you though.

albersonn commented 9 years ago

No good. But since I had like 100 playlists and most of it was albuns saved as playlists, I deleted almost all of them and now it worked. Sorry since I cannot provide you a good number of seconds to put in the code.

albersonn commented 9 years ago

Just some error I had while transfering the music:

2015-02-21 15:40:47,520 - gmusicapi.Mobileclient1 (shared:281) [ERROR]: the response format for Search was not recognized.

Value {u'rating': u'5', u'albumArtRef': [{u'url': u'http://lh6.ggpht.com/3EZBc8bZy33G0B8fvNlZx_iLZgVV_75mLl-waUlgmRjOCPSVsEivI1vWlnM1Fqra_H_5F94DVA'}], u'lastRatingChangeTimestamp': u'1424453484137000', u'artistId': [u'Aeumsxlhnhsjmifx5vdp6ctxeam'], u'composer': u'', u'year': 2010, u'trackAvailableForSubscription': True, u'trackType': u'7', u'album': u'Brothers (Deluxe)', u'title': u'Tighten Up', u'albumArtist': u'The Black Keys', u'trackNumber': 3, u'discNumber': 1, u'albumAvailableForPurchase': True, u'contentType': u'2', u'trackAvailableForPurchase': True, u'storeId': u'T65isdtkhlhhcqgit6savye2vqi', u'nid': u'T65isdtkhlhhcqgit6savye2vqi', u'estimatedSize': u'8443847', u'albumId': u'Bv4dwjzxtmslm5namcvgsvm47fq', u'genre': u"'10s Rock", u'playCount': 1, u'kind': u'sj#track', u'artist': u'The Black Keys', u'durationMillis': u'211000'} for field '<obj>.entries[2].track' contains additional property 'lastRatingChangeTimestamp' not defined by 'properties' or 'patternProperties' and additionalProperties  is False

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:
{'url': 'https://www.googleapis.com/sj/v1.5/query', 'headers': {'Authorization': '<omitted>'}, 'params': {'q': u'The Black Keys - Tighten Up', 'max-results': 1}, 'method': 'GET'}

'{\n "kind": "sj#searchresponse",\n "entries": [\n  {\n   "type": "2",\n   "artist": {\n    "kind": "sj#artist",\n    "name": "The Black Keys",\n    "artistArtRef": "http://lh4.ggpht.com/JD-f7cmY6ycv-Kp2cWYNSXMjfJwTzmpGyE7i85Q9CgbUlJaZVoq0er-z1jvoqmjl6O3At2AlX9E",\n    "artistId": "Aeumsxlhnhsjmifx5vdp6ctxeam"\n   },\n   "score": 505.305908203125,\n   "best_result": true,\n   "navigational_result": true,\n   "navigational_confidence": 10.0\n  },\n  {\n   "type": "3",\n   "album": {\n    "kind": "sj#album",\n    "name": "The Big Come Up",\n    "albumArtist": "The Black Keys",\n    "albumArtRef": "http://lh5.ggpht.com/KqH9RLKOang--p4xAbTz7pF2NI62bkqlyqdxzJY_TSSUHHlO8lLfhvQKXMKgte7RxfclOzoh1g",\n    "albumId": "Btqkxzpqp23btfz45jetibszl4q",\n    "artist": "The Black Keys",\n    "artistId": [\n     "Aeumsxlhnhsjmifx5vdp6ctxeam"\n    ],\n    "year": 2002\n   },\n   "score": 184.4390869140625\n  },\n  {\n   "type": "1",\n   "track": {\n    "kind": "sj#track",\n    "title": "Tighten Up",\n    "artist": "The Black Keys",\n    "comp...'

A traceback follows:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gmusicapi/protocol/shared.py", line 248, in perform
    cls.validate(response, parsed_response)
  File "/usr/local/lib/python2.7/dist-packages/gmusicapi/protocol/mobileclient.py", line 214, in validate
    return validictory.validate(msg, cls._res_schema)
  File "/usr/local/lib/python2.7/dist-packages/validictory/__init__.py", line 36, in validate
    return v.validate(data, schema)
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 543, in validate
    self.__validate("data", {"data": data}, schema, '<obj>')
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 566, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 244, in validate_properties
    path + '.' + eachProp)
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 566, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 275, in validate_items
    '{}[{}]'.format(path, index))
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 566, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 244, in validate_properties
    path + '.' + eachProp)
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 566, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 353, in validate_additionalProperties
    " is False", value, fieldname, prop=eachProperty, path=path)
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 176, in _error
    raise err
ValidationException: Value {u'rating': u'5', u'albumArtRef': [{u'url': u'http://lh6.ggpht.com/3EZBc8bZy33G0B8fvNlZx_iLZgVV_75mLl-waUlgmRjOCPSVsEivI1vWlnM1Fqra_H_5F94DVA'}], u'lastRatingChangeTimestamp': u'1424453484137000', u'artistId': [u'Aeumsxlhnhsjmifx5vdp6ctxeam'], u'composer': u'', u'year': 2010, u'trackAvailableForSubscription': True, u'trackType': u'7', u'album': u'Brothers (Deluxe)', u'title': u'Tighten Up', u'albumArtist': u'The Black Keys', u'trackNumber': 3, u'discNumber': 1, u'albumAvailableForPurchase': True, u'contentType': u'2', u'trackAvailableForPurchase': True, u'storeId': u'T65isdtkhlhhcqgit6savye2vqi', u'nid': u'T65isdtkhlhhcqgit6savye2vqi', u'estimatedSize': u'8443847', u'albumId': u'Bv4dwjzxtmslm5namcvgsvm47fq', u'genre': u"'10s Rock", u'playCount': 1, u'kind': u'sj#track', u'artist': u'The Black Keys', u'durationMillis': u'211000'} for field '<obj>.entries[2].track' contains additional property 'lastRatingChangeTimestamp' not defined by 'properties' or 'patternProperties' and additionalProperties  is False
2015-02-21 15:40:47 [3402] [ERROR] shared.py:281:perform the response format for Search was not recognized.

Value {u'rating': u'5', u'albumArtRef': [{u'url': u'http://lh6.ggpht.com/3EZBc8bZy33G0B8fvNlZx_iLZgVV_75mLl-waUlgmRjOCPSVsEivI1vWlnM1Fqra_H_5F94DVA'}], u'lastRatingChangeTimestamp': u'1424453484137000', u'artistId': [u'Aeumsxlhnhsjmifx5vdp6ctxeam'], u'composer': u'', u'year': 2010, u'trackAvailableForSubscription': True, u'trackType': u'7', u'album': u'Brothers (Deluxe)', u'title': u'Tighten Up', u'albumArtist': u'The Black Keys', u'trackNumber': 3, u'discNumber': 1, u'albumAvailableForPurchase': True, u'contentType': u'2', u'trackAvailableForPurchase': True, u'storeId': u'T65isdtkhlhhcqgit6savye2vqi', u'nid': u'T65isdtkhlhhcqgit6savye2vqi', u'estimatedSize': u'8443847', u'albumId': u'Bv4dwjzxtmslm5namcvgsvm47fq', u'genre': u"'10s Rock", u'playCount': 1, u'kind': u'sj#track', u'artist': u'The Black Keys', u'durationMillis': u'211000'} for field '<obj>.entries[2].track' contains additional property 'lastRatingChangeTimestamp' not defined by 'properties' or 'patternProperties' and additionalProperties  is False

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:
{'url': 'https://www.googleapis.com/sj/v1.5/query', 'headers': {'Authorization': '<omitted>'}, 'params': {'q': u'The Black Keys - Tighten Up', 'max-results': 1}, 'method': 'GET'}

'{\n "kind": "sj#searchresponse",\n "entries": [\n  {\n   "type": "2",\n   "artist": {\n    "kind": "sj#artist",\n    "name": "The Black Keys",\n    "artistArtRef": "http://lh4.ggpht.com/JD-f7cmY6ycv-Kp2cWYNSXMjfJwTzmpGyE7i85Q9CgbUlJaZVoq0er-z1jvoqmjl6O3At2AlX9E",\n    "artistId": "Aeumsxlhnhsjmifx5vdp6ctxeam"\n   },\n   "score": 505.305908203125,\n   "best_result": true,\n   "navigational_result": true,\n   "navigational_confidence": 10.0\n  },\n  {\n   "type": "3",\n   "album": {\n    "kind": "sj#album",\n    "name": "The Big Come Up",\n    "albumArtist": "The Black Keys",\n    "albumArtRef": "http://lh5.ggpht.com/KqH9RLKOang--p4xAbTz7pF2NI62bkqlyqdxzJY_TSSUHHlO8lLfhvQKXMKgte7RxfclOzoh1g",\n    "albumId": "Btqkxzpqp23btfz45jetibszl4q",\n    "artist": "The Black Keys",\n    "artistId": [\n     "Aeumsxlhnhsjmifx5vdp6ctxeam"\n    ],\n    "year": 2002\n   },\n   "score": 184.4390869140625\n  },\n  {\n   "type": "1",\n   "track": {\n    "kind": "sj#track",\n    "title": "Tighten Up",\n    "artist": "The Black Keys",\n    "comp...'

A traceback follows:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gmusicapi/protocol/shared.py", line 248, in perform
    cls.validate(response, parsed_response)
  File "/usr/local/lib/python2.7/dist-packages/gmusicapi/protocol/mobileclient.py", line 214, in validate
    return validictory.validate(msg, cls._res_schema)
  File "/usr/local/lib/python2.7/dist-packages/validictory/__init__.py", line 36, in validate
    return v.validate(data, schema)
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 543, in validate
    self.__validate("data", {"data": data}, schema, '<obj>')
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 566, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 244, in validate_properties
    path + '.' + eachProp)
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 566, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 275, in validate_items
    '{}[{}]'.format(path, index))
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 566, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 244, in validate_properties
    path + '.' + eachProp)
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 566, in __validate
    validator(data, fieldname, schema, path, newschema.get(schemaprop))
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 353, in validate_additionalProperties
    " is False", value, fieldname, prop=eachProperty, path=path)
  File "/usr/local/lib/python2.7/dist-packages/validictory/validator.py", line 176, in _error
    raise err
ValidationException: Value {u'rating': u'5', u'albumArtRef': [{u'url': u'http://lh6.ggpht.com/3EZBc8bZy33G0B8fvNlZx_iLZgVV_75mLl-waUlgmRjOCPSVsEivI1vWlnM1Fqra_H_5F94DVA'}], u'lastRatingChangeTimestamp': u'1424453484137000', u'artistId': [u'Aeumsxlhnhsjmifx5vdp6ctxeam'], u'composer': u'', u'year': 2010, u'trackAvailableForSubscription': True, u'trackType': u'7', u'album': u'Brothers (Deluxe)', u'title': u'Tighten Up', u'albumArtist': u'The Black Keys', u'trackNumber': 3, u'discNumber': 1, u'albumAvailableForPurchase': True, u'contentType': u'2', u'trackAvailableForPurchase': True, u'storeId': u'T65isdtkhlhhcqgit6savye2vqi', u'nid': u'T65isdtkhlhhcqgit6savye2vqi', u'estimatedSize': u'8443847', u'albumId': u'Bv4dwjzxtmslm5namcvgsvm47fq', u'genre': u"'10s Rock", u'playCount': 1, u'kind': u'sj#track', u'artist': u'The Black Keys', u'durationMillis': u'211000'} for field '<obj>.entries[2].track' contains additional property 'lastRatingChangeTimestamp' not defined by 'properties' or 'patternProperties' and additionalProperties  is False
rckclmbr commented 9 years ago

@albersonn I neglected to specify a min version of gmusicapi, it looks like you might be using an older one.

Try sudo pip install --upgrade gmusicapi, it should fix the problem.

Also, bummer about the big playlists not transferring.

rckclmbr commented 9 years ago

I actually ran into this myself, reopening

joemccall86 commented 9 years ago

I'm seeing the same behavior, though I think it's caused by a different issue. Here's the relevant output from the log:

127.0.0.1 - - [2015-03-13 10:52:59] "POST /google/login HTTP/1.1" 200 161 0.249992
127.0.0.1 - - [2015-03-13 10:52:59] "GET /partials/spotify_login.html HTTP/1.1" 200 1490 0.002578
127.0.0.1 - - [2015-03-13 10:53:00] "GET /img/s.png HTTP/1.1" 200 3510 0.000972
127.0.0.1 - - [2015-03-13 10:53:07] "POST /spotify/login HTTP/1.1" 200 161 0.742188
127.0.0.1 - - [2015-03-13 10:53:07] "GET /partials/playlists.html HTTP/1.1" 200 1373 0.000917
127.0.0.1 - - [2015-03-13 10:53:17] "GET /spotify/playlists HTTP/1.1" 500 412 10.018496

Not sure why spotify is returning 500.

rckclmbr commented 9 years ago

@joemccall86 this looks the same as the timeouts (your http request took ~10 seconds, the same as the timeout). Try the change in https://github.com/rckclmbr/pyportify/issues/15#issuecomment-75304563

rckclmbr commented 8 years ago

Removed dependency on libspotify, thus the hard limit. This should be resolved.