Merge branch 'nathom:main' into main

This commit is contained in:
Dex 2022-02-15 05:39:56 -06:00 committed by GitHub
commit b8e6349e58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View file

@ -1,5 +1,5 @@
"""streamrip: the all in one music downloader."""
__version__ = "1.9.3"
__version__ = "1.9.4"
from . import clients, constants, converter, downloadtools, media

View file

@ -176,9 +176,9 @@ MEDIA_TYPES = {"track", "album", "artist", "label", "playlist", "video"}
COVER_SIZES = ("thumbnail", "small", "large", "original")
TIDAL_CLIENT_INFO = {
"id": base64.b64decode("OFNFWldhNEoxTlZDNVU1WQ==").decode("iso-8859-1"),
"id": base64.b64decode("elU0WEhWVmtjMnREUG80dA==").decode("iso-8859-1"),
"secret": base64.b64decode(
"b3dVWURreGRkeis5RnB2R1gyNERseEVDTnRGRU1CeGlwVTBsQmZyYnE2MD0="
"VkpLaERGcUpQcXZzUFZOQlY2dWtYVEptd2x2YnR0UDd3bE1scmM3MnNlND0="
).decode("iso-8859-1"),
}

View file

@ -186,9 +186,7 @@ class DownloadPool:
async with session.get(url) as response, aiofiles.open(filename, "wb") as f:
# without aiofiles 3.6632679780000004s
# with aiofiles 2.504482839s
content = await response.content.read()
print(content)
await f.write(content)
await f.write(await response.content.read())
if self.callback:
self.callback()

View file

@ -439,7 +439,9 @@ class Track(Media):
import m3u8
import requests
parsed_m3u = m3u8.loads(requests.get(dl_info["url"]).text)
parsed_m3u = m3u8.loads(
requests.get(dl_info["url"]).content.decode("utf-8")
)
self.path += ".mp3"
with DownloadPool(segment.uri for segment in parsed_m3u.segments) as pool: