python-tidal icon indicating copy to clipboard operation
python-tidal copied to clipboard

403 Client Error: Forbidden for url: https://api.tidalhifi.com/v1/login/username

Open taravasya opened this issue 4 years ago • 3 comments

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!

taravasya avatar May 13 '21 13:05 taravasya

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.

JuniorJPDJ avatar May 13 '21 13:05 JuniorJPDJ

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?

taravasya avatar May 13 '21 14:05 taravasya

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.

morguldir avatar May 14 '21 02:05 morguldir

Closing this as stale/deprecated.

tehkillerbee avatar Aug 22 '23 19:08 tehkillerbee