This commit is contained in:
Nathan Thomas 2022-01-21 19:34:08 -08:00
parent a8b4c89fc6
commit 918f0e3547
3 changed files with 6 additions and 8 deletions

View file

@ -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",

View file

@ -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"]

View file

@ -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()