mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-20 18:25:30 -04:00
misc changes
This commit is contained in:
parent
ead14afbbe
commit
afb76e530c
5 changed files with 17 additions and 11 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ dist
|
|||
build
|
||||
test.py
|
||||
/urls.txt
|
||||
*.flac
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import datetime
|
||||
import base64
|
||||
import json
|
||||
import datetime
|
||||
import hashlib
|
||||
import logging
|
||||
import os
|
||||
|
@ -551,7 +552,7 @@ class TidalMQAClient:
|
|||
}
|
||||
resp = self._api_post(f"{TIDAL_AUTH_URL}/device_authorization", data)
|
||||
|
||||
if 'status' in resp and resp['status'] != 200:
|
||||
if "status" in resp and resp["status"] != 200:
|
||||
raise Exception(f"Device authorization failed {resp}")
|
||||
|
||||
logger.debug(pformat(resp))
|
||||
|
@ -650,8 +651,8 @@ class TidalMQAClient:
|
|||
"assetpresentation": "FULL",
|
||||
}
|
||||
resp = self._api_request(f"tracks/{track_id}/playbackinfopostpaywall", params)
|
||||
manifest = json.loads(base64.b64decode(resp['manifest']).decode("utf-8"))
|
||||
codec = manifest['codecs']
|
||||
manifest = json.loads(base64.b64decode(resp["manifest"]).decode("utf-8"))
|
||||
codec = manifest["codecs"]
|
||||
file_url = manifest["urls"][0]
|
||||
enc_key = manifest.get("keyId", "")
|
||||
return resp
|
||||
return manifest
|
||||
|
|
|
@ -32,14 +32,18 @@ class Config:
|
|||
|
||||
defaults = {
|
||||
"qobuz": {
|
||||
"enabled": True,
|
||||
"email": None,
|
||||
"password": None,
|
||||
"app_id": "", # Avoid NoneType error
|
||||
"secrets": [],
|
||||
},
|
||||
"tidal": {"enabled": True, "email": None, "password": None},
|
||||
"deezer": {"enabled": True},
|
||||
"tidal": {
|
||||
"user_id": None,
|
||||
"country_code": None,
|
||||
"access_token": None,
|
||||
"refresh_token": None,
|
||||
"expires_after": 0,
|
||||
},
|
||||
"database": {"enabled": True, "path": None},
|
||||
"conversion": {
|
||||
"enabled": False,
|
||||
|
|
|
@ -8,7 +8,7 @@ APPNAME = "streamrip"
|
|||
|
||||
CACHE_DIR = click.get_app_dir(APPNAME)
|
||||
CONFIG_DIR = click.get_app_dir(APPNAME)
|
||||
CONFIG_PATH = os.path.join(CONFIG_DIR, "config.yaml")
|
||||
CONFIG_PATH = os.path.join(CONFIG_DIR, "configmqa.yaml")
|
||||
LOG_DIR = click.get_app_dir(APPNAME)
|
||||
DB_PATH = os.path.join(LOG_DIR, "downloads.db")
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ from string import Formatter
|
|||
from typing import Optional
|
||||
|
||||
import requests
|
||||
from pathvalidate import sanitize_filename
|
||||
from tqdm import tqdm
|
||||
from Crypto.Cipher import AES
|
||||
from Crypto.Util import Counter
|
||||
from pathvalidate import sanitize_filename
|
||||
from tqdm import tqdm
|
||||
|
||||
from .constants import LOG_DIR, TIDAL_COVER_URL
|
||||
from .exceptions import NonStreamable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue