mirror of
https://github.com/AliAkhtari78/SpotifyScraper.git
synced 2026-04-25 19:45:49 +03:00
[GH-ISSUE #71] [BUG] #85
Labels
No labels
bug
bug
claude-assistant
claude-assistant
claude-assistant
dependencies
documentation
documentation
enhancement
in review list
infrastructure
infrastructure
infrastructure
pull-request
refactoring
release
stale
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SpotifyScraper#85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Dec-QXY on GitHub (Jun 12, 2025).
Original GitHub issue: https://github.com/AliAkhtari78/SpotifyScraper/issues/71
Describe the bug
2025-06-12 22:34:57 - spotify_scraper.client - INFO - Getting track info for https://open.spotify.com/track/0VqSdtXseb9khdZrnYVyM1
2025-06-12 22:34:57 - spotify_scraper.parsers.json_parser - ERROR - Failed to extract track data: argument of type 'NoneType' is not iterable
2025-06-12 22:34:57 - spotify_scraper.extractors.track - WARNING - Failed to extract track data from embed URL: argument of type 'NoneType' is not iterable
When I get the information he gets this error
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Actual behavior
What actually happened instead.
Error messages
Environment:
Additional context
Add any other context about the problem here.
Possible solution
If you have any ideas on how to fix this bug, please share them here.
@Dec-QXY commented on GitHub (Jun 12, 2025):
This is all you need to get started!
from spotify_scraper import SpotifyClient
client = SpotifyClient()
track = client.get_track_info("https://open.spotify.com/track/0VqSdtXseb9khdZrnYVyM1")
print(track)
print(f"Track: {track.get('name', 'Unknown')} by {(track.get('artists', [{}])[0].get('name', 'Unknown') if track.get('artists') else 'Unknown')}")
@AliAkhtari78 commented on GitHub (Jun 12, 2025):
Hi @Dec-QXY,
Thank you for reporting this issue! I've identified and fixed the problem. The error was caused by the JSON parser not properly handling None/null values in the track data, particularly when the
artistsfield was null.The Fix
I've released v2.1.5 which includes:
To Update
What Changed
The parser now properly handles tracks with null values for any metadata field (artists, album, etc.). Previously, when checking if a key existed in a null value (e.g.,
if "items" in track_data["artists"]wheretrack_data["artists"]was None), it would throw the "argument of type 'NoneType' is not iterable" error.Your track should now work correctly:
Please update to v2.1.5 and let me know if the issue is resolved!
Closes #71