Fixed Teen Mega World assets loading attempt from native site instead of network site.
This commit is contained in:
@@ -12,6 +12,9 @@ function scrapeAll(scenes, channel) {
|
||||
release.url = query.url('.thumb__title-link');
|
||||
release.entryId = new URL(release.url).pathname.match(/\/trailers\/(.+).html/)?.[1].toLowerCase();
|
||||
|
||||
// channel origin doesn't always match the site we're fetching the assets from
|
||||
const { origin } = new URL(release.url);
|
||||
|
||||
release.title = query.content('.thumb__title-link');
|
||||
release.date = query.date('time', unprint.dateConstants.DATETIME_LOCAL_SECONDS, { attribute: 'datetime' }) || query.date('time', 'MMMM D, YYYY');
|
||||
|
||||
@@ -20,14 +23,14 @@ function scrapeAll(scenes, channel) {
|
||||
url: unprint.query.url(el, null),
|
||||
}));
|
||||
|
||||
release.poster = query.sourceSet('.thumb__picture img', 'srcset', { origin: channel.origin });
|
||||
release.poster = query.sourceSet('.thumb__picture img', 'srcset', { origin });
|
||||
|
||||
release.photos = Object
|
||||
.entries(query.el('.thumb__image').dataset)
|
||||
.filter(([key]) => key.includes('srcset-'))
|
||||
.map(([_key, value]) => unprint.extractSourceSet(value, { origin: channel.origin }));
|
||||
.map(([_key, value]) => unprint.extractSourceSet(value, { origin }));
|
||||
|
||||
release.teaser = query.video('.thumb__video', { origin: network.url });
|
||||
release.teaser = query.video('.thumb__video', { origin });
|
||||
|
||||
release.likes = query.number('.thumb__rating-value');
|
||||
|
||||
@@ -54,6 +57,8 @@ async function fetchLatest(channel, page = 1, { parameters }) {
|
||||
|
||||
function scrapeScene({ query }, context) {
|
||||
const release = {};
|
||||
const { origin } = new URL(context.url);
|
||||
// channel origin doesn't always match the site we're fetching the assets from
|
||||
|
||||
release.entryId = new URL(context.url).pathname.match(/\/trailers\/(.+).html/)[1].toLowerCase();
|
||||
|
||||
@@ -70,7 +75,7 @@ function scrapeScene({ query }, context) {
|
||||
|
||||
release.tags = query.contents('.video-tag-link');
|
||||
|
||||
const poster = query.sourceSet('.video-cover__image', 'srcset', { origin: context.entity.origin });
|
||||
const poster = query.sourceSet('.video-cover__image', 'srcset', { origin });
|
||||
|
||||
if (!poster?.includes('error')) {
|
||||
release.poster = poster;
|
||||
@@ -98,7 +103,9 @@ function scrapeProfile({ query }, url, entity) {
|
||||
profile.hairColor = bio.hair;
|
||||
profile.eyes = bio.eyes;
|
||||
|
||||
profile.avatar = query.img('.model-profile-image-picture source', { origin: entity.url, attribute: 'srcset' }) || query.img('.model-profile-image-picture img', { origin: entity.url });
|
||||
profile.avatar = query.img('.model-profile-image-picture source', { origin: entity.oorigin, attribute: 'srcset' })
|
||||
|| query.img('.model-profile-image-picture img', { origin: entity.origin });
|
||||
|
||||
profile.scenes = scrapeAll(unprint.initAll(query.all('.video-list .thumb')), entity);
|
||||
|
||||
return profile;
|
||||
|
||||
Reference in New Issue
Block a user