mirror of
https://github.com/nathom/streamrip.git
synced 2025-06-06 01:31:19 -04:00
Fix m3u8 encoding error for soundcloud
This commit is contained in:
parent
7b3aab1823
commit
5c8e0b1530
2 changed files with 4 additions and 4 deletions
|
@ -186,9 +186,7 @@ class DownloadPool:
|
||||||
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
|
||||||
content = await response.content.read()
|
await f.write(await response.content.read())
|
||||||
print(content)
|
|
||||||
await f.write(content)
|
|
||||||
|
|
||||||
if self.callback:
|
if self.callback:
|
||||||
self.callback()
|
self.callback()
|
||||||
|
|
|
@ -439,7 +439,9 @@ class Track(Media):
|
||||||
import m3u8
|
import m3u8
|
||||||
import requests
|
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"
|
self.path += ".mp3"
|
||||||
|
|
||||||
with DownloadPool(segment.uri for segment in parsed_m3u.segments) as pool:
|
with DownloadPool(segment.uri for segment in parsed_m3u.segments) as pool:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue