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
|
build
|
||||||
test.py
|
test.py
|
||||||
/urls.txt
|
/urls.txt
|
||||||
|
*.flac
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import datetime
|
|
||||||
import base64
|
import base64
|
||||||
|
import json
|
||||||
|
import datetime
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -551,7 +552,7 @@ class TidalMQAClient:
|
||||||
}
|
}
|
||||||
resp = self._api_post(f"{TIDAL_AUTH_URL}/device_authorization", data)
|
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}")
|
raise Exception(f"Device authorization failed {resp}")
|
||||||
|
|
||||||
logger.debug(pformat(resp))
|
logger.debug(pformat(resp))
|
||||||
|
@ -650,8 +651,8 @@ class TidalMQAClient:
|
||||||
"assetpresentation": "FULL",
|
"assetpresentation": "FULL",
|
||||||
}
|
}
|
||||||
resp = self._api_request(f"tracks/{track_id}/playbackinfopostpaywall", params)
|
resp = self._api_request(f"tracks/{track_id}/playbackinfopostpaywall", params)
|
||||||
manifest = json.loads(base64.b64decode(resp['manifest']).decode("utf-8"))
|
manifest = json.loads(base64.b64decode(resp["manifest"]).decode("utf-8"))
|
||||||
codec = manifest['codecs']
|
codec = manifest["codecs"]
|
||||||
file_url = manifest["urls"][0]
|
file_url = manifest["urls"][0]
|
||||||
enc_key = manifest.get("keyId", "")
|
enc_key = manifest.get("keyId", "")
|
||||||
return resp
|
return manifest
|
||||||
|
|
|
@ -32,14 +32,18 @@ class Config:
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
"qobuz": {
|
"qobuz": {
|
||||||
"enabled": True,
|
|
||||||
"email": None,
|
"email": None,
|
||||||
"password": None,
|
"password": None,
|
||||||
"app_id": "", # Avoid NoneType error
|
"app_id": "", # Avoid NoneType error
|
||||||
"secrets": [],
|
"secrets": [],
|
||||||
},
|
},
|
||||||
"tidal": {"enabled": True, "email": None, "password": None},
|
"tidal": {
|
||||||
"deezer": {"enabled": True},
|
"user_id": None,
|
||||||
|
"country_code": None,
|
||||||
|
"access_token": None,
|
||||||
|
"refresh_token": None,
|
||||||
|
"expires_after": 0,
|
||||||
|
},
|
||||||
"database": {"enabled": True, "path": None},
|
"database": {"enabled": True, "path": None},
|
||||||
"conversion": {
|
"conversion": {
|
||||||
"enabled": False,
|
"enabled": False,
|
||||||
|
|
|
@ -8,7 +8,7 @@ APPNAME = "streamrip"
|
||||||
|
|
||||||
CACHE_DIR = click.get_app_dir(APPNAME)
|
CACHE_DIR = click.get_app_dir(APPNAME)
|
||||||
CONFIG_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)
|
LOG_DIR = click.get_app_dir(APPNAME)
|
||||||
DB_PATH = os.path.join(LOG_DIR, "downloads.db")
|
DB_PATH = os.path.join(LOG_DIR, "downloads.db")
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@ from string import Formatter
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from pathvalidate import sanitize_filename
|
|
||||||
from tqdm import tqdm
|
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
||||||
from Crypto.Util import Counter
|
from Crypto.Util import Counter
|
||||||
|
from pathvalidate import sanitize_filename
|
||||||
|
from tqdm import tqdm
|
||||||
|
|
||||||
from .constants import LOG_DIR, TIDAL_COVER_URL
|
from .constants import LOG_DIR, TIDAL_COVER_URL
|
||||||
from .exceptions import NonStreamable
|
from .exceptions import NonStreamable
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue