diff --git a/src/web/mjs/connectors/YoungJump.mjs b/src/web/mjs/connectors/YoungJump.mjs index c2878775d4..9570df58f0 100644 --- a/src/web/mjs/connectors/YoungJump.mjs +++ b/src/web/mjs/connectors/YoungJump.mjs @@ -14,34 +14,18 @@ export default class YoungJump extends SpeedBinb { } async _getMangas() { - return [ - { - id: 'free_uj/', - title: 'ウルトラジャンプ - ultra jump' - }, - { - id: 'free_yj/', - title: 'ヤングジャンプ - young jump' - } - ]; + const request = new Request(`${this.url}/yj-rest-apis/getBookInfo.php`, this.requestOptions); + const data = await this.fetchJSON(request); + return data.map(magazine => { + return { + id: magazine.url, + title : `${magazine.issue} - ${magazine.number}` + }; + }); + } async _getChapters(manga) { - const request = new Request(new URL(manga.id, this.url), this.requestOptions); - const data = await this.fetchDOM(request); - - let chapters = []; - for (const year of data.querySelectorAll('section.sp-w')) { - const mangas = [...year.querySelectorAll('a.p-my__list-link')]; - chapters.push(...mangas.map(element => { - return { - id: this.getAbsolutePath(element.href, this.url), - title: year.querySelector('h3').innerText.trim() +' - ' + element.querySelector('h4').innerText.trim() - }; - })); - } - - return chapters; + return [{id: manga.id, title : manga.title}]; } - }