mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-14 07:04:51 -04:00
Use asynchronous requests for QobuzClient startup/login
This commit is contained in:
parent
e9f40923ba
commit
6e0731ed0b
4 changed files with 54 additions and 36 deletions
|
@ -8,6 +8,7 @@ import re
|
|||
from getpass import getpass
|
||||
from hashlib import md5
|
||||
from string import Formatter
|
||||
import threading
|
||||
from typing import Dict, Generator, List, Optional, Tuple, Type, Union
|
||||
|
||||
import requests
|
||||
|
@ -385,9 +386,16 @@ class RipCore(list):
|
|||
creds = self.config.creds(client.source)
|
||||
except MissingCredentials:
|
||||
logger.debug("Credentials are missing. Prompting..")
|
||||
get_tokens = threading.Thread(
|
||||
target=client._get_app_id_and_secrets, daemon=True
|
||||
)
|
||||
get_tokens.start()
|
||||
|
||||
self.prompt_creds(client.source)
|
||||
creds = self.config.creds(client.source)
|
||||
|
||||
get_tokens.join()
|
||||
|
||||
if (
|
||||
client.source == "qobuz"
|
||||
and not creds.get("secrets")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue