
    qh                     2    S r SSKrSSKJr   " S S\5      rg)z
Spotify backend, docs at:
    https://developer.spotify.com/spotify-web-api/
    https://developer.spotify.com/spotify-web-api/authorization-guide/
    N   )
BaseOAuth2c                   H    \ rS rSrSrSrSrSrSrSr	Sr
S	/rS
 rS rS rSrg)SpotifyOAuth2   z%Spotify OAuth2 authentication backendspotifyidz&https://accounts.spotify.com/authorizez&https://accounts.spotify.com/api/token F)refresh_tokenr   c                     SR                   " U R                  5       6 n[        R                  " UR	                  5       5      R                  5       nSSU 30$ )Nz{}:{}AuthorizationzBasic )formatget_key_and_secretbase64urlsafe_b64encodeencodedecode)selfauth_strb64_auth_strs      N/var/www/html/env/lib/python3.13/site-packages/social_core/backends/spotify.pyauth_headersSpotifyOAuth2.auth_headers   sK    >>4#:#:#<=//0ABIIK6,!899    c                     U R                  UR                  S5      5      u  p#nUR                  S5      UR                  S5      UUUS.$ )z(Return user details from Spotify accountdisplay_namer	   email)usernamer   fullname
first_name	last_name)get_user_namesget)r   responser   r    r!   s        r   get_user_detailsSpotifyOAuth2.get_user_details   sP    *.*=*=LL(+
'i !T*\\'* $"
 	
r   c                 ,    U R                  SSSU 30S9$ )zLoads user data from servicezhttps://api.spotify.com/v1/mer   zBearer )headers)get_json)r   access_tokenargskwargss       r   	user_dataSpotifyOAuth2.user_data+   s*    }}+$~&>?  
 	
r    N)__name__
__module____qualname____firstlineno____doc__nameID_KEYAUTHORIZATION_URLACCESS_TOKEN_URLSCOPE_SEPARATORREDIRECT_STATE
EXTRA_DATAr   r%   r-   __static_attributes__r/   r   r   r   r      s>    /DF@?ON*J:


r   r   )r4   r   oauthr   r   r/   r   r   <module>r>      s     $
J $
r   