Fixed doc

This commit is contained in:
agres
2025-03-19 01:07:42 +01:00
parent c3e3db87cc
commit 12096b2ec0
+8 -8
View File
@@ -1,16 +1,16 @@
import dotenv
import time
from urllib.parse import urlencode, urlparse, parse_qs
from http.server import BaseHTTPRequestHandler, HTTPServer
import requests
import os
import json import json
import os
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import parse_qs, urlencode, urlparse
import dotenv
import requests
TOKEN_FILE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'env', 'tokens.json') TOKEN_FILE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'env', 'tokens.json')
def authenticate(scope: str) -> tuple: def authenticate(scope: str) -> str:
""" """
This function authenticates the user and returns the access token This function authenticates the user and returns the access token
@@ -36,7 +36,7 @@ def authenticate(scope: str) -> tuple:
authorization_code = _start_server_and_wait_for_code() authorization_code = _start_server_and_wait_for_code()
access_token, refresh_token = _exchange_code_for_token(authorization_code, redirect_uri=spotify_redirect_uri, access_token, refresh_token = _exchange_code_for_token(authorization_code, redirect_uri=spotify_redirect_uri,
client_id=spotify_client_id, client_secret=spotify_client_secret) client_id=spotify_client_id, client_secret=spotify_client_secret)
_save_tokens(access_token, refresh_token) _save_tokens(access_token, refresh_token)