mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-20 10:15:23 -04:00
Fix issue where downloads folder is blank
This commit is contained in:
parent
1e6c138e54
commit
ca67173162
2 changed files with 14 additions and 6 deletions
|
@ -70,11 +70,19 @@ class Config:
|
|||
def update(self):
|
||||
"""Reset the config file except for credentials."""
|
||||
self.reset()
|
||||
temp = copy.deepcopy(self.defaults)
|
||||
temp["qobuz"].update(self.file["qobuz"])
|
||||
temp["tidal"].update(self.file["tidal"])
|
||||
self.dump(temp)
|
||||
del temp
|
||||
# Save original credentials
|
||||
qobuz_creds = self.file["qobuz"]
|
||||
tidal_creds = self.file["tidal"]
|
||||
|
||||
# Reset and load config file
|
||||
shutil.copy(self.default_config_path, self._path)
|
||||
self.load()
|
||||
|
||||
# Set credentials and download directory, then save
|
||||
self.file["qobuz"].update(qobuz_creds)
|
||||
self.file["tidal"].update(tidal_creds)
|
||||
self.file["downloads"]["folder"] = DOWNLOADS_DIR
|
||||
self.save()
|
||||
|
||||
def save(self):
|
||||
"""Save the config state to file."""
|
||||
|
|
|
@ -230,7 +230,7 @@ class DownloadStream:
|
|||
self.request = self.session.get(
|
||||
url, allow_redirects=True, stream=True, params=params
|
||||
)
|
||||
self.file_size = int(self.request.headers["Content-Length"])
|
||||
self.file_size = int(self.request.headers.get("Content-Length", 0))
|
||||
|
||||
if self.file_size == 0:
|
||||
raise NonStreamable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue