Updatead AnalVids studios.

This commit is contained in:
DebaucheryLibrarian 2023-03-19 17:31:47 +01:00
parent b3a77a7f7e
commit a7d094f0b6
26 changed files with 10772 additions and 4031 deletions

File diff suppressed because it is too large Load Diff

BIN
public/img/icons/penis.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -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;
} }

View File

@ -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 }));
} }

View File

@ -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);
} }