forked from DebaucheryLibrarian/traxxx
Fixed Nubiles base poster query, handling trailing commas in qu source set. Added profile scene scraper to Dogfart. Added tag photo.
This commit is contained in:
@@ -253,7 +253,7 @@ function urls(context, selector = 'a', attr = 'href', { origin, protocol = 'http
|
||||
return attr ? urlEls.map(urlEl => prefixUrl(urlEl, origin, protocol)) : urlEls;
|
||||
}
|
||||
|
||||
function sourceSet(context, selector, attr, options = {}) {
|
||||
function sourceSet(context, selector, attr = 'srcset', options = {}) {
|
||||
const srcset = q(context, selector, attr);
|
||||
|
||||
if (!srcset) {
|
||||
@@ -265,11 +265,16 @@ function sourceSet(context, selector, attr, options = {}) {
|
||||
.map((source) => {
|
||||
const [link, descriptor] = source.split(' ');
|
||||
|
||||
return {
|
||||
descriptor: descriptor || 'fallback',
|
||||
url: prefixUrl(link, options.origin, options.protocol),
|
||||
};
|
||||
if (link) {
|
||||
return {
|
||||
descriptor: descriptor || 'fallback',
|
||||
url: prefixUrl(link, options.origin, options.protocol),
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.sort((sourceA, sourceB) => {
|
||||
if (sourceB.descriptor === 'fallback' || parseInt(sourceA.descriptor, 10) > parseInt(sourceB.descriptor, 10)) {
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user