forked from DebaucheryLibrarian/traxxx
Added Teen Mega World scraper.
This commit is contained in:
@@ -275,10 +275,15 @@ function images(context, selector = 'img', attr, { origin, protocol = 'https' }
|
||||
return imageEls.map(imageEl => prefixUrl(imageEl, origin, protocol));
|
||||
}
|
||||
|
||||
function url(context, selector = 'a', attr = 'href', { origin, protocol = 'https' } = {}) {
|
||||
function url(context, selector = 'a', attr = 'href', { origin, protocol = 'https', object = false } = {}) {
|
||||
const urlEl = q(context, selector, attr);
|
||||
const prefixedUrl = prefixUrl(urlEl, origin, protocol);
|
||||
|
||||
return prefixUrl(urlEl, origin, protocol);
|
||||
if (prefixedUrl && object) {
|
||||
return new URL(prefixedUrl);
|
||||
}
|
||||
|
||||
return prefixedUrl;
|
||||
}
|
||||
|
||||
function urls(context, selector = 'a', attr = 'href', { origin, protocol = 'https' } = {}) {
|
||||
@@ -349,7 +354,10 @@ function videos(context, selector = 'source', attr = 'src', { origin, protocol =
|
||||
function duration(context, selector, match, attr = 'textContent') {
|
||||
const durationString = q(context, selector, attr);
|
||||
|
||||
if (!durationString) return null;
|
||||
if (!durationString) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const durationMatch = durationToSeconds(durationString, match);
|
||||
|
||||
if (durationMatch) {
|
||||
|
||||
Reference in New Issue
Block a user