mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-04-22 00:41:56 +00:00
removed useless old crunchy login api endpoint
This commit is contained in:
parent
aae69e6494
commit
2c50156046
2 changed files with 6 additions and 9 deletions
|
|
@ -265,7 +265,7 @@ export default class Crunchy implements ServiceClass {
|
||||||
headers: {...api.crunchyAuthHeader, Authorization: `Basic ${await this.productionToken()}`},
|
headers: {...api.crunchyAuthHeader, Authorization: `Basic ${await this.productionToken()}`},
|
||||||
body: authData
|
body: authData
|
||||||
};
|
};
|
||||||
const authReq = await this.req.getData(api.beta_auth, authReqOpts);
|
const authReq = await this.req.getData(api.auth, authReqOpts);
|
||||||
if(!authReq.ok || !authReq.res){
|
if(!authReq.ok || !authReq.res){
|
||||||
console.error('Authentication failed!');
|
console.error('Authentication failed!');
|
||||||
return { isOk: false, reason: new Error('Authentication failed') };
|
return { isOk: false, reason: new Error('Authentication failed') };
|
||||||
|
|
@ -293,7 +293,7 @@ export default class Crunchy implements ServiceClass {
|
||||||
headers: {...api.crunchyAuthHeader, Authorization: `Basic ${await this.productionToken()}`},
|
headers: {...api.crunchyAuthHeader, Authorization: `Basic ${await this.productionToken()}`},
|
||||||
body: authData
|
body: authData
|
||||||
};
|
};
|
||||||
const authReq = await this.req.getData(api.beta_auth, authReqOpts);
|
const authReq = await this.req.getData(api.auth, authReqOpts);
|
||||||
if(!authReq.ok || !authReq.res){
|
if(!authReq.ok || !authReq.res){
|
||||||
console.error('Anonymous Authentication failed!');
|
console.error('Anonymous Authentication failed!');
|
||||||
return;
|
return;
|
||||||
|
|
@ -350,7 +350,7 @@ export default class Crunchy implements ServiceClass {
|
||||||
headers: {...api.crunchyAuthHeader, Authorization: `Basic ${await this.productionToken()}`, Cookie: `etp_rt=${refreshToken}`},
|
headers: {...api.crunchyAuthHeader, Authorization: `Basic ${await this.productionToken()}`, Cookie: `etp_rt=${refreshToken}`},
|
||||||
body: authData
|
body: authData
|
||||||
};
|
};
|
||||||
const authReq = await this.req.getData(api.beta_auth, authReqOpts);
|
const authReq = await this.req.getData(api.auth, authReqOpts);
|
||||||
if(!authReq.ok || !authReq.res){
|
if(!authReq.ok || !authReq.res){
|
||||||
console.error('Token Authentication failed!');
|
console.error('Token Authentication failed!');
|
||||||
if (authReq.res?.status == 400) {
|
if (authReq.res?.status == 400) {
|
||||||
|
|
@ -393,7 +393,7 @@ export default class Crunchy implements ServiceClass {
|
||||||
headers: {...api.crunchyAuthHeader, Authorization: `Basic ${await this.productionToken()}`, Cookie: `etp_rt=${this.token.refresh_token}`},
|
headers: {...api.crunchyAuthHeader, Authorization: `Basic ${await this.productionToken()}`, Cookie: `etp_rt=${this.token.refresh_token}`},
|
||||||
body: authData
|
body: authData
|
||||||
};
|
};
|
||||||
const authReq = await this.req.getData(api.beta_auth, authReqOpts);
|
const authReq = await this.req.getData(api.auth, authReqOpts);
|
||||||
if(!authReq.ok || !authReq.res){
|
if(!authReq.ok || !authReq.res){
|
||||||
console.error('Token Refresh Failed!');
|
console.error('Token Refresh Failed!');
|
||||||
if (authReq.res?.status == 400) {
|
if (authReq.res?.status == 400) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ export type APIType = {
|
||||||
session: string
|
session: string
|
||||||
collections: string
|
collections: string
|
||||||
// beta api
|
// beta api
|
||||||
beta_auth: string
|
|
||||||
defaultUserAgent: string,
|
defaultUserAgent: string,
|
||||||
beta_profile: string
|
beta_profile: string
|
||||||
beta_cmsToken: string
|
beta_cmsToken: string
|
||||||
|
|
@ -59,14 +58,12 @@ const api: APIType = {
|
||||||
rss_gid: `${domain.www}/syndication/feed?type=episodes&group_id=`, // &lang=enUS
|
rss_gid: `${domain.www}/syndication/feed?type=episodes&group_id=`, // &lang=enUS
|
||||||
media_page: `${domain.www}/media-`,
|
media_page: `${domain.www}/media-`,
|
||||||
series_page: `${domain.www}/series-`,
|
series_page: `${domain.www}/series-`,
|
||||||
auth: `${domain.www}/login`,
|
auth: `${domain.api_beta}/auth/v1/token`,
|
||||||
// mobile api
|
// mobile api
|
||||||
search3: `${domain.api}/autocomplete.0.json`,
|
search3: `${domain.api}/autocomplete.0.json`,
|
||||||
session: `${domain.api}/start_session.0.json`,
|
session: `${domain.api}/start_session.0.json`,
|
||||||
collections: `${domain.api}/list_collections.0.json`,
|
collections: `${domain.api}/list_collections.0.json`,
|
||||||
// new api
|
// This User-Agent bypasses Cloudflare security of the newer Endpoint
|
||||||
beta_auth: `${domain.api_beta}/auth/v1/token`,
|
|
||||||
// This User-Agent bypasses Cloudflare security by the newer Endpoint
|
|
||||||
defaultUserAgent: 'Crunchyroll/4.75.0 (bundle_identifier:com.crunchyroll.iphone; build_number:4100608.433889621) iOS/18.3.2 Gravity/4.75.0',
|
defaultUserAgent: 'Crunchyroll/4.75.0 (bundle_identifier:com.crunchyroll.iphone; build_number:4100608.433889621) iOS/18.3.2 Gravity/4.75.0',
|
||||||
beta_profile: `${domain.api_beta}/accounts/v1/me/profile`,
|
beta_profile: `${domain.api_beta}/accounts/v1/me/profile`,
|
||||||
beta_cmsToken: `${domain.api_beta}/index/v2`,
|
beta_cmsToken: `${domain.api_beta}/index/v2`,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue