Skip to content

Commit

Permalink
Update Piccoma.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeZeDev authored Dec 29, 2023
1 parent ed0ab27 commit 5e06f9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/web/mjs/connectors/Piccoma.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default class Piccoma extends Connector {
new Promise((resolve, reject) => {
function _getSeed(url) {
const uri = new URL(url, window.location.href); //fix urls starting with "//"
const uri = new URL(url.startsWith('http') ? url : 'https:'+url);
let checksum = uri.searchParams.get('q') || url.split('/').slice(-2)[0]; //PiccomaFR use q=, JP is the other
const expires = uri.searchParams.get('expires');
const total = expires.split('').reduce((total, num2) => total + parseInt(num2), 0);
Expand All @@ -118,7 +118,7 @@ export default class Piccoma extends Connector {
.filter(img => !!img.path)
.map(img => {
return {
url : new URL(img.path, window.location.href).href,//fix urls starting with "//"
url : img.path.startsWith('http') ? img.path : 'https:' + img.path,
key : pdata.isScrambled ? _getSeed(img.path) : null,
}
});
Expand Down Expand Up @@ -349,4 +349,4 @@ function mixkey(seed, key) {
mask & (smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++);
}
return String.fromCharCode.apply(0, key);
}
}

0 comments on commit 5e06f9e

Please sign in to comment.