Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for Manga Livre (2) #5941

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/web/mjs/engine/Chapter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ export default class Chapter extends EventTarget {
this.manga.connector._getPageList( this.manga, this, ( error, pages ) => {
this.pageCache = [];
if( !error ) {
if(pages.length || pages.video || pages.mirrors && pages.mirrors.length) {
if(pages?.length || pages?.video || pages?.mirrors && pages?.mirrors.length) {
// HACK: bypass 'i0.wp.com' image CDN to ensure original images are loaded directly from host
this.pageCache = Array.isArray(pages) ? pages.map(page => page.replace(/\/i\d+\.wp\.com/, '')) : pages;
this.pageCache = Array.isArray(pages) ? pages.map(page => page.legacy.replace(/\/i\d+\.wp\.com/, '')) : pages;
} else {
error = new Error(`There was no content found for '${this.title}', make sure it is accessible (login, purchase, ...)!`);
}
Expand All @@ -126,4 +126,4 @@ export default class Chapter extends EventTarget {
} );
}
}
}
}