forked from midou/invidious
Revert "Chunk videoplayback response to avoid throttling"
This reverts commit 818cd2454d
.
This commit is contained in:
@@ -656,7 +656,7 @@ def proxy_file(response, env)
|
||||
end
|
||||
|
||||
# https://stackoverflow.com/a/44802810 <3
|
||||
def copy_in_chunks(input, output, chunk_size = 8192)
|
||||
def copy_in_chunks(input, output, chunk_size = 4096)
|
||||
size = 1
|
||||
while size > 0
|
||||
size = IO.copy(input, output, chunk_size)
|
||||
|
@@ -347,21 +347,3 @@ def subscribe_pubsub(topic, key, config)
|
||||
|
||||
return client.post("/subscribe", form: body)
|
||||
end
|
||||
|
||||
def parse_range(range)
|
||||
if !range
|
||||
return 0, nil
|
||||
end
|
||||
|
||||
ranges = range.lchop("bytes=").split(',')
|
||||
ranges.each do |range|
|
||||
start_range, end_range = range.split('-')
|
||||
|
||||
start_range = start_range.to_i? || 0
|
||||
end_range = end_range.to_i?.try &.+ 1
|
||||
|
||||
return start_range, end_range
|
||||
end
|
||||
|
||||
return 0, nil
|
||||
end
|
||||
|
Reference in New Issue
Block a user