foobuzz / statify Goto Github PK
View Code? Open in Web Editor NEWPull your playlist and listening data from the Spotify API
License: MIT License
Pull your playlist and listening data from the Spotify API
License: MIT License
please help!!! this is my favorite tool and it doesn't work anymore
$ statify pull
^C^CTraceback (most recent call last):
File "/home/pi/.local/bin/statify", line 10, in <module>
sys.exit(main())
File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 36, in main
code = _main(args)
File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 101, in _main
pull_playlists(spotify, database)
File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 172, in pull_playlists
spotify_tracks = list(spotify.playlist_tracks(playlist_obj.spotify_id))
File "/home/pi/.local/lib/python3.7/site-packages/statify/spotify_client.py", line 126, in playlist_tracks
page_size=100, # Max allowed
File "/home/pi/.local/lib/python3.7/site-packages/statify/spotify_client.py", line 81, in _paginate_spotipy_method
**kwargs,
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 634, in playlist_tracks
market, additional_types)
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 663, in playlist_items
additional_types=",".join(additional_types)
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 284, in _get
return self._internal_call("GET", url, payload, kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 241, in _internal_call
timeout=self.requests_timeout, **args
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 723, in urlopen
retries.sleep(response)
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 277, in sleep
slept = self.sleep_for_retry(response)
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 256, in sleep_for_retry
time.sleep(retry_after)
KeyboardInterrupt
hi @foobuzz
i kinda love you but ive got a lot of issues while running ✨ statify ✨
a cron is running every other hour but sometimes fails due to a classical timeout, so what about increasing it a bit?
i didnt bother looking into how to do that in spotipy but please do it as soon as possible thx
edit: ok actually i took a look and it seems pretty straigthforward spotipy-dev/spotipy#116 (comment) (but still too lazy to do the PR)
xoxo
Traceback (most recent call last):
File "/home/pi/.local/bin/statify", line 10, in <module>
sys.exit(main())
File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 36, in main
code = _main(args)
File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 100, in _main
pull_playlists(spotify, database)
File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 171, in pull_playlists
spotify_tracks = list(spotify.playlist_tracks(playlist_obj.spotify_id))
File "/home/pi/.local/lib/python3.7/site-packages/statify/spotify_client.py", line 125, in playlist_tracks
page_size=100, # Max allowed
File "/home/pi/.local/lib/python3.7/site-packages/statify/spotify_client.py", line 80, in _paginate_spotipy_method
**kwargs,
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 634, in playlist_tracks
market, additional_types)
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 663, in playlist_items
additional_types=",".join(additional_types)
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 284, in _get
return self._internal_call("GET", url, payload, kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/spotipy/client.py", line 241, in _internal_call
timeout=self.requests_timeout, **args
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.spotify.com', port=443): Read timed out. (read timeout=5)
hi @foobuzz i've a new error for you
Traceback (most recent call last):
File "/home/pi/.local/bin/statify", line 10, in <module>
sys.exit(main())
File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 36, in
code = _main(args)
File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 100, in
pull_playlists(spotify, database)
File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 171, in
spotify_tracks = list(spotify.playlist_tracks(playlist_obj.spotify_id))
File "/home/pi/.local/lib/python3.7/site-packages/statify/spotify_client.py", line
p_track['track'] = self.track_transformer(p_track['track'])
File "/home/pi/.local/lib/python3.7/site-packages/statify/statify.py", line 145, in
if resource['id'] is None and resource['is_local']:
TypeError: 'NoneType' object is not subscriptable
i added a print
somewhere and after dumping a lot of stuff, it happened:
{'added_at': '2021-05-06T22:15:57Z', 'added_by': {'external_urls': {'spotify': 'https://open.spotify.com/user/'}, 'href': 'https://api.spotify.com/v1/users/', 'id': '', 'type': 'user', 'uri': 'spotify:user:'}, 'is_local': False, 'primary_color': None, 'track': None, 'video_thumbnail': {'url': None}}
so after a huge amount of reverse engineering and using the web ui of github i'll make a pr in the next few minutes, stay tuned
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.