This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spotipy | |
from spotipy.oauth2 import SpotifyClientCredentials, SpotifyOAuth | |
APP_CLIENT_ID = "" | |
APP_CLIENT_SECRET = "" | |
SPOTIPY_REDIRECT_URI = "http://localhost:8000/" | |
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id=APP_CLIENT_ID, client_secret=APP_CLIENT_SECRET, | |
redirect_uri=SPOTIPY_REDIRECT_URI, scope="user-library-read")) | |
results = sp.current_user_saved_tracks() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
def main(): | |
medi = re.compile(".*medicamentos*", re.I) | |
osaki = re.compile(".*osaki*", re.I) | |
cont = 0 | |
for (root, dirs, files) in os.walk('.'): | |
if not ('general' in root.lower() or '.' == root): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from collections import defaultdict | |
""" | |
This script reads the streaming history data from the file 'streaming_history_combined.json' and processes it to find | |
the top 10 artists and tracks by count and by time, as well as the total listening time. The data is filtered to only | |
include tracks listened to in the year 2024 between January 1st and November 15th. This has be done to compare | |
the results with the data from the Spotify Wrapped 2024. After some tests and playing with the parameters, we can see | |
that the data from the Spotify Wrapped 2024 is not the same as the data from the streaming history. This can be due to | |
a variety of reasons: The criteria for counting or excluding playing time, the criteria for counting or excluding song |