Added Top Web Models framework.
This commit is contained in:
@@ -66,6 +66,7 @@ const sextreme = require('./21sextreme');
|
||||
const sextury = require('./21sextury');
|
||||
const teamskeet = require('./teamskeet');
|
||||
const teencoreclub = require('./teencoreclub');
|
||||
const topwebmodels = require('./topwebmodels');
|
||||
const transangels = require('./transangels');
|
||||
const traxxx = require('./traxxx');
|
||||
const twistys = require('./twistys');
|
||||
@@ -160,6 +161,7 @@ const scrapers = {
|
||||
swallowsalon: julesjordan,
|
||||
teencoreclub,
|
||||
teamskeet,
|
||||
topwebmodels,
|
||||
transbella: porndoe,
|
||||
traxxx,
|
||||
twistys,
|
||||
|
||||
@@ -40,6 +40,18 @@ function formatDate(dateValue, format, inputFormat) {
|
||||
return moment(dateValue).format(format);
|
||||
}
|
||||
|
||||
function durationToSeconds(durationString, match) {
|
||||
const durationMatch = durationString.match(match || /(\d+:)?\d+:\d+/);
|
||||
|
||||
if (durationMatch) {
|
||||
const segments = ['00'].concat(durationMatch[0].split(/[:hm]/)).slice(-3);
|
||||
|
||||
return moment.duration(segments.join(':')).asSeconds();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function prefixUrl(urlValue, origin, protocol = 'https') {
|
||||
if (!urlValue) {
|
||||
return null;
|
||||
@@ -316,12 +328,10 @@ function duration(context, selector, match, attr = 'textContent') {
|
||||
const durationString = q(context, selector, attr);
|
||||
|
||||
if (!durationString) return null;
|
||||
const durationMatch = durationString.match(match || /(\d+:)?\d+:\d+/);
|
||||
const durationMatch = durationToSeconds(durationString, match);
|
||||
|
||||
if (durationMatch) {
|
||||
const segments = ['00'].concat(durationMatch[0].split(/[:hm]/)).slice(-3);
|
||||
|
||||
return moment.duration(segments.join(':')).asSeconds();
|
||||
return durationMatch;
|
||||
}
|
||||
|
||||
const timestampMatch = durationString.match(/(\d+H)?\s*(\d+M)?\s*\d+S?/i);
|
||||
@@ -526,6 +536,7 @@ module.exports = {
|
||||
extractDate,
|
||||
extract,
|
||||
extractAll,
|
||||
durationToSeconds,
|
||||
init,
|
||||
initAll,
|
||||
formatDate,
|
||||
|
||||
Reference in New Issue
Block a user