Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to authenticate for users outside US #23

Open
lohriialo opened this issue Feb 19, 2019 · 5 comments
Open

Unable to authenticate for users outside US #23

lohriialo opened this issue Feb 19, 2019 · 5 comments

Comments

@lohriialo
Copy link

The login points to music.amazon.com for authentication however, me as a user from India, my music is not accessible from amazon.com instead it's accessible on amazon.in

Should do something to dynamically point to the correct endpoint for every country or else allow user to manually choose login api endpoint

@Jaffa
Copy link
Owner

Jaffa commented Jun 3, 2019

Sorry for the problem, and the delay in replying. This could be possibly related to #19?

In the UK, going to https://music.amazon.com redirects to the appropriate site once logged in (in this case music.amazon.co.uk).

Does that not happen for the Indian site?

@lohriialo
Copy link
Author

Still unable to authenticate, here's how i'm trying to use and the error I got

from amazonmusic import AmazonMusic
import os

amazon_music = AmazonMusic(credentials=['****', '*****'])
station = amazon_music.create_station('A2FRGLRCG7IBYS')
print('Playing station {0}...'.format(station.name))
for t in station.tracks:
    print('Playing {0} by {1} from {2} [{3}]...'.format(t.name, t.artist, t.album, t.albumArtist))
    os.system('cvlc --play-and-exit "{0}"'.format(t.getUrl()))
Traceback (most recent call last):
  File "/Users/user/PycharmProjects/AmazonMusic/getStationPlaylist.py", line 4, in <module>
    amazon_music = AmazonMusic(credentials=['******, '********'])
  File "/Users/user/PycharmProjects/AmazonMusic/amazonmusic.py", line 102, in __init__
    r = self._authenticate(r)
  File "/Users/user/PycharmProjects/AmazonMusic/amazonmusic.py", line 152, in _authenticate
    raise Exception("Unable to handle captcha: {}".format(tag))
Exception: Unable to handle captcha: [<source data-refresh-url="/ap/captcha?appAction=SIGNIN&amp;captchaType=audio&amp;marketPlaceId=ATVPDKIKX0DER" id="mp3-file" src="https://opfcaptcha-prod.s3.amazonaws.com/9cd4424d1c1447c4b49bec52fa873634.jpg?AWSAccessKeyId=****&amp;Expires=***&amp;Signature=****%3D" type="audio/mpeg"/>]

@Jaffa
Copy link
Owner

Jaffa commented Jun 3, 2019

Still unable to authenticate

Is that with changing the URL to music.amazon.in? What happens when you go to music.amazon.com in a browser and you sign in?

The Unable to handle captcha issue is #19.

@lohriialo
Copy link
Author

Above error is when calling music.amazon.com. A different error if I change the endpoint to music.amazon.in

Traceback (most recent call last):
  File "/Users/users/PycharmProjects/AmazonMusic/getStationPlaylist.py", line 4, in <module>
    amazon_music = AmazonMusic(credentials=['*******', '=['*******','])
  File "/Users/users/PycharmProjects/AmazonMusic/amazonmusic.py", line 112, in __init__
    raise Exception("Unable to find appConfig in {}".format(r.content))
Exception: Unable to find appConfig in b'\n\n\n\n

@lohriialo
Copy link
Author

On browser, when you go to music.amazon.com, it redirects to https://www.amazon.in/ap/signin
Once logged in, goes to music.amazon.in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants