Skip to content

Commit acbfe32

Browse files
committed
fix(decrypter): support cipher and add tracing for v2.1.13
1 parent d3baff6 commit acbfe32

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

mods/features/hybridPlayer.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,15 @@ class HybridPlayer {
310310
}
311311

312312
selectBestVideoStream(formats) {
313+
console.log(`[HybridPlayer] Selecting video from ${formats?.length} formats`);
314+
if (formats && formats.length > 0) {
315+
console.log('[HybridPlayer] Sample format:', JSON.stringify({
316+
mimeType: formats[0].mimeType,
317+
hasUrl: !!formats[0].url,
318+
hasCipher: !!(formats[0].signatureCipher || formats[0].cipher)
319+
}));
320+
}
321+
313322
const preferredQuality = configRead('preferredVideoQuality');
314323
const h = (preferredQuality === 'auto' || isNaN(parseInt(preferredQuality))) ? 1080 : parseInt(preferredQuality);
315324

mods/features/signatureDecrypter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ export const signatureDecrypter = {
1111
*/
1212
decrypt(format) {
1313
if (format.url) return format;
14-
if (!format.signatureCipher) return format;
14+
const cipher = format.signatureCipher || format.cipher;
15+
if (!cipher) return format;
1516

16-
const cipher = format.signatureCipher;
1717
const params = new URLSearchParams(cipher);
1818
const url = params.get('url');
1919
const signature = params.get('s');
2020
const sp = params.get('sp') || 'sig';
2121

2222
if (!url || !signature) {
23-
console.warn('[SignatureDecrypter] Invalid cipher data', format);
23+
console.warn('[SignatureDecrypter] Invalid cipher data', { hasUrl: !!url, hasSig: !!signature });
2424
return format;
2525
}
2626

0 commit comments

Comments
 (0)