mirror of
https://github.com/nathom/streamrip.git
synced 2024-09-19 11:18:45 -04:00
Merge branch 'dev'
This commit is contained in:
commit
2418c4e70f
8 changed files with 21 additions and 15 deletions
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "streamrip"
|
||||
version = "1.9.2"
|
||||
version = "1.9.3"
|
||||
description = "A fast, all-in-one music ripper for Qobuz, Deezer, Tidal, and SoundCloud"
|
||||
authors = ["nathom <nathanthomas707@gmail.com>"]
|
||||
license = "GPL-3.0-only"
|
||||
|
|
0
rg
0
rg
|
@ -174,9 +174,6 @@ class RipCore(list):
|
|||
|
||||
for source, url_type, item_id in parsed:
|
||||
if item_id in self.db:
|
||||
logger.info(
|
||||
f"ID {item_id} already downloaded, use --ignore-db to override."
|
||||
)
|
||||
secho(
|
||||
f"ID {item_id} already downloaded, use --ignore-db to override.",
|
||||
fg="magenta",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"""streamrip: the all in one music downloader."""
|
||||
|
||||
__version__ = "1.9.2"
|
||||
__version__ = "1.9.3"
|
||||
|
||||
from . import clients, constants, converter, downloadtools, media
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
"""The clients that interact with the service APIs."""
|
||||
"""The clients that interact with the streaming service APIs."""
|
||||
|
||||
import base64
|
||||
import binascii
|
||||
|
@ -116,7 +116,6 @@ class QobuzClient(Client):
|
|||
:type pwd: str
|
||||
:param kwargs: app_id: str, secrets: list, return_secrets: bool
|
||||
"""
|
||||
# TODO: make this faster
|
||||
secho(f"Logging into {self.source}", fg="green")
|
||||
email: str = kwargs["email"]
|
||||
pwd: str = kwargs["pwd"]
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
"""Constants that are kept in one place."""
|
||||
|
||||
import base64
|
||||
|
||||
import mutagen.id3 as id3
|
||||
|
||||
AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0"
|
||||
|
@ -174,8 +176,10 @@ MEDIA_TYPES = {"track", "album", "artist", "label", "playlist", "video"}
|
|||
COVER_SIZES = ("thumbnail", "small", "large", "original")
|
||||
|
||||
TIDAL_CLIENT_INFO = {
|
||||
"id": "Pzd0ExNVHkyZLiYN",
|
||||
"secret": "W7X6UvBaho+XOi1MUeCX6ewv2zTdSOV3Y7qC3p3675I=",
|
||||
"id": base64.b64decode("OFNFWldhNEoxTlZDNVU1WQ==").decode("iso-8859-1"),
|
||||
"secret": base64.b64decode(
|
||||
"b3dVWURreGRkeis5RnB2R1gyNERseEVDTnRGRU1CeGlwVTBsQmZyYnE2MD0="
|
||||
).decode("iso-8859-1"),
|
||||
}
|
||||
|
||||
QOBUZ_BASE = "https://www.qobuz.com/api.json/0.2"
|
||||
|
|
|
@ -184,9 +184,11 @@ class DownloadPool:
|
|||
filename = await self.getfn(url)
|
||||
logger.debug("Downloading %s", url)
|
||||
async with session.get(url) as response, aiofiles.open(filename, "wb") as f:
|
||||
# without aiofiles 3.6632679780000004s
|
||||
# with aiofiles 2.504482839s
|
||||
await f.write(await response.content.read())
|
||||
# without aiofiles 3.6632679780000004s
|
||||
# with aiofiles 2.504482839s
|
||||
content = await response.content.read()
|
||||
print(content)
|
||||
await f.write(content)
|
||||
|
||||
if self.callback:
|
||||
self.callback()
|
||||
|
|
|
@ -1495,7 +1495,11 @@ class Album(Tracklist, Media):
|
|||
"""
|
||||
# Generate the folder name
|
||||
self.folder_format = kwargs.get("folder_format", FOLDER_FORMAT)
|
||||
self.quality = min(kwargs.get("quality", 3), self.client.max_quality)
|
||||
self.quality = min(
|
||||
kwargs.get("quality", 3),
|
||||
self.client.max_quality,
|
||||
self.meta.get("quality", 5),
|
||||
)
|
||||
|
||||
self.container = get_container(self.quality, self.client.source)
|
||||
# necessary to format the folder
|
||||
|
@ -1521,8 +1525,8 @@ class Album(Tracklist, Media):
|
|||
self.folder,
|
||||
kwargs.get("keep_hires_cover", True),
|
||||
(
|
||||
kwargs.get("max_artwork_width", 999999),
|
||||
kwargs.get("max_artwork_height", 999999),
|
||||
kwargs.get("max_artwork_width", 1e9),
|
||||
kwargs.get("max_artwork_height", 1e9),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue