403 Client Error: Forbidden for url: https://api.tidalhifi.com/v1/login/username
Not sure if it not the same problem as discribed here:
https://github.com/tamland/python-tidal/issues/65
But, then I try use simple example usage:
import tidalapi
session = tidalapi.Session()
session.login('[email protected]', 'mypassword')
tracks = session.get_album_tracks(album_id=16909093)
for track in tracks:
print(track.name)
I get this error:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Request blocked.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: sKUMth11MHMiKf0cWbBmNelWPrCh3HF8OpQWjnZqxmCK_MuhJ1JpjA==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>
Traceback (most recent call last):
File "\Python\test.py", line 4, in <module>
session.login('[email protected]', 'mypassword')
File "\Python\tidalapi\__init__.py", line 98, in login
request.raise_for_status()
File "\Python\lib\site-packages\requests\models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.tidalhifi.com/v1/login/username
Is any solutions for this? Thanks!
Use new login method - oauth2. Legacy login method is being killed by tidal.
EDIT: It looks like bot detection was triggered on your request. That's bad. Anyway: try OAuth2.
Thanks for your answear! I understand correctly that new login method - oauth2 is not provided in this api, and I have to get the token in another way?
I recommend either using PyPI, the 0.6.x branch or the 0.7.x branch, the master branch doesn't work right now. Those places have the updated documentation for logging in with OAuth.
Closing this as stale/deprecated.