Added New Sensations. Returning null from q's date formatter when date is invalid.

This commit is contained in:
ThePendulum 2020-02-21 03:51:57 +01:00
parent 111fc8ad00
commit 13a8221b92
28 changed files with 229 additions and 12 deletions

View File

@ -10,6 +10,8 @@ function initNetworksActions(store, _router) {
$limit:Int = 1000,
$after:Date = "1900-01-01",
$before:Date = "2100-01-01",
$afterTime:Datetime = "1900-01-01",
$beforeTime:Datetime = "2100-01-01",
$orderBy: [ReleasesOrderBy!]
$exclude: [String!]
) {
@ -70,10 +72,20 @@ function initNetworksActions(store, _router) {
{ network: { parent: { slug: { equalTo: $networkSlug } } } }
]
}
date: {
lessThan: $before,
greaterThan: $after,
}
or: [
{
date: {
lessThan: $before,
greaterThan: $after,
}
},
{
createdAt: {
lessThan: $beforeTime,
greaterThan: $afterTime,
}
}
],
releasesTags: {
none: {
tag: {
@ -93,6 +105,8 @@ function initNetworksActions(store, _router) {
limit,
after: store.getters.after,
before: store.getters.before,
afterTime: store.getters.after,
beforeTime: store.getters.before,
orderBy: store.state.ui.range === 'upcoming' ? 'DATE_ASC' : 'DATE_DESC',
exclude: store.state.ui.filter,
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -227,6 +227,12 @@ const networks = [
url: 'https://www.naughtyamerica.com',
description: 'The best porn movies daily at Naughty America! Experience the most seductive porn stars in stunning virtual reality, 4K and HD porn videos!',
},
{
slug: 'newsensations',
name: 'New Sensations',
url: 'https://www.newsensations.com',
description: 'Home to multiple award-winning studios New Sensations & Digital Sin with over 7,000 HQ porn movies! Take the free tour now!',
},
{
slug: 'nubiles',
name: 'Nubiles',

View File

@ -3074,6 +3074,121 @@ const sites = [
url: 'https://www.naughtyamerica.com/site/live-naughty-nurse',
network: 'naughtyamerica',
},
// NEW SENSATIONS
{
slug: 'hotwifexxx',
name: 'Hotwife XXX',
url: 'https://www.hotwifexxx.com',
network: 'newsensations',
parameters: {
siteId: 'hwxxx',
block: true,
},
},
{
slug: 'tabutales',
name: 'Tabu Tales',
url: 'https://www.thetabutales.com',
network: 'newsensations',
parameters: { siteId: 'tt' },
},
{
slug: 'nsfamilyxxx',
name: 'Family XXX',
url: 'https://www.familyxxx.com',
network: 'newsensations',
tags: ['family'],
parameters: {
siteId: 'famxxx',
block: true,
},
},
{
slug: 'thelesbianexperience',
name: 'The Lesbian Experience',
url: 'https://www.thelesbianexperience.com',
network: 'newsensations',
tags: ['lesbian'],
parameters: { siteId: 'tle' },
},
{
slug: 'theromanceseries',
name: 'The Romance Series',
url: 'https://www.theromanceseries.com',
network: 'newsensations',
parameters: { siteId: 'rs' },
},
{
slug: 'talesfromtheedge',
name: 'Tales From The Edge',
url: 'thetalesfromtheedge',
network: 'newsensations',
parameters: { siteId: 'ttfte' },
},
{
slug: 'parodypass',
name: 'Parody Pass',
url: 'https://www.parodypass.com',
network: 'newsensations',
parameters: { siteId: 'pp' },
},
{
slug: 'shanedieselsbangingbabes',
name: 'Shane Diesel\'s Banging Babes',
url: 'http://shanedieselsbangingbabes.com',
network: 'newsensations',
parameters: { siteId: 'sdbb' },
},
{
slug: 'unlimitedmilfs',
name: 'Unlimited MILFs',
url: 'https://www.unlimitedmilfs.com',
network: 'newsensations',
tags: ['milf'],
parameters: { siteId: 'um' },
},
{
slug: 'heavyhandfuls',
name: 'Heavy Handfuls',
url: 'https://www.heavyhandfuls.com',
network: 'newsensations',
parameters: { siteId: 'hh' },
},
{
slug: 'jizzbomb',
name: 'Jizz Bomb',
url: 'https://www.jizzbomb.com',
network: 'newsensations',
parameters: { siteId: 'jb' },
},
{
slug: 'stretchedoutsnatch',
name: 'Stretched Out Snatch',
url: 'https://www.stretchedoutsnatch.com',
network: 'newsensations',
parameters: { siteId: 'sos' },
},
{
slug: 'fourfingerclub',
name: 'Four Finger Club',
url: 'https://www.fourfingerclub.com',
network: 'newsensations',
parameters: { siteId: 'ffc' },
},
{
slug: 'ashlynnbrooke',
name: 'Ashlynn Brooke',
url: 'https://www.ashlynnbrooke.com',
network: 'newsensations',
parameters: { siteId: 'ab' },
},
{
slug: 'freshouttahighschool',
name: 'Fresh Outta High School',
url: 'https://www.freshouttahighschool.com',
network: 'newsensations',
parameters: { siteId: 'fohs' },
},
// NUBILES
{
slug: 'anilos',

View File

@ -73,9 +73,7 @@ async function getEntropy(buffer) {
}
async function extractItem(source) {
const res = await bhttp.get(source.src, {
responseTimeout: 10000,
});
const res = await bhttp.get(source.src);
if (res.statusCode === 200) {
const { q } = ex(res.body.toString());
@ -116,9 +114,7 @@ async function fetchItem(source, index, existingItemsBySource, domain, role, att
logger.verbose(`Fetching media item from ${source.src || source}`);
const res = await bhttp.get(source.src || source, {
responseTimeout: 10000,
});
const res = await bhttp.get(source.src || source);
if (res.statusCode === 200) {
const { pathname } = new URL(source.src || source);

View File

@ -0,0 +1,78 @@
'use strict';
const { geta, edate } = require('../utils/q');
function scrapeBlockLatest(scenes) {
return scenes.map(({ html, q, qa, qu, qt }) => {
const release = {};
const entryId = q('div[class*="videothumb"]', 'class').match(/videothumb_(\d+)/)
|| q('div[id*="videothumb"]', 'id').match(/videothumb_(\d+)/);
release.entryId = entryId[1];
release.title = q('h4 a', true);
release.url = qu('h4 a');
release.date = edate(html, 'MM/DD/YYYY', /\d{2}\/\d{2}\/\d{4}/);
release.actors = qa('.tour_update_models a', true);
release.poster = q('div img').dataset.src;
release.photos = [q('div img', 'src0_4x') || q('div img', 'src0_3x') || q('div img', 'src0_2x')];
release.teaser = qt();
console.log(release);
return release;
});
}
function scrapeClassicLatest(scenes) {
return scenes.map(({ el, q, qa, qd, qu }) => {
const release = {};
release.entryId = el.dataset.setid;
release.url = qu('a');
release.title = q('.update_title_small', true) || q('a:nth-child(2)', true);
const description = q('a', 'title');
if (description) release.description = description;
const date = qd('.date_small, .update_date', 'MM/DD/YYYY');
if (date) release.date = date;
const durationLine = q('.update_counts', true);
if (durationLine) release.duration = Number(durationLine.match(/(\d+) min/i)[1]) * 60;
const actors = qa('.update_models a', true);
release.actors = actors.length > 0 ? actors : q('.update_models', true).split(/,\s*/);
const photoCount = q('.update_thumb', 'cnt');
[release.poster, ...release.photos] = Array.from({ length: photoCount }).map((value, index) => q('.update_thumb', `src${index}_3x`) || q('.update_thumb', `src${index}_2x`) || q('.update_thumb', `src${index}_1x`));
console.log(release);
return release;
});
}
async function fetchLatest(site, page = 1) {
if (!site.parameters) {
return null;
}
const url = `${site.url}/tour_${site.parameters.siteId}/categories/movies_${page}_d.html`;
const qLatest = await geta(url, '.updatesBlock .movieBlock, .updatesBlock .videoBlock, .latest_updates_block .update_details, .category_listing_block .update_details');
if (qLatest && site.parameters.block) {
return scrapeBlockLatest(qLatest, site);
}
return qLatest && scrapeClassicLatest(qLatest, site);
}
module.exports = {
fetchLatest,
};

View File

@ -36,6 +36,7 @@ const mindgeek = require('./mindgeek');
const mofos = require('./mofos');
const naturals = require('./21naturals');
const naughtyamerica = require('./naughtyamerica');
const newsensations = require('./newsensations');
const nubiles = require('./nubiles');
const perfectgonzo = require('./perfectgonzo');
const pervcity = require('./pervcity');
@ -93,6 +94,7 @@ module.exports = {
mindgeek,
mofos,
naughtyamerica,
newsensations,
nubiles,
perfectgonzo,
pervcity,

View File

@ -12,11 +12,17 @@ function extractDate(dateString, format, match) {
if (match) {
const dateStamp = trim(dateString).match(match);
if (dateStamp) return moment.utc(dateStamp[0], format).toDate();
if (dateStamp) {
const date = moment.utc(dateStamp[0], format);
return date.isValid() ? date.toDate() : null;
}
return null;
}
return moment.utc(trim(dateString), format).toDate();
const date = moment.utc(trim(dateString), format);
return date.isValid() ? date.toDate() : null;
}
function formatDate(date, format, inputFormat) {