[CR] Rename crunchy play stream flag

This commit is contained in:
AnimeDL 2024-06-20 10:38:42 -07:00
parent 1f8ddb27a1
commit 345aa0f267
4 changed files with 7 additions and 7 deletions

View file

@ -7,7 +7,7 @@ import { CrunchyPlayStreams } from './enums';
export type CrunchyDownloadOptions = {
hslang: string,
kstream: number,
cpstream: keyof typeof CrunchyPlayStreams | 'none',
cstream: keyof typeof CrunchyPlayStreams | 'none',
novids?: boolean,
noaudio?: boolean,
x: number,

View file

@ -1417,8 +1417,8 @@ export default class Crunchy implements ServiceClass {
let playStream: CrunchyPlayStream | null = null;
if (options.cpstream !== 'none') {
const playbackReq = await this.req.getData(`https://cr-play-service.prd.crunchyrollsvc.com/v1/${currentVersion ? currentVersion.guid : currentMediaId}/${CrunchyPlayStreams[options.cpstream]}/play`, AuthHeaders);
if (options.cstream !== 'none') {
const playbackReq = await this.req.getData(`https://cr-play-service.prd.crunchyrollsvc.com/v1/${currentVersion ? currentVersion.guid : currentMediaId}/${CrunchyPlayStreams[options.cstream]}/play`, AuthHeaders);
if (!playbackReq.ok || !playbackReq.res) {
console.error('Non-DRM Request Stream URLs FAILED!');
} else {
@ -1435,7 +1435,7 @@ export default class Crunchy implements ServiceClass {
url: playStream.url,
hardsub_locale: ''
};
pbData.data[0][`adaptive_${options.cpstream}_${playStream.url.includes('m3u8') ? 'hls' : 'dash'}_drm`] = {
pbData.data[0][`adaptive_${options.cstream}_${playStream.url.includes('m3u8') ? 'hls' : 'dash'}_drm`] = {
...derivedPlaystreams
};
}

View file

@ -44,7 +44,7 @@ let argvC: {
q: number;
x: number;
kstream: number;
cpstream: keyof typeof CrunchyPlayStreams | 'none';
cstream: keyof typeof CrunchyPlayStreams | 'none';
partsize: number;
hslang: string;
dlsubs: string[];

View file

@ -285,9 +285,9 @@ const args: TAppArg<boolean|number|string|unknown[]>[] = [
usage: '${stream}'
},
{
name: 'cpstream',
name: 'cstream',
group: 'dl',
alias: 'cps',
alias: 'cs',
service: ['crunchy'],
type: 'string',
describe: 'Select specific crunchy play stream by device, or disable stream with "none"',