Open mkanet opened 4 years ago
The html changed a bit.
Change the if statement from
for line in r.iter_lines(decode_unicode=True):
if 'amznMusic.appConfig = ' in line:
to
for line in r.iter_lines(decode_unicode=True):
if 'var applicationContextConfiguration =' in line:
https://github.com/Jaffa/amazon-music/blob/master/amazonmusic.py#L106
@Jaffa
Does this solution still work? I installed the requred libraries:
Requests
andBeautiful Soup
on Python 2.7 and used the most basic script (code below). However, I keep getting the below errors when executing. Is there anything more that I have to do to get it to work correctly? I have an amazon unlimited account in United States. PS: I need to do this under Python 2.7. Hopefully this project hasn't been abandoned.Traceback (most recent call last): File "c:/Users/Michael/OneDrive/Dev/Projects/Python/test-amazonmusic.py", line 12, in
am = AmazonMusic(credentials=['amazonusername', 'password'])
File "c:\Users\Michael\OneDrive\Dev\Projects\Python\amazonmusic.py", line 107, in init
app_config = json.loads(re.sub(r'^[^{]*', '', re.sub(r';$', '', line)))
File "C:\Users\Michael\AppData\Local\Programs\Python\python27\lib\json__init__.py", line 339, in loads
return _default_decoder.decode(s)
File "C:\Users\Michael\AppData\Local\Programs\Python\python27\lib\json\decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Michael\AppData\Local\Programs\Python\python27\lib\json\decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded