Last active
June 6, 2022 14:13
-
-
Save MiranDaniel/a35ff62701bf3e231f50ceae132d8332 to your computer and use it in GitHub Desktop.
Get Spotify total play time
This file contains hidden or 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 | |
count = 10 # change this to the total count of endsong files | |
files = [f"endsong_{i}.json" for i in range(count+1)] | |
mstotal = 0 | |
total = 0 | |
for i in files: | |
data = json.load(open(i)) | |
for j in data: | |
mstotal += j["ms_played"] | |
total += 1 | |
print(f"{mstotal=}") | |
print(f"{total=}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment