Added Teen Mega World scraper.

This commit is contained in:
DebaucheryLibrarian
2021-09-17 03:30:49 +02:00
parent ae40f33283
commit 522584711b
160 changed files with 517 additions and 5 deletions

View File

@@ -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) {