[CR] Fix issue with too many streams when novids and noaudio
Fixes issue where you would have too many active streams if using no videos and no audio downloading
This commit is contained in:
parent
c14a963024
commit
8d59666a6c
1 changed files with 8 additions and 0 deletions
|
|
@ -1584,6 +1584,14 @@ export default class Crunchy implements ServiceClass {
|
|||
|
||||
let tsFile = undefined;
|
||||
|
||||
// Delete the stream if it's not needed
|
||||
if (options.novids && options.noaudio) {
|
||||
if (playStream) {
|
||||
await this.refreshToken(true, true);
|
||||
await this.req.getData(`https://cr-play-service.prd.crunchyrollsvc.com/v1/token/${currentVersion ? currentVersion.guid : currentMediaId}/${playStream.token}`, {...{method: 'DELETE'}, ...AuthHeaders});
|
||||
}
|
||||
}
|
||||
|
||||
if(!dlFailed && curStream !== undefined && !(options.novids && options.noaudio)){
|
||||
const streamPlaylistsReq = await this.req.getData(curStream.url, AuthHeaders);
|
||||
if(!streamPlaylistsReq.ok || !streamPlaylistsReq.res){
|
||||
|
|
|
|||
Loading…
Reference in a new issue