mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-20 18:25:30 -04:00
Tidy ups
This commit is contained in:
parent
a8b4c89fc6
commit
918f0e3547
3 changed files with 6 additions and 8 deletions
|
@ -174,9 +174,6 @@ class RipCore(list):
|
||||||
|
|
||||||
for source, url_type, item_id in parsed:
|
for source, url_type, item_id in parsed:
|
||||||
if item_id in self.db:
|
if item_id in self.db:
|
||||||
logger.info(
|
|
||||||
f"ID {item_id} already downloaded, use --ignore-db to override."
|
|
||||||
)
|
|
||||||
secho(
|
secho(
|
||||||
f"ID {item_id} already downloaded, use --ignore-db to override.",
|
f"ID {item_id} already downloaded, use --ignore-db to override.",
|
||||||
fg="magenta",
|
fg="magenta",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
"""The clients that interact with the service APIs."""
|
"""The clients that interact with the streaming service APIs."""
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import binascii
|
import binascii
|
||||||
|
@ -116,7 +116,6 @@ class QobuzClient(Client):
|
||||||
:type pwd: str
|
:type pwd: str
|
||||||
:param kwargs: app_id: str, secrets: list, return_secrets: bool
|
:param kwargs: app_id: str, secrets: list, return_secrets: bool
|
||||||
"""
|
"""
|
||||||
# TODO: make this faster
|
|
||||||
secho(f"Logging into {self.source}", fg="green")
|
secho(f"Logging into {self.source}", fg="green")
|
||||||
email: str = kwargs["email"]
|
email: str = kwargs["email"]
|
||||||
pwd: str = kwargs["pwd"]
|
pwd: str = kwargs["pwd"]
|
||||||
|
|
|
@ -184,9 +184,11 @@ class DownloadPool:
|
||||||
filename = await self.getfn(url)
|
filename = await self.getfn(url)
|
||||||
logger.debug("Downloading %s", url)
|
logger.debug("Downloading %s", url)
|
||||||
async with session.get(url) as response, aiofiles.open(filename, "wb") as f:
|
async with session.get(url) as response, aiofiles.open(filename, "wb") as f:
|
||||||
# without aiofiles 3.6632679780000004s
|
# without aiofiles 3.6632679780000004s
|
||||||
# with aiofiles 2.504482839s
|
# with aiofiles 2.504482839s
|
||||||
await f.write(await response.content.read())
|
content = await response.content.read()
|
||||||
|
print(content)
|
||||||
|
await f.write(content)
|
||||||
|
|
||||||
if self.callback:
|
if self.callback:
|
||||||
self.callback()
|
self.callback()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue