From a339c096efa78b1f8a53a95095d1f16f413fe1f8 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sun, 2 Jul 2023 01:04:39 +0200 Subject: [PATCH] Fixed Kink trailer query. --- src/scrapers/kink.js | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/src/scrapers/kink.js b/src/scrapers/kink.js index 9f8f51a1..598ca800 100755 --- a/src/scrapers/kink.js +++ b/src/scrapers/kink.js @@ -35,6 +35,8 @@ function scrapeAll(scenes, entity) { photo, ]); + release.trailer = `https://cdnp.kink.com/imagedb/${release.entryId}/trailer/${release.entryId}_trailer_high.mp4`; + release.duration = query.dur('.video span'); return release; @@ -61,32 +63,10 @@ function scrapeScene({ query }, url, entity) { release.photos = query.imgs('.gallery .thumb img, #gallerySlider .gallery-img', { attribute: 'data-image-file' }); release.poster = query.poster(); + release.trailer = query.dataset('.player span[data-type="trailer-src"]', 'url') || `https://cdnp.kink.com/imagedb/${release.entryId}/trailer/${release.entryId}_trailer_high.mp4`; release.tags = query.contents('.tag-list a[href*="/tag"]').map((tag) => tag.replace(/,\s*/, '')); - const trailer = query.attribute('.player span[data-type="trailer-src"]', { attribute: 'data-url' }); - - if (trailer) { - release.trailer = [ - { - src: trailer.replace('480p', '1080p'), - quality: 1080, - }, - { - src: trailer.replace('480p', '720p'), - quality: 720, - }, - { - src: trailer, - quality: 480, - }, - { - src: trailer.replace('480p', '360p'), - quality: 360, - }, - ]; - } - release.channel = slugify(query.url('.shoot-logo a')?.split('/').slice(-1)[0], ''); return release;