Fixed client-side IACDN setting.
This commit is contained in:
parent
ccb1d91a5b
commit
b57d723d62
3 changed files with 13 additions and 6 deletions
|
|
@ -192,15 +192,21 @@ class player{
|
|||
this.mediaHandler = new hlsDailymotionHandler(this.client, this, data.media);
|
||||
//Otherwise, if we have a raw-file compatible source
|
||||
}else if(data.media.type == 'ia' || data.media.type == 'raw' || data.media.type == 'yt' || data.media.type == 'dm'){
|
||||
|
||||
//If we're running a source from IA
|
||||
if(data.media.type == 'ia'){
|
||||
//Replace specified CDN with generic URL, in-case of hard reload
|
||||
//data.media.rawLink = data.media.rawLink.replace(/^https(.*)archive\.org(.*)items/g, "https://archive.org/download")
|
||||
|
||||
//If we have an IA source and a custom IA CDN Server set
|
||||
if(data.media.type == 'ia' && localStorage.getItem("IACDN") != ""){
|
||||
//Generate and set new link
|
||||
//data.media.rawLink = data.media.rawLink.replace("https://archive.org/download", `https://${localStorage.getItem("IACDN")}.archive.org/0/items`);
|
||||
for(const linkIndex in data.media.rawLink.combo){
|
||||
//Pull link to sprinkle on dat syntatic sugar (tasty)
|
||||
let link = data.media.rawLink.combo[linkIndex][1]
|
||||
|
||||
//Replace specified CDN with generic URL, in-case of hard reload
|
||||
link = link.replace(/^https(.*)archive\.org(.*)items/g, "https://archive.org/download");
|
||||
|
||||
//Generate and set new link
|
||||
data.media.rawLink.combo[linkIndex][1] = link.replace("https://archive.org/download", `https://${localStorage.getItem("IACDN")}.archive.org/0/items`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue