mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-20 18:25:30 -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):
|
def update(self):
|
||||||
"""Reset the config file except for credentials."""
|
"""Reset the config file except for credentials."""
|
||||||
self.reset()
|
self.reset()
|
||||||
temp = copy.deepcopy(self.defaults)
|
# Save original credentials
|
||||||
temp["qobuz"].update(self.file["qobuz"])
|
qobuz_creds = self.file["qobuz"]
|
||||||
temp["tidal"].update(self.file["tidal"])
|
tidal_creds = self.file["tidal"]
|
||||||
self.dump(temp)
|
|
||||||
del temp
|
# 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):
|
def save(self):
|
||||||
"""Save the config state to file."""
|
"""Save the config state to file."""
|
||||||
|
|
|
@ -230,7 +230,7 @@ class DownloadStream:
|
||||||
self.request = self.session.get(
|
self.request = self.session.get(
|
||||||
url, allow_redirects=True, stream=True, params=params
|
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:
|
if self.file_size == 0:
|
||||||
raise NonStreamable
|
raise NonStreamable
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue