Fixed Teen Mega World posters.
This commit is contained in:
9
package-lock.json
generated
9
package-lock.json
generated
@@ -94,7 +94,7 @@
|
|||||||
"tunnel": "0.0.6",
|
"tunnel": "0.0.6",
|
||||||
"ua-parser-js": "^1.0.37",
|
"ua-parser-js": "^1.0.37",
|
||||||
"undici": "^5.28.1",
|
"undici": "^5.28.1",
|
||||||
"unprint": "^0.18.29",
|
"unprint": "^0.18.31",
|
||||||
"url-pattern": "^1.0.3",
|
"url-pattern": "^1.0.3",
|
||||||
"v-tooltip": "^2.1.3",
|
"v-tooltip": "^2.1.3",
|
||||||
"video.js": "^8.6.1",
|
"video.js": "^8.6.1",
|
||||||
@@ -20380,9 +20380,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/unprint": {
|
"node_modules/unprint": {
|
||||||
"version": "0.18.29",
|
"version": "0.18.31",
|
||||||
"resolved": "https://registry.npmjs.org/unprint/-/unprint-0.18.29.tgz",
|
"resolved": "https://registry.npmjs.org/unprint/-/unprint-0.18.31.tgz",
|
||||||
"integrity": "sha512-ZSlPLBf7kKW3X6y6ouner8loP9A0w+PEEFeR8eGdslH0P2LXML4rog0JtoJmbR2LoGqkAe0eb4Eeayolgvke4A==",
|
"integrity": "sha512-7z4kC7eyyyRUeGBGc+lByRv1WqWP1NkO5Fwh6RwOs60x6HW3mffYUxa2R02fjpUOsEaPRukZwEsikP5jOA/JAA==",
|
||||||
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bottleneck": "^2.19.5",
|
"bottleneck": "^2.19.5",
|
||||||
"cookie": "^1.1.1",
|
"cookie": "^1.1.1",
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
"tunnel": "0.0.6",
|
"tunnel": "0.0.6",
|
||||||
"ua-parser-js": "^1.0.37",
|
"ua-parser-js": "^1.0.37",
|
||||||
"undici": "^5.28.1",
|
"undici": "^5.28.1",
|
||||||
"unprint": "^0.18.29",
|
"unprint": "^0.18.31",
|
||||||
"url-pattern": "^1.0.3",
|
"url-pattern": "^1.0.3",
|
||||||
"v-tooltip": "^2.1.3",
|
"v-tooltip": "^2.1.3",
|
||||||
"video.js": "^8.6.1",
|
"video.js": "^8.6.1",
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ function scrapeAll(scenes, channel) {
|
|||||||
url: unprint.query.url(el, null),
|
url: unprint.query.url(el, null),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
release.poster = query.img('.thumb__picture img');
|
release.poster = query.sourceSet('.thumb__picture img', 'srcset', { origin: channel.origin });
|
||||||
|
|
||||||
[release.poster, ...release.photos] = Object
|
release.photos = Object
|
||||||
.entries(query.el('.thumb__image').dataset)
|
.entries(query.el('.thumb__image').dataset)
|
||||||
.filter(([key]) => /^src/.test(key))
|
.filter(([key]) => key.includes('srcset-'))
|
||||||
.map(([, value]) => [value.replace('-1x', '-2x'), value].map((path) => unprint.prefixUrl(path, network.url)));
|
.map(([_key, value]) => unprint.extractSourceSet(value, { origin: channel.origin }));
|
||||||
|
|
||||||
release.teaser = query.video('.thumb__video', { origin: network.url });
|
release.teaser = query.video('.thumb__video', { origin: network.url });
|
||||||
|
|
||||||
@@ -41,6 +41,17 @@ function scrapeAll(scenes, channel) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function fetchLatest(channel, page = 1) {
|
||||||
|
const url = `${channel.type === 'network' ? channel.url : channel.parent.url}/search.php?site[]=${channel.parameters.siteId}&page=${page}`;
|
||||||
|
const res = await unprint.get(url, { selectAll: '.video-list .thumb' });
|
||||||
|
|
||||||
|
if (res.ok) {
|
||||||
|
return scrapeAll(res.context, channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res.status;
|
||||||
|
}
|
||||||
|
|
||||||
function scrapeScene({ query }, context) {
|
function scrapeScene({ query }, context) {
|
||||||
const release = {};
|
const release = {};
|
||||||
|
|
||||||
@@ -59,9 +70,9 @@ function scrapeScene({ query }, context) {
|
|||||||
|
|
||||||
release.tags = query.contents('.video-tag-link');
|
release.tags = query.contents('.video-tag-link');
|
||||||
|
|
||||||
const poster = query.img('.video-cover__image');
|
const poster = query.sourceSet('.video-cover__image', 'srcset', { origin: context.entity.origin });
|
||||||
|
|
||||||
if (!poster.includes('error')) {
|
if (!poster?.includes('error')) {
|
||||||
release.poster = poster;
|
release.poster = poster;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,17 +104,6 @@ function scrapeProfile({ query }, url, entity) {
|
|||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchLatest(channel, page = 1) {
|
|
||||||
const url = `${channel.type === 'network' ? channel.url : channel.parent.url}/search.php?site[]=${channel.parameters.siteId}&page=${page}`;
|
|
||||||
const res = await unprint.get(url, { selectAll: '.video-list .thumb' });
|
|
||||||
|
|
||||||
if (res.ok) {
|
|
||||||
return scrapeAll(res.context, channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
return res.status;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetchProfile(actor, entity, include) {
|
async function fetchProfile(actor, entity, include) {
|
||||||
const url = actor.url || `${entity.url}/models/${slugify(actor.name)}.html`;
|
const url = actor.url || `${entity.url}/models/${slugify(actor.name)}.html`;
|
||||||
const res = await unprint.get(url);
|
const res = await unprint.get(url);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ function getAvatarFallbacks(avatar) {
|
|||||||
src: source,
|
src: source,
|
||||||
expectType: {
|
expectType: {
|
||||||
'binary/octet-stream': 'image/jpeg',
|
'binary/octet-stream': 'image/jpeg',
|
||||||
|
'application/octet-stream': 'image/jpeg',
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -42,6 +43,7 @@ function curateSources(sources, type = 'image/jpeg') {
|
|||||||
type: source.type || type,
|
type: source.type || type,
|
||||||
expectType: {
|
expectType: {
|
||||||
'binary/octet-stream': type,
|
'binary/octet-stream': type,
|
||||||
|
'application/octet-stream': type,
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
.sort((resA, resB) => (resB.width * resB.height) - (resA.width * resA.height)) // number of pixels
|
.sort((resA, resB) => (resB.width * resB.height) - (resA.width * resA.height)) // number of pixels
|
||||||
|
|||||||
Reference in New Issue
Block a user