Skip to content

Commit

Permalink
Fixed a bug when specifying a custom download directory
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanoGuerrini committed Jan 17, 2025
1 parent 95e72b7 commit b298de0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hda/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ def stream(self, download_id, size, download_dir):
r.close()

if size is None or total >= size:
size = os.path.getsize(filename)
size = os.path.getsize(os.path.join(download_dir, filename))
break

logger.error(
Expand All @@ -804,7 +804,7 @@ def stream(self, download_id, size, download_dir):
logger.warning("Sleeping %s seconds" % (sleep,))
time.sleep(sleep)
mode = "ab"
total = os.path.getsize(filename)
total = os.path.getsize(os.path.join(download_dir, filename))
sleep *= 1.5
if sleep > self.sleep_max:
sleep = self.sleep_max
Expand Down

0 comments on commit b298de0

Please sign in to comment.