Skip to content

Commit

Permalink
[CR] Rename crunchy play stream flag
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimeDL committed Jun 20, 2024
1 parent 1f8ddb2 commit 345aa0f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion @types/crunchyTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions crunchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
};
}
Expand Down
2 changes: 1 addition & 1 deletion modules/module.app-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
4 changes: 2 additions & 2 deletions modules/module.args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"',
Expand Down

0 comments on commit 345aa0f

Please sign in to comment.