hotfix AO m4s bug, updated packages, updated crunchyroll user-agent

This commit is contained in:
stratumadev 2025-03-16 17:34:16 +01:00
parent 559dfe11de
commit 217c98b39d
4 changed files with 4696 additions and 3764 deletions

24
ao.ts
View file

@ -601,7 +601,7 @@ export default class AnimeOnegai implements ServiceClass {
};
try {
const videoDownload = await new streamdl({
output: chosenVideoSegments.pssh_wvd ? `${tempTsFile}.video.enc.mp4` : `${tsFile}.video.mp4`,
output: chosenVideoSegments.pssh_wvd ? `${tempTsFile}.video.enc.m4s` : `${tsFile}.video.m4s`,
timeout: options.timeout,
m3u8json: videoJson,
// baseurl: chunkPlaylist.baseUrl,
@ -647,7 +647,7 @@ export default class AnimeOnegai implements ServiceClass {
};
try {
const audioDownload = await new streamdl({
output: chosenAudioSegments.pssh_wvd ? `${tempTsFile}.audio.enc.mp4` : `${tsFile}.audio.mp4`,
output: chosenAudioSegments.pssh_wvd ? `${tempTsFile}.audio.enc.m4s` : `${tsFile}.audio.m4s`,
timeout: options.timeout,
m3u8json: audioJson,
// baseurl: chunkPlaylist.baseUrl,
@ -701,8 +701,8 @@ export default class AnimeOnegai implements ServiceClass {
if (this.cfg.bin.mp4decrypt || this.cfg.bin.shaka) {
let commandBase = `--show-progress --key ${encryptionKeys[cdm === 'playready' ? 0 : 1].kid}:${encryptionKeys[cdm === 'playready' ? 0 : 1].key} `;
let commandVideo = commandBase+`"${tempTsFile}.video.enc.mp4" "${tempTsFile}.video.mp4"`;
let commandAudio = commandBase+`"${tempTsFile}.audio.enc.mp4" "${tempTsFile}.audio.mp4"`;
let commandVideo = commandBase+`"${tempTsFile}.video.enc.m4s" "${tempTsFile}.video.m4s"`;
let commandAudio = commandBase+`"${tempTsFile}.audio.enc.m4s" "${tempTsFile}.audio.m4s"`;
if (this.cfg.bin.shaka) {
commandBase = ` --enable_raw_key_decryption ${encryptionKeys.map(kb => '--keys key_id='+kb.kid+':key='+kb.key).join(' ')}`;
@ -716,18 +716,18 @@ export default class AnimeOnegai implements ServiceClass {
if (!decryptVideo.isOk) {
console.error(decryptVideo.err);
console.error(`Decryption failed with exit code ${decryptVideo.err.code}`);
fs.renameSync(`${tempTsFile}.video.enc.mp4`, `${tsFile}.video.enc.mp4`);
fs.renameSync(`${tempTsFile}.video.enc.m4s`, `${tsFile}.video.enc.m4s`);
return undefined;
} else {
console.info('Decryption done for video');
if (!options.nocleanup) {
fs.removeSync(`${tempTsFile}.video.enc.mp4`);
fs.removeSync(`${tempTsFile}.video.enc.m4s`);
}
fs.copyFileSync(`${tempTsFile}.video.m4s`, `${tsFile}.video.m4s`);
fs.unlinkSync(`${tempTsFile}.video.m4s`);
files.push({
type: 'Video',
path: `${tsFile}.video.mp4`,
path: `${tsFile}.video.m4s`,
lang: lang
});
}
@ -739,17 +739,17 @@ export default class AnimeOnegai implements ServiceClass {
if (!decryptAudio.isOk) {
console.error(decryptAudio.err);
console.error(`Decryption failed with exit code ${decryptAudio.err.code}`);
fs.renameSync(`${tempTsFile}.audio.enc.mp4`, `${tsFile}.audio.enc.mp4`);
fs.renameSync(`${tempTsFile}.audio.enc.m4s`, `${tsFile}.audio.enc.m4s`);
return undefined;
} else {
if (!options.nocleanup) {
fs.removeSync(`${tempTsFile}.audio.enc.mp4`);
fs.removeSync(`${tempTsFile}.audio.enc.m4s`);
}
fs.copyFileSync(`${tempTsFile}.audio.m4s`, `${tsFile}.audio.m4s`);
fs.unlinkSync(`${tempTsFile}.audio.m4s`);
files.push({
type: 'Audio',
path: `${tsFile}.audio.mp4`,
path: `${tsFile}.audio.m4s`,
lang: lang
});
console.info('Decryption done for audio');
@ -762,14 +762,14 @@ export default class AnimeOnegai implements ServiceClass {
if (videoDownloaded) {
files.push({
type: 'Video',
path: `${tsFile}.video.mp4`,
path: `${tsFile}.video.m4s`,
lang: lang
});
}
if (audioDownloaded) {
files.push({
type: 'Audio',
path: `${tsFile}.audio.mp4`,
path: `${tsFile}.audio.m4s`,
lang: lang
});
}

View file

@ -77,7 +77,7 @@ const api: APIType = {
// new api
beta_auth: `${domain.api_beta}/auth/v1/token`,
// This User-Agent bypasses Cloudflare security by the newer Endpoint
defaultUserAgent: 'Crunchyroll/4.68.2 (bundle_identifier:com.crunchyroll.iphone; build_number:4007128.533694055) iOS/18.2.0 Gravity/4.68.2',
defaultUserAgent: 'Crunchyroll/4.71.0 (bundle_identifier:com.crunchyroll.iphone; build_number:4052956.474096152) iOS/18.3.2 Gravity/4.71.0',
authBasic: 'Basic bm9haWhkZXZtXzZpeWcwYThsMHE6',
authBasicMob: 'Basic ZG1yeWZlc2NkYm90dWJldW56NXo6NU45aThPV2cyVmtNcm1oekNfNUNXekRLOG55SXo0QU0=',
authBasicIOS: 'Basic eHVuaWh2ZWRidDNtYmlzdWhldnQ6MWtJUzVkeVR2akUwX3JxYUEzWWVBaDBiVVhVbXhXMTE=',

View file

@ -40,31 +40,30 @@
},
"license": "MIT",
"dependencies": {
"@types/xmldom": "^0.1.34",
"@yao-pkg/pkg": "^5.12.0",
"@yao-pkg/pkg": "^5.16.1",
"binary-parser": "^2.2.1",
"binary-parser-encoder": "^1.5.3",
"bn.js": "^5.2.1",
"cors": "^2.8.5",
"elliptic": "^6.6.1",
"esbuild": "^0.21.5",
"express": "^4.19.2",
"fast-xml-parser": "^4.5.0",
"express": "^4.21.2",
"fast-xml-parser": "^4.5.3",
"ffprobe": "^1.1.2",
"fs-extra": "^11.2.0",
"fs-extra": "^11.3.0",
"got": "^11.8.6",
"iso-639": "^0.2.2",
"leven": "^3.1.0",
"log4js": "^6.9.1",
"long": "^5.2.3",
"lookpath": "^1.2.2",
"long": "^5.3.1",
"lookpath": "^1.2.3",
"m3u8-parsed": "^1.3.0",
"mpd-parser": "^1.3.0",
"mpd-parser": "^1.3.1",
"open": "^8.4.2",
"protobufjs": "^7.3.2",
"protobufjs": "^7.4.0",
"sei-helper": "^3.3.0",
"ws": "^8.17.1",
"yaml": "^2.4.5",
"ws": "^8.18.1",
"yaml": "^2.7.0",
"yargs": "^17.7.2"
},
"devDependencies": {
@ -74,18 +73,18 @@
"@types/express": "^4.17.21",
"@types/ffprobe": "^1.1.8",
"@types/fs-extra": "^11.0.4",
"@types/node": "^20.14.6",
"@types/ws": "^8.5.10",
"@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"eslint": "^8.57.0",
"@types/node": "^20.17.24",
"@types/ws": "^8.18.0",
"@types/yargs": "^17.0.33",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"eslint": "^8.57.1",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-react": "7.34.3",
"protoc": "^1.1.3",
"removeNPMAbsolutePaths": "^3.0.1",
"ts-node": "^10.9.2",
"ts-proto": "^1.180.0",
"ts-proto": "^1.181.2",
"typescript": "5.5.2",
"typescript-eslint": "7.13.1"
},

File diff suppressed because it is too large Load diff