Updatead AnalVids studios.
14771
analvids-studios.json
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 6.8 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 2.3 MiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 8.5 KiB |
|
@ -87,17 +87,17 @@ async function scrapeScene({ query }, { url, entity }) {
|
||||||
release.title = data?.name || query.content('.video-heading');
|
release.title = data?.name || query.content('.video-heading');
|
||||||
release.description = data?.description || query.content('.expanded p.clear-both');
|
release.description = data?.description || query.content('.expanded p.clear-both');
|
||||||
|
|
||||||
release.date = unprint.extractDate(data?.datePublished, 'YYYY-MM-DD');
|
release.date = unprint.extractDate(data?.datePublished, 'YYYY-MM-DD') || query.date('//p[contains(text(), "Date:")]', 'MMM DD, YYYY');
|
||||||
release.duration = unprint.extractTimestamp(data?.duration) || query.duration('//p[contains(text(), "Playtime:")]//span');
|
release.duration = unprint.extractTimestamp(data?.duration) || query.duration('//p[contains(text(), "Playtime:")]//span');
|
||||||
|
|
||||||
if (data) {
|
if (data?.actors) {
|
||||||
release.actors = data.actor.map((actor) => ({
|
release.actors = data.actor.map((actor) => ({
|
||||||
name: actor.name,
|
name: actor.name,
|
||||||
url: actor.url,
|
url: actor.url,
|
||||||
avatar: getAvatarFallback(query.img(`.video-actors img[alt="${actor.name}"]`)),
|
avatar: getAvatarFallback(query.img(`.video-actors img[alt="${actor.name}"]`)),
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
release.actors = query.elements('//div[contains(@class, "video-actors")]//a[img]').map((element) => ({
|
release.actors = query.elements('//div[contains(@class, "video-actors")]//a[img|picture]').map((element) => ({
|
||||||
name: unprint.query.attribute(element, 'img', 'alt'),
|
name: unprint.query.attribute(element, 'img', 'alt'),
|
||||||
url: unprint.query.url(element, null, { origin: entity.url }),
|
url: unprint.query.url(element, null, { origin: entity.url }),
|
||||||
avatar: getAvatarFallback(unprint.query.img(element, 'img')),
|
avatar: getAvatarFallback(unprint.query.img(element, 'img')),
|
||||||
|
@ -107,7 +107,7 @@ async function scrapeScene({ query }, { url, entity }) {
|
||||||
release.tags = query.contents('.expanded .genres');
|
release.tags = query.contents('.expanded .genres');
|
||||||
|
|
||||||
release.poster = data?.thumbnailUrl || data?.contentUrl || query.attribute('meta[name*="og:image"]', 'content');
|
release.poster = data?.thumbnailUrl || data?.contentUrl || query.attribute('meta[name*="og:image"]', 'content');
|
||||||
release.teaser = query.video('video[data-modal-target="videoImage"] source');
|
release.teaser = query.video('video[data-videocontainer-target] source');
|
||||||
|
|
||||||
release.photos = JSON.parse(query.attribute('[data-video-gallery-photos-value]', 'data-video-gallery-photos-value'));
|
release.photos = JSON.parse(query.attribute('[data-video-gallery-photos-value]', 'data-video-gallery-photos-value'));
|
||||||
release.photoCount = query.number('[data-video-gallery-count-value]', { attribute: 'data-video-gallery-count-value' });
|
release.photoCount = query.number('[data-video-gallery-count-value]', { attribute: 'data-video-gallery-count-value' });
|
||||||
|
@ -118,6 +118,8 @@ async function scrapeScene({ query }, { url, entity }) {
|
||||||
release.channel = entity.children?.find((channel) => new RegExp(channel.name, 'i').test(channelName) || slugify(channelName) === channel.slug)?.slug;
|
release.channel = entity.children?.find((channel) => new RegExp(channel.name, 'i').test(channelName) || slugify(channelName) === channel.slug)?.slug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(release);
|
||||||
|
|
||||||
return release;
|
return release;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -458,6 +458,8 @@ async function scrapeReleaseApi(data, site, options, movieScenes) {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
release.teaser = `https://videothumb.gammacdn.com/500x281/${release.entryId}.mp4`;
|
||||||
|
|
||||||
if (data.trailers) {
|
if (data.trailers) {
|
||||||
release.trailer = Object.entries(data.trailers).map(([quality, source]) => ({ src: source, quality }));
|
release.trailer = Object.entries(data.trailers).map(([quality, source]) => ({ src: source, quality }));
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,10 @@ const bhttp = require('bhttp');
|
||||||
const slugify = require('../utils/slugify');
|
const slugify = require('../utils/slugify');
|
||||||
const { studios: oldStudios } = require('../../seeds/03_studios');
|
const { studios: oldStudios } = require('../../seeds/03_studios');
|
||||||
|
|
||||||
|
const slugMap = {
|
||||||
|
thay_ksada: 'thayksada2',
|
||||||
|
};
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
const res = await bhttp.get('https://pornbox.com/studio/list');
|
const res = await bhttp.get('https://pornbox.com/studio/list');
|
||||||
|
|
||||||
|
@ -21,6 +25,7 @@ async function init() {
|
||||||
const newStudio = {
|
const newStudio = {
|
||||||
name: studio.name,
|
name: studio.name,
|
||||||
slug,
|
slug,
|
||||||
|
originalSlug: slugify(studio.alias, ''),
|
||||||
url: `https://www.analvids.com/studios/${studio.alias}`,
|
url: `https://www.analvids.com/studios/${studio.alias}`,
|
||||||
parent: 'analvids',
|
parent: 'analvids',
|
||||||
};
|
};
|
||||||
|
@ -55,14 +60,21 @@ async function init() {
|
||||||
await fs.writeFile('./analvids-studios.json', JSON.stringify(newStudios, null, 4));
|
await fs.writeFile('./analvids-studios.json', JSON.stringify(newStudios, null, 4));
|
||||||
|
|
||||||
newStudios.reduce((acc, studio) => {
|
newStudios.reduce((acc, studio) => {
|
||||||
if (acc.has(studio.slug)) {
|
const existingStudio = acc.get(studio.slug);
|
||||||
console.log('slug already exists!', studio, studio.slug);
|
|
||||||
|
if (existingStudio) {
|
||||||
|
if (!acc.has(studio.originalSlug)) {
|
||||||
|
console.log('REWRITE', studio.slug, studio.originalSlug);
|
||||||
|
studio.slug = studio.originalSlug; // eslint-disable-line
|
||||||
}
|
}
|
||||||
|
|
||||||
acc.add(studio.slug);
|
console.log('slug already exists!', existingStudio, studio, studio.originalSlug, studio.slug);
|
||||||
|
}
|
||||||
|
|
||||||
|
acc.set(studio.slug, studio);
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
}, new Set());
|
}, new Map());
|
||||||
|
|
||||||
// console.log(newStudios);
|
// console.log(newStudios);
|
||||||
}
|
}
|
||||||
|
|