Skip to content

Commit

Permalink
[ADN] Migrate from .fr to .com
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimeDL committed Jul 27, 2024
1 parent 5cbead0 commit be194e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions adn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default class AnimationDigitalNetwork implements ServiceClass {
public async doSearch(data: SearchData): Promise<SearchResponse> {
const limit = 12;
const offset = data.page ? data.page * limit : 0;
const searchReq = await this.req.getData(`https://gw.api.animationdigitalnetwork.fr/show/catalog?maxAgeCategory=18&offset=${offset}&limit=${limit}&search=${encodeURIComponent(data.search)}`, {
const searchReq = await this.req.getData(`https://gw.api.animationdigitalnetwork.com/show/catalog?maxAgeCategory=18&offset=${offset}&limit=${limit}&search=${encodeURIComponent(data.search)}`, {
'headers': {
'X-Target-Distribution': this.locale
}
Expand Down Expand Up @@ -198,7 +198,7 @@ export default class AnimationDigitalNetwork implements ServiceClass {
method: 'POST',
body: authData
};
const authReq = await this.req.getData('https://gw.api.animationdigitalnetwork.fr/authentication/login', authReqOpts);
const authReq = await this.req.getData('https://gw.api.animationdigitalnetwork.com/authentication/login', authReqOpts);
if(!authReq.ok || !authReq.res){
console.error('Authentication failed!');
return { isOk: false, reason: new Error('Authentication failed') };
Expand All @@ -212,7 +212,7 @@ export default class AnimationDigitalNetwork implements ServiceClass {
}

public async refreshToken() {
const authReq = await this.req.getData('https://gw.api.animationdigitalnetwork.fr/authentication/refresh', {
const authReq = await this.req.getData('https://gw.api.animationdigitalnetwork.com/authentication/refresh', {
method: 'POST',
headers: {
Authorization: `Bearer ${this.token.accessToken}`,
Expand All @@ -234,7 +234,7 @@ export default class AnimationDigitalNetwork implements ServiceClass {
}

public async getShow(id: number) {
const getShowData = await this.req.getData(`https://gw.api.animationdigitalnetwork.fr/video/show/${id}?maxAgeCategory=18&limit=-1&order=asc`, {
const getShowData = await this.req.getData(`https://gw.api.animationdigitalnetwork.com/video/show/${id}?maxAgeCategory=18&limit=-1&order=asc`, {
'headers': {
'X-Target-Distribution': this.locale
}
Expand Down Expand Up @@ -461,7 +461,7 @@ export default class AnimationDigitalNetwork implements ServiceClass {
return undefined;
}

const configReq = await this.req.getData(`https://gw.api.animationdigitalnetwork.fr/player/video/${data.id}/configuration`, {
const configReq = await this.req.getData(`https://gw.api.animationdigitalnetwork.com/player/video/${data.id}/configuration`, {
headers: {
Authorization: `Bearer ${this.token.accessToken}`
}
Expand All @@ -475,7 +475,7 @@ export default class AnimationDigitalNetwork implements ServiceClass {
console.error('You don\'t have access to this video!');
return undefined;
}
const tokenReq = await this.req.getData(configuration.player.options.user.refreshTokenUrl || 'https://gw.api.animationdigitalnetwork.fr/player/refresh/token', {
const tokenReq = await this.req.getData(configuration.player.options.user.refreshTokenUrl || 'https://gw.api.animationdigitalnetwork.com/player/refresh/token', {
method: 'POST',
headers: {
'X-Player-Refresh-Token': `${configuration.player.options.user.refreshToken}`
Expand All @@ -491,7 +491,7 @@ export default class AnimationDigitalNetwork implements ServiceClass {
token: string
};

const linksUrl = configuration.player.options.video.url || `https://gw.api.animationdigitalnetwork.fr/player/video/${data.id}/link`;
const linksUrl = configuration.player.options.video.url || `https://gw.api.animationdigitalnetwork.com/player/video/${data.id}/link`;
const key = this.generateRandomString(16);
const decryptionKey = key + '7fac1178830cfe0c';

Expand Down

0 comments on commit be194e8

Please sign in to comment.