Closed jakesmorrison closed 10 months ago
I ran a python script to see what all the possible values of reason_end
Reason End
['trackdone', 'playbtn', 'endplay', 'fwdbtn', 'backbtn', 'unexpected-exit-while-paused', 'clickrow', None, 'logout', 'unknown', 'unexpected-exit']
It looks like there is a None (Null). I ended up fixing this issue by cleaning up those values with this snippet. After running the code I am able to import the data.
import json
with open('endsong.json') as f:
d = json.load(f)
for x in d:
if x['reason_end'] == None:
x['reason_end'] = 'endplay'
with open('endsong_clean.json', 'w') as f:
json.dump(d, f)
Thank you !
I've adapted your script a little bit to read all the json files in the current folder since I have multiple file exports and they don't event end with endSong... I also just replace the original file
import json
import os
json_files = [file for file in os.listdir() if file.endswith('.json')]
for filename in json_files:
with open(filename, 'r') as f:
d = json.load(f)
for x in d:
if x['reason_end'] is None:
x['reason_end'] = 'endplay'
with open(filename, 'w') as f:
json.dump(d, f)
Should be fixed with latest release 1.7.1.
Describe the bug
When importing extended streaming history data I get the following error:
I requested my streaming history 3 weeks ago and received it today. The json naming is not "endsong". It is "Streaming_History_Audio". I have manually changed it to endsong, but I am getting a format error. I am guessing the output format has changed?
Expected behavior
When I go from Settings -> Account -> Import Data, click "extended streaming history" and add my endsong.json I expect the data to be added to the your_spotify app. This process worked with 1 of my json files.
Additional context
Docker compose
Shared link
Let me figure out how to get a shared link. I will update with it.