mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Chunk video files to bypass throttling
This commit is contained in:
parent
f7dbf2bdd4
commit
e5fa5df7be
2 changed files with 95 additions and 32 deletions
|
@ -347,3 +347,21 @@ def subscribe_pubsub(topic, key, config)
|
|||
|
||||
return client.post("/subscribe", form: body)
|
||||
end
|
||||
|
||||
def parse_range(range)
|
||||
if !range
|
||||
return 0_i64, nil
|
||||
end
|
||||
|
||||
ranges = range.lchop("bytes=").split(',')
|
||||
ranges.each do |range|
|
||||
start_range, end_range = range.split('-')
|
||||
|
||||
start_range = start_range.to_i64? || 0_i64
|
||||
end_range = end_range.to_i64?
|
||||
|
||||
return start_range, end_range
|
||||
end
|
||||
|
||||
return 0_i64, nil
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue