fix(route): E站页面匹配规则已更新 (#11225)

This commit is contained in:
Howard Yin 2022-11-07 20:43:08 +08:00 committed by GitHub
parent 1238376e74
commit 5890fc8007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 8 deletions

View File

@ -50,15 +50,27 @@ async function parsePage(cache, data, get_bittorrent = false, embed_thumb = fals
// "l" for Compact
// "e" for Extended
// "t" for Thumbnail
const layout = $('div#dms option[selected]').attr('value');
let layout = 't';
let galleries;
if (layout !== 't') {
galleries = $('table[class^="itg glt"] tbody');
} else {
// Thumbnail layout has different page structure
// resolve it here
galleries = $('div[class^="itg gld"]');
// "itg gld" for Thumbnail
let galleries = $('div[class^="itg gld"]');
// "itg gltm" for Minimal or Minimal+
if (galleries.length <= 0) {
galleries = $('table[class^="itg gltm"] tbody');
layout = 'm';
}
// "itg gltc" for Compact
if (galleries.length <= 0) {
galleries = $('table[class^="itg gltc"] tbody');
layout = 'l';
}
// "itg glte" for Extended
if (galleries.length <= 0) {
galleries = $('table[class^="itg glte"] tbody');
layout = 'e';
}
if (galleries.length <= 0) {
return [];
}
async function parseElement(cache, element) {