Handling missing trailers in Kink scraper.

This commit is contained in:
DebaucheryLibrarian 2020-09-18 23:25:15 +02:00
parent d194d7107d
commit c94e1aaea9
1 changed files with 20 additions and 18 deletions

View File

@ -50,24 +50,26 @@ async function scrapeScene({ query }, url) {
const trailer = query.q('.player span[data-type="trailer-src"]', 'data-url');
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,
},
];
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 = query.url('.shoot-logo a').split('/').slice(-1)[0];