diff --git "a/\\" "b/\\" new file mode 100644 index 00000000..f54fd46b --- /dev/null +++ "b/\\" @@ -0,0 +1,68 @@ +'use strict'; + +const qu = require('../utils/qu'); +const http = require('../utils/http'); +const slugify = require('../utils/slugify'); + +function scrapeAll(scenes) { + return scenes.map((scene) => { + const release = {}; + + release.entryId = scene.id; + release.url = `https://tour.topwebmodels.com/scenes/${scene.id}/${slugify(scene.title)}`; + + release.title = scene.title; + release.description = scene.description; + + release.duration = qu.durationToSeconds(scene.videos_duration); + release.date = new Date(scene.release_date); + + release.actors = scene.models.map(actor => ({ + name: actor.name, + gender: actor.gender || null, + avatar: actor.thumb, + url: `https://tour.topwebmodels.com/models/${actor.id}/${slugify(actor.name)}`, + })); + + release.stars = scene.rating; + release.tags = scene.tags.map(tag => tag.name); + + release.poster = scene.thumb; + + release.channel = slugify(scene.sites[0]?.name, ''); + + console.log(scene); + console.log(release); + return release; + }); +} + +async function fetchLatest(channel, page) { + console.log(channel); + const res = await http.get(`https://tour.topwebmodels.com/api/sites/${channel.parameters?.slug || channel.slug}?page=${page}`, { + headers: { + Referer: 'https://tour.topwebmodels.com', + 'api-key': channel.parameters?.apiKey || channel.parent?.parameters?.apiKey, + 'x-Requested-With': 'XMLHttpRequest', + }, + }); + + console.log(res.body, res.request); + + if (res.ok) { + return scrapeAll(res.body.videos.items); + } + + return res.status; +} + +async function fetchScene(url) { + const res = await http.get(url, { extract: { runScripts: 'dangerously', } }); + + console.log(res.); +} + +module.exports = { + fetchLatest, + fetchScene, +}; diff --git a/assets/components/expand/expand.vue b/assets/components/expand/expand.vue index b5d088c3..da70fafc 100644 --- a/assets/components/expand/expand.vue +++ b/assets/components/expand/expand.vue @@ -49,14 +49,14 @@ export default { .expand-dark { .icon { - fill: var(--lighten); + fill: var(--darken-weak); } &:hover { - background: var(--lighten-hint); + background: var(--darken-hint); .icon { - fill: var(--text-light); + fill: var(--darken); } } } diff --git a/assets/components/releases/media.vue b/assets/components/releases/media.vue index 4985fd32..83f08324 100644 --- a/assets/components/releases/media.vue +++ b/assets/components/releases/media.vue @@ -115,7 +115,7 @@ function photos() { const uniqueClipPosters = Array.from(new Set(clips.map(clip => clip.poster.id) || [])).map(posterId => clipPostersById[posterId]); const photosWithClipPosters = (this.release.photos || []).concat(uniqueClipPosters); - if (this.release.trailer || this.release.teaser) { + if (this.release.trailer || (this.release.teaser && this.release.teaser.mime !== 'image/gif')) { // poster will be on trailer video return photosWithClipPosters; } diff --git a/assets/components/scroll/scroll.vue b/assets/components/scroll/scroll.vue index 91a6e583..95667f1e 100644 --- a/assets/components/scroll/scroll.vue +++ b/assets/components/scroll/scroll.vue @@ -1,5 +1,12 @@