Compare commits

..

1 commit

Author SHA1 Message Date
KasumiDev
cfecc59225
Add check for (NC) in parseSelect 2024-07-11 12:19:45 +02:00
7 changed files with 22 additions and 12 deletions

View file

@ -27,6 +27,6 @@ jobs:
github-token: ${{ github.token }}
push: ${{ github.ref == 'refs/heads/master' }}
tags: |
"multidl/multi-downloader-nx:latest"
"izuco/multi-downloader-nx:latest"
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker_build.outputs.digest }}

View file

@ -61,6 +61,6 @@ jobs:
github-token: ${{ github.token }}
push: true
tags: |
"multidl/multi-downloader-nx:${{ github.event.release.tag_name }}"
"izuco/multi-downloader-nx:${{ github.event.release.tag_name }}"
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

14
adn.ts
View file

@ -204,6 +204,8 @@ export default class AnimationDigitalNetwork implements ServiceClass {
return { isOk: false, reason: new Error('Authentication failed') };
}
this.token = await authReq.res.json();
const cookies = this.parseCookies(authReq.res.headers.get('Set-Cookie'));
this.token.refreshToken = cookies.adnrt;
yamlCfg.saveADNToken(this.token);
console.info('Authentication Success');
return { isOk: true, value: undefined };
@ -214,16 +216,19 @@ export default class AnimationDigitalNetwork implements ServiceClass {
method: 'POST',
headers: {
Authorization: `Bearer ${this.token.accessToken}`,
'X-Access-Token': this.token.accessToken,
'content-type': 'application/json'
'Cookie': `adnrt=${this.token.refreshToken}`,
'X-Access-Token': this.token.accessToken
},
body: JSON.stringify({refreshToken: this.token.refreshToken})
body: '{}'
});
if(!authReq.ok || !authReq.res){
console.error('Token refresh failed!');
return { isOk: false, reason: new Error('Token refresh failed') };
}
this.token = await authReq.res.json();
const cookies = this.parseCookies(authReq.res.headers.get('Set-Cookie'));
//this.token.refreshtoken = this.token.refreshToken;
this.token.refreshToken = cookies.adnrt;
yamlCfg.saveADNToken(this.token);
return { isOk: true, value: undefined };
}
@ -458,8 +463,7 @@ export default class AnimationDigitalNetwork implements ServiceClass {
const configReq = await this.req.getData(`https://gw.api.animationdigitalnetwork.fr/player/video/${data.id}/configuration`, {
headers: {
Authorization: `Bearer ${this.token.accessToken}`,
'X-Target-Distribution': this.locale
Authorization: `Bearer ${this.token.accessToken}`
}
});
if(!configReq.ok || !configReq.res){

View file

@ -1,4 +1,4 @@
# multi-downloader-nx (5.1.5v)
# multi-downloader-nx (5.1.4v)
If you find any bugs in this documentation or in the program itself please report it [over on GitHub](https://github.com/anidl/multi-downloader-nx/issues).

View file

@ -67,7 +67,7 @@ export class Req {
}
// debug
if(this.debug){
console.debug('[DEBUG] FETCH OPTIONS:');
console.debug('[DEBUG] GOT OPTIONS:');
console.debug(options);
}
// try do request

View file

@ -57,6 +57,9 @@ const parseSelect = (selectString: string, but = false) : {
} else if (part.match(/[A-Z]{3}\.[0-9]*/)) {
select.push(part);
return;
} else if (part.match(/E?\d+\s\(NC\)/)) {
select.push(part);
return;
}
const match = part.match(/[A-Za-z]+/);
if (match && match.length > 0) {
@ -87,6 +90,9 @@ const parseSelect = (selectString: string, but = false) : {
if (st.match(/[0-9A-Z]{9}/)) {
const included = select.includes(st);
return but ? !included : included;
} else if (st.match(/E?\d+\s\(NC\)/)) {
const included = select.includes(st);
return but ? !included : included;
} else if (match && match.length > 0) {
if (match.index && match.index !== 0) {
return false;
@ -107,4 +113,4 @@ const parseSelect = (selectString: string, but = false) : {
};
};
export default parseSelect;
export default parseSelect;

View file

@ -1,7 +1,7 @@
{
"name": "multi-downloader-nx",
"short_name": "aniDL",
"version": "5.1.5",
"version": "5.1.4",
"description": "Downloader for Crunchyroll, Hidive, AnimeOnegai, and AnimationDigitalNetwork with CLI and GUI",
"keywords": [
"download",