Skip to content

Commit

Permalink
FIX : Piccoma: change urls (#6004)
Browse files Browse the repository at this point in the history
Fixes #6003
  • Loading branch information
MikeZeDev authored Jul 31, 2023
1 parent c31ac33 commit 458f46c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/web/mjs/connectors/Piccoma.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ export default class Piccoma extends Connector {
super.id = 'piccoma';
super.label = 'Piccoma';
this.tags = ['manga', 'webtoon', 'japanese'];
this.url = 'https://piccoma.com';
this.url = 'https://jp.piccoma.com/';
}

canHandleURI(uri) {
return /https?:\/\/jp\.piccoma\.com/.test(uri);
}

async _getMangaFromURI(uri) {
Expand Down
12 changes: 10 additions & 2 deletions src/web/mjs/connectors/PiccomaFR.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ export default class PiccomaFR extends Piccoma {
super.id = 'piccoma-fr';
super.label = 'Piccoma (French)';
this.tags = ['manga', 'webtoon', 'french'];
this.url = 'https://fr.piccoma.com';
this.requestOptions.headers.set('x-referer', 'https://fr.piccoma.com/fr');
this.url = 'https://piccoma.com/fr';
this.requestOptions.headers.set('x-referer', 'https://piccoma.com/fr');
}

canHandleURI(uri) {
return /https?:\/\/piccoma\.com\/fr/.test(uri);
}

async _getMangaFromURI(uri) {
Expand Down Expand Up @@ -43,6 +47,10 @@ export default class PiccomaFR extends Piccoma {

async _getPages(chapter) {
const result = await this._fetchChapterNextData(chapter);
if (!result.pageProps.initialState) {
throw new Error(`The chapter '${chapter.title}' is neither public, nor purchased!`);
}

const pdata = result.pageProps.initialState.viewer.pData;
const images = pdata.img;
if (images == null) {
Expand Down

0 comments on commit 458f46c

Please sign in to comment.