From f98ee5c8f75c2817c8acc903e4fc19bc701741b1 Mon Sep 17 00:00:00 2001 From: nathom Date: Thu, 29 Jul 2021 12:36:25 -0700 Subject: [PATCH] Fix soundcloud "File not found" --- streamrip/media.py | 1 + streamrip/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/streamrip/media.py b/streamrip/media.py index 687b1a4..02d6638 100644 --- a/streamrip/media.py +++ b/streamrip/media.py @@ -422,6 +422,7 @@ class Track(Media): :type dl_info: dict :rtype: str """ + logger.debug("dl_info: %s", dl_info) if dl_info["type"] == "mp3": self.path += ".mp3" # convert hls stream to mp3 diff --git a/streamrip/utils.py b/streamrip/utils.py index a7dd3b1..940a9d9 100644 --- a/streamrip/utils.py +++ b/streamrip/utils.py @@ -77,8 +77,8 @@ class DownloadStream: ) self.file_size = int(self.request.headers.get("Content-Length", 0)) - if self.file_size == 0: - raise NonStreamable + if self.file_size == 0 and not self.url.endswith(".jpg"): + raise NonStreamable("File not found.") def __iter__(self) -> Iterator: """Iterate through chunks of the stream.