Skip to content

Commit

Permalink
Fix error when the Content-Length header is missing (#241)
Browse files Browse the repository at this point in the history
* Fix error when the Content-Length header is missing

* Set the minimum size of a downloaded playlist
  • Loading branch information
woxcab committed Sep 9, 2022
1 parent 067e90a commit 3190333
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr/lib/hypnotix/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def get_playlist(self, provider, refresh=False) -> bool:
# Set downloaded size
downloaded_bytes = 0
# Get total playlist byte size
total_content_size = int(response.headers['content-length'])
total_content_size = int(response.headers.get('content-length', 15))
# Set stream blocks
block_bytes = int(4*1024*1024) # 4 MB

Expand Down

0 comments on commit 3190333

Please sign in to comment.