mirror of
https://github.com/iv-org/invidious.git
synced 2025-05-02 06:26:27 -04:00
Proxy: pass range as URL parameter to avoid throttling
This commit is contained in:
parent
e62d61abc1
commit
3474744f57
3 changed files with 86 additions and 33 deletions
|
@ -43,6 +43,14 @@ embed_url = location.origin + '/embed/' + video_data.id + embed_url.search;
|
|||
var save_player_pos_key = 'save_player_pos';
|
||||
|
||||
videojs.Vhs.xhr.beforeRequest = function(options) {
|
||||
// Pass range as an URL parameter, not as a header
|
||||
if (options.headers){
|
||||
if (options.headers.Range) {
|
||||
options.uri = options.uri + '&range=' + options.headers.Range.split("=")[1];
|
||||
delete options.headers.Range;
|
||||
}
|
||||
}
|
||||
|
||||
// set local if requested not videoplayback
|
||||
if (!options.uri.includes('videoplayback')) {
|
||||
if (!options.uri.includes('local=true'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue