diff --git a/migrations/20190325001339_releases.js b/migrations/20190325001339_releases.js index 94dddacc..33fe19f1 100644 --- a/migrations/20190325001339_releases.js +++ b/migrations/20190325001339_releases.js @@ -37,7 +37,7 @@ exports.up = knex => Promise.resolve() table.float('entropy'); table.text('scraper', 32); - table.text('copyright', 100); + table.text('credit', 100); table.text('source', 2100); table.text('source_page', 2100); @@ -279,6 +279,9 @@ exports.up = knex => Promise.resolve() table.integer('hip', 3); table.boolean('natural_boobs'); + table.integer('penis_length', 3); + table.integer('penis_girth', 3); + table.integer('height', 3); table.integer('weight', 3); table.text('eyes'); @@ -349,6 +352,9 @@ exports.up = knex => Promise.resolve() table.integer('hip', 3); table.boolean('natural_boobs'); + table.integer('penis_length', 3); + table.integer('penis_girth', 3); + table.integer('height', 3); table.integer('weight', 3); table.text('eyes'); diff --git a/public/img/logos/fcuk/afterhoursexposed.png b/public/img/logos/fcuk/afterhoursexposed.png new file mode 100644 index 00000000..65b4c5bb Binary files /dev/null and b/public/img/logos/fcuk/afterhoursexposed.png differ diff --git a/public/img/logos/fcuk/backroomcastingcouch.png b/public/img/logos/fcuk/backroomcastingcouch.png new file mode 100644 index 00000000..d1a1c87c Binary files /dev/null and b/public/img/logos/fcuk/backroomcastingcouch.png differ diff --git a/public/img/logos/fcuk/blackambush.png b/public/img/logos/fcuk/blackambush.png new file mode 100644 index 00000000..a8483c11 Binary files /dev/null and b/public/img/logos/fcuk/blackambush.png differ diff --git a/public/img/logos/fcuk/eurocoeds.png b/public/img/logos/fcuk/eurocoeds.png new file mode 100644 index 00000000..a79c59b4 Binary files /dev/null and b/public/img/logos/fcuk/eurocoeds.png differ diff --git a/public/img/logos/fcuk/exploitedcollegegirls.png b/public/img/logos/fcuk/exploitedcollegegirls.png new file mode 100644 index 00000000..9e51de5b Binary files /dev/null and b/public/img/logos/fcuk/exploitedcollegegirls.png differ diff --git a/public/img/logos/fcuk/favicon.png b/public/img/logos/fcuk/favicon.png new file mode 100644 index 00000000..acc7db52 Binary files /dev/null and b/public/img/logos/fcuk/favicon.png differ diff --git a/public/img/logos/fcuk/fcuk.png b/public/img/logos/fcuk/fcuk.png new file mode 100644 index 00000000..61aa3fd2 Binary files /dev/null and b/public/img/logos/fcuk/fcuk.png differ diff --git a/public/img/logos/fcuk/lazy/afterhoursexposed.png b/public/img/logos/fcuk/lazy/afterhoursexposed.png new file mode 100644 index 00000000..ee0663de Binary files /dev/null and b/public/img/logos/fcuk/lazy/afterhoursexposed.png differ diff --git a/public/img/logos/fcuk/lazy/backroomcastingcouch.png b/public/img/logos/fcuk/lazy/backroomcastingcouch.png new file mode 100644 index 00000000..56ead794 Binary files /dev/null and b/public/img/logos/fcuk/lazy/backroomcastingcouch.png differ diff --git a/public/img/logos/fcuk/lazy/blackambush.png b/public/img/logos/fcuk/lazy/blackambush.png new file mode 100644 index 00000000..98e0b539 Binary files /dev/null and b/public/img/logos/fcuk/lazy/blackambush.png differ diff --git a/public/img/logos/fcuk/lazy/eurocoeds.png b/public/img/logos/fcuk/lazy/eurocoeds.png new file mode 100644 index 00000000..67aae1e1 Binary files /dev/null and b/public/img/logos/fcuk/lazy/eurocoeds.png differ diff --git a/public/img/logos/fcuk/lazy/exploitedcollegegirls.png b/public/img/logos/fcuk/lazy/exploitedcollegegirls.png new file mode 100644 index 00000000..f24163b9 Binary files /dev/null and b/public/img/logos/fcuk/lazy/exploitedcollegegirls.png differ diff --git a/public/img/logos/fcuk/lazy/fcuk.png b/public/img/logos/fcuk/lazy/fcuk.png new file mode 100644 index 00000000..be62d0f7 Binary files /dev/null and b/public/img/logos/fcuk/lazy/fcuk.png differ diff --git a/public/img/logos/fcuk/lazy/nebraskacoeds.png b/public/img/logos/fcuk/lazy/nebraskacoeds.png new file mode 100644 index 00000000..7dc77e3f Binary files /dev/null and b/public/img/logos/fcuk/lazy/nebraskacoeds.png differ diff --git a/public/img/logos/fcuk/lazy/network.png b/public/img/logos/fcuk/lazy/network.png new file mode 100644 index 00000000..68416bc4 Binary files /dev/null and b/public/img/logos/fcuk/lazy/network.png differ diff --git a/public/img/logos/fcuk/lazy/southbeachcoeds.png b/public/img/logos/fcuk/lazy/southbeachcoeds.png new file mode 100644 index 00000000..6cccabb6 Binary files /dev/null and b/public/img/logos/fcuk/lazy/southbeachcoeds.png differ diff --git a/public/img/logos/fcuk/lazy/springbreaklife.png b/public/img/logos/fcuk/lazy/springbreaklife.png new file mode 100644 index 00000000..1d3a3d9c Binary files /dev/null and b/public/img/logos/fcuk/lazy/springbreaklife.png differ diff --git a/public/img/logos/fcuk/misc/after-hours-exposed_dark.png b/public/img/logos/fcuk/misc/after-hours-exposed_dark.png new file mode 100644 index 00000000..4ef41ad7 Binary files /dev/null and b/public/img/logos/fcuk/misc/after-hours-exposed_dark.png differ diff --git a/public/img/logos/fcuk/misc/after-hours-exposed_light.png b/public/img/logos/fcuk/misc/after-hours-exposed_light.png new file mode 100644 index 00000000..3e19e816 Binary files /dev/null and b/public/img/logos/fcuk/misc/after-hours-exposed_light.png differ diff --git a/public/img/logos/fcuk/misc/backroom-casting-couch_tld.png b/public/img/logos/fcuk/misc/backroom-casting-couch_tld.png new file mode 100644 index 00000000..bfad159c Binary files /dev/null and b/public/img/logos/fcuk/misc/backroom-casting-couch_tld.png differ diff --git a/public/img/logos/fcuk/misc/euro-coeds.png b/public/img/logos/fcuk/misc/euro-coeds.png new file mode 100644 index 00000000..47b0bb47 Binary files /dev/null and b/public/img/logos/fcuk/misc/euro-coeds.png differ diff --git a/public/img/logos/fcuk/misc/euro-coeds_border.png b/public/img/logos/fcuk/misc/euro-coeds_border.png new file mode 100644 index 00000000..c3df2b3f Binary files /dev/null and b/public/img/logos/fcuk/misc/euro-coeds_border.png differ diff --git a/public/img/logos/fcuk/misc/exploited-college-girls_light.png b/public/img/logos/fcuk/misc/exploited-college-girls_light.png new file mode 100644 index 00000000..ecffcd43 Binary files /dev/null and b/public/img/logos/fcuk/misc/exploited-college-girls_light.png differ diff --git a/public/img/logos/fcuk/misc/exploited-college-girls_original.png b/public/img/logos/fcuk/misc/exploited-college-girls_original.png new file mode 100644 index 00000000..e39d1440 Binary files /dev/null and b/public/img/logos/fcuk/misc/exploited-college-girls_original.png differ diff --git a/public/img/logos/fcuk/misc/south-beach-coeds.xcf b/public/img/logos/fcuk/misc/south-beach-coeds.xcf new file mode 100644 index 00000000..42c30a24 Binary files /dev/null and b/public/img/logos/fcuk/misc/south-beach-coeds.xcf differ diff --git a/public/img/logos/fcuk/misc/spring-break-life_dark.png b/public/img/logos/fcuk/misc/spring-break-life_dark.png new file mode 100644 index 00000000..2e291404 Binary files /dev/null and b/public/img/logos/fcuk/misc/spring-break-life_dark.png differ diff --git a/public/img/logos/fcuk/misc/spring-break-life_light.png b/public/img/logos/fcuk/misc/spring-break-life_light.png new file mode 100644 index 00000000..9e19e4f2 Binary files /dev/null and b/public/img/logos/fcuk/misc/spring-break-life_light.png differ diff --git a/public/img/logos/fcuk/nebraskacoeds.png b/public/img/logos/fcuk/nebraskacoeds.png new file mode 100644 index 00000000..47a9b8e6 Binary files /dev/null and b/public/img/logos/fcuk/nebraskacoeds.png differ diff --git a/public/img/logos/fcuk/network.png b/public/img/logos/fcuk/network.png new file mode 100644 index 00000000..170efcb1 Binary files /dev/null and b/public/img/logos/fcuk/network.png differ diff --git a/public/img/logos/fcuk/southbeachcoeds.png b/public/img/logos/fcuk/southbeachcoeds.png new file mode 100644 index 00000000..33765086 Binary files /dev/null and b/public/img/logos/fcuk/southbeachcoeds.png differ diff --git a/public/img/logos/fcuk/springbreaklife.png b/public/img/logos/fcuk/springbreaklife.png new file mode 100644 index 00000000..2a8884f1 Binary files /dev/null and b/public/img/logos/fcuk/springbreaklife.png differ diff --git a/public/img/logos/fcuk/thumbs/afterhoursexposed.png b/public/img/logos/fcuk/thumbs/afterhoursexposed.png new file mode 100644 index 00000000..f1841837 Binary files /dev/null and b/public/img/logos/fcuk/thumbs/afterhoursexposed.png differ diff --git a/public/img/logos/fcuk/thumbs/backroomcastingcouch.png b/public/img/logos/fcuk/thumbs/backroomcastingcouch.png new file mode 100644 index 00000000..9974cca0 Binary files /dev/null and b/public/img/logos/fcuk/thumbs/backroomcastingcouch.png differ diff --git a/public/img/logos/fcuk/thumbs/blackambush.png b/public/img/logos/fcuk/thumbs/blackambush.png new file mode 100644 index 00000000..6370fff1 Binary files /dev/null and b/public/img/logos/fcuk/thumbs/blackambush.png differ diff --git a/public/img/logos/fcuk/thumbs/eurocoeds.png b/public/img/logos/fcuk/thumbs/eurocoeds.png new file mode 100644 index 00000000..a1cba59f Binary files /dev/null and b/public/img/logos/fcuk/thumbs/eurocoeds.png differ diff --git a/public/img/logos/fcuk/thumbs/exploitedcollegegirls.png b/public/img/logos/fcuk/thumbs/exploitedcollegegirls.png new file mode 100644 index 00000000..aa38ca9a Binary files /dev/null and b/public/img/logos/fcuk/thumbs/exploitedcollegegirls.png differ diff --git a/public/img/logos/fcuk/thumbs/fcuk.png b/public/img/logos/fcuk/thumbs/fcuk.png new file mode 100644 index 00000000..a10a7e4a Binary files /dev/null and b/public/img/logos/fcuk/thumbs/fcuk.png differ diff --git a/public/img/logos/fcuk/thumbs/nebraskacoeds.png b/public/img/logos/fcuk/thumbs/nebraskacoeds.png new file mode 100644 index 00000000..32e8771a Binary files /dev/null and b/public/img/logos/fcuk/thumbs/nebraskacoeds.png differ diff --git a/public/img/logos/fcuk/thumbs/network.png b/public/img/logos/fcuk/thumbs/network.png new file mode 100644 index 00000000..4481159b Binary files /dev/null and b/public/img/logos/fcuk/thumbs/network.png differ diff --git a/public/img/logos/fcuk/thumbs/southbeachcoeds.png b/public/img/logos/fcuk/thumbs/southbeachcoeds.png new file mode 100644 index 00000000..7ed90b1c Binary files /dev/null and b/public/img/logos/fcuk/thumbs/southbeachcoeds.png differ diff --git a/public/img/logos/fcuk/thumbs/springbreaklife.png b/public/img/logos/fcuk/thumbs/springbreaklife.png new file mode 100644 index 00000000..dc5e5c79 Binary files /dev/null and b/public/img/logos/fcuk/thumbs/springbreaklife.png differ diff --git a/seeds/01_networks.js b/seeds/01_networks.js index eaae5401..708df9e3 100644 --- a/seeds/01_networks.js +++ b/seeds/01_networks.js @@ -139,6 +139,10 @@ const networks = [ url: 'https://www.cherrypimps.com', description: 'CherryPimps your premium porn site to Download and Stream the hottest and most exclusive 4K HD videos and pictures on your phone, tablet, TV or console.', }, + { + slug: 'fcuk', + name: 'Fcuk', + }, { slug: 'freeones', name: 'FreeOnes', diff --git a/seeds/02_sites.js b/seeds/02_sites.js index 523e98b8..ea044fee 100644 --- a/seeds/02_sites.js +++ b/seeds/02_sites.js @@ -2085,6 +2085,60 @@ const sites = [ url: 'https://www.freeones.com', parent: 'freeones', }, + // FCUK + { + name: 'Exploited College Girls', + slug: 'exploitedcollegegirls', + alias: ['excogi', 'ecg'], + url: 'https://exploitedcollegegirls.com', + parent: 'fcuk', + parameters: { + blog: true, + }, + }, + { + name: 'Backroom Casting Couch', + slug: 'backroomcastingcouch', + url: 'https://backroomcastingcouch.com', + parent: 'fcuk', + parameters: { + blog: true, + }, + }, + { + name: 'Black Ambush', + slug: 'blackambush', + alias: ['interracial', 'bbc'], + url: 'https://blackambush.com', + parent: 'fcuk', + parameters: { + blog: true, + }, + }, + { + name: 'Nebraska Coeds', + slug: 'nebraskacoeds', + url: 'https://nebraskacoeds.com', + parent: 'fcuk', + }, + { + name: 'South Beach Coeds', + slug: 'southbeachcoeds', + url: 'https://southbeachcoeds.com', + parent: 'fcuk', + }, + { + name: 'Spring Break Life', + slug: 'springbreaklife', + url: 'https://springbreaklife.com', + parent: 'fcuk', + }, + { + name: 'Euro Coeds', + slug: 'eurocoeds', + url: 'https://eurocoeds.com', + parent: 'fcuk', + }, // FOR BONDAGE { name: 'Crowd Bondage', diff --git a/seeds/04_media.js b/seeds/04_media.js index 9d1f1f1a..6a2c31b9 100644 --- a/seeds/04_media.js +++ b/seeds/04_media.js @@ -571,7 +571,7 @@ const sfw = Object.entries({ ['iFBIdX54BOk', 'Keagan Henman'], ], }) - .map(([category, photos]) => photos.map(([photo, copyright], index) => ({ + .map(([category, photos]) => photos.map(([photo, credit], index) => ({ id: photo, path: `sfw/${category}/${photo}.jpeg`, thumbnail: `sfw/${category}/thumbs/${photo}.jpeg`, @@ -580,8 +580,7 @@ const sfw = Object.entries({ sfw_media_id: null, group: category, index, - copyright, - comment: `Courtesy of ${copyright}`, + credit, }))) .flat(); diff --git a/src/app.js b/src/app.js index d99f374f..2a0dd9a5 100644 --- a/src/app.js +++ b/src/app.js @@ -10,6 +10,7 @@ const fetchUpdates = require('./updates'); const { fetchScenes, fetchMovies } = require('./deep'); const { storeReleases, updateReleasesSearch } = require('./store-releases'); const { scrapeActors } = require('./actors'); +const getFileEntries = require('./utils/file-entries'); async function init() { if (argv.server) { @@ -21,13 +22,19 @@ async function init() { await updateReleasesSearch(); } - const actors = argv.actors && await scrapeActors(argv.actors); + const actorsFromFile = argv.actorsFile && await getFileEntries(argv.actorsFile); + const actorNames = (argv.actors || []).concat(actorsFromFile || []); + + const actors = actorNames.length > 0 && await scrapeActors(actorNames); const actorBaseScenes = argv.actors && argv.actorScenes && actors.map(actor => actor.releases).flat().filter(Boolean); const updateBaseScenes = (argv.all || argv.channels || argv.networks) && await fetchUpdates(); + const scenesFromFile = argv.scenesFile && await getFileEntries(argv.scenesFile); + const sceneUrls = (argv.scenes || []).concat(scenesFromFile || []); + const deepScenes = argv.deep - ? await fetchScenes([...(argv.scenes || []), ...(updateBaseScenes || []), ...(actorBaseScenes || [])]) + ? await fetchScenes([...(sceneUrls), ...(updateBaseScenes || []), ...(actorBaseScenes || [])]) : [...(updateBaseScenes || []), ...(actorBaseScenes || [])]; const sceneMovies = deepScenes && argv.sceneMovies && deepScenes.map(scene => scene.movie).filter(Boolean); diff --git a/src/argv.js b/src/argv.js index 6ebddfa3..7f656c34 100644 --- a/src/argv.js +++ b/src/argv.js @@ -30,6 +30,10 @@ const { argv } = yargs type: 'array', alias: 'actor', }) + .option('actors-file', { + describe: 'Scrape actors names from file', + type: 'string', + }) .option('actor-scenes', { describe: 'Fetch all scenes for an actor', type: 'boolean', @@ -53,10 +57,14 @@ const { argv } = yargs alias: 'with-profiles', default: false, }) - .option('scene', { + .option('scenes', { describe: 'Scrape scene info from URL', type: 'array', - alias: 'scenes', + alias: 'scene', + }) + .option('scenes-file', { + describe: 'Scrape scene info from URLs in a file', + type: 'string', }) .option('movie', { describe: 'Scrape movie info from URL', diff --git a/src/media.js b/src/media.js index 4a8f8f6e..ac42457d 100644 --- a/src/media.js +++ b/src/media.js @@ -101,7 +101,7 @@ function toBaseSource(rawSource) { if (rawSource.attempts) baseSource.attempts = rawSource.attempts; if (rawSource.queueMethod) baseSource.queueMethod = rawSource.queueMethod; - if (rawSource.copyright) baseSource.copyright = rawSource.copyright; + if (rawSource.credit !== undefined) baseSource.credit = rawSource.credit; if (rawSource.comment) baseSource.comment = rawSource.comment; if (rawSource.group) baseSource.group = rawSource.group; @@ -569,7 +569,7 @@ function curateMediaEntry(media, index) { source: media.src, source_page: media.url, scraper: media.scraper, - copyright: media.copyright, + credit: media.credit, comment: media.comment, }; @@ -685,7 +685,7 @@ async function associateAvatars(profiles) { ? { ...profile, avatarBaseMedia: toBaseMedias([profile.avatar], 'avatars', { - copyright: profile.network?.name || profile.site?.name || null, + credit: (profile.credit !== undefined && (profile.network?.name || profile.site?.name)) || null, scraper: profile.scraper || null, })[0], } diff --git a/src/scrapers/boobpedia.js b/src/scrapers/boobpedia.js index 9d34cbf9..22c3ca40 100644 --- a/src/scrapers/boobpedia.js +++ b/src/scrapers/boobpedia.js @@ -69,7 +69,7 @@ function scrapeProfile(html) { profile.avatar = { src: `http://www.boobpedia.com${avatarPath}`, - copyright: null, + credit: null, }; } diff --git a/src/scrapers/fcuk.js b/src/scrapers/fcuk.js new file mode 100644 index 00000000..ae9d898e --- /dev/null +++ b/src/scrapers/fcuk.js @@ -0,0 +1,71 @@ +'use strict'; + +const qu = require('../utils/qu'); + +function scrapeLatest(scenes, channel) { + return scenes.map(({ query }) => { + const release = {}; + + release.url = query.url('a.more:not([href*="/join.php"])', 'href', { origin: channel.url }); + + if (release.url) { + release.entryId = new URL(release.url).pathname.match(/\/scene\/(\d+)\/(\d+)/).slice(1, 3).join('-'); + } else { + release.entryId = query.img('.bigthumb').match(/\/scenes\/(\w+)/)?.[1]; + } + + release.title = query.q('h5 strong', true)?.match(/. - (.+)$/)[1] || query.text('.videos h3'); + release.description = query.text('p'); + release.date = query.date('h5 strong, .videos h3', 'MMM. DD, YYYY', /\w+. \d{2}, \d{4}/); + + release.poster = query.img('.bigthumb', null, { origin: channel.url }); + release.photos = query.imgs('.smallthumb', null, { origin: channel.url }); + + release.tags = query.all('a[href*="/keywords"]', true); + + return release; + }); +} + +function scrapeScene({ query }, url, channel) { + const release = {}; + + release.entryId = new URL(url).pathname.match(/\/scene\/(\d+)\/(\d+)/).slice(1, 3).join('-'); + + release.title = query.q('h4 strong, .videos h3', true); + release.description = query.q('#about p, .videos p', true); + + const actors = query.urls('a[href*="/girl/"]').map(actorUrl => actorUrl.match(/video-(\w+)/)?.[1]).filter(Boolean); + + if (actors.length > 0) { + release.actors = actors; + } else { + // release.actors = [query.q('.previewmed h5 strong', true)?.match(/^([\w\s]+),/)?.[0] || query.q('.videos h3', true)].filter(Boolean); + release.actors = [release.title]; + } + + release.tags = query.all('.info a[href*="/keywords"], .buttons a[href*="/keywords"]', true); + + release.poster = query.img('#info .main-preview, .bigthumb', null, { origin: channel.url }); + release.photos = [query.img('.previewmed img', null, { origin: channel.url })].concat(query.imgs('.hd-clip img, .smallthumb', null, { origin: channel.url })).filter(photo => photo); + + return release; +} + +async function fetchLatest(channel, page = 1) { + const url = `${channel.url}/free/updates/videos/${(page - 1) * 10}`; + const res = await qu.getAll(url, '.videos'); + + return res.ok ? scrapeLatest(res.items, channel) : res.status; +} + +async function fetchScene(url, channel) { + const res = await qu.get(url); + + return res.ok ? scrapeScene(res.item, url, channel) : res.status; +} + +module.exports = { + fetchLatest, + fetchScene, +}; diff --git a/src/scrapers/freeones.js b/src/scrapers/freeones.js index ac0cfce2..46f67f1e 100644 --- a/src/scrapers/freeones.js +++ b/src/scrapers/freeones.js @@ -52,7 +52,7 @@ function scrapeProfile(html, actorName) { profile.social = Array.from(document.querySelectorAll('.profile-meta-item a.social-icons'), el => el.href); const avatar = document.querySelector('.profile-image-large img').src; - if (!avatar.match('placeholder')) profile.avatar = { src: avatar, copyright: null }; + if (!avatar.match('placeholder')) profile.avatar = { src: avatar, credit: null }; return profile; } diff --git a/src/scrapers/scrapers.js b/src/scrapers/scrapers.js index fb64da6d..d77532a8 100644 --- a/src/scrapers/scrapers.js +++ b/src/scrapers/scrapers.js @@ -19,6 +19,7 @@ const evilangel = require('./evilangel'); const fakehub = require('./fakehub'); const famedigital = require('./famedigital'); const fantasymassage = require('./fantasymassage'); +const fcuk = require('./fcuk'); const fullpornnetwork = require('./fullpornnetwork'); const girlsway = require('./girlsway'); const hush = require('./hush'); @@ -93,6 +94,7 @@ module.exports = { fakehub, famedigital, fantasymassage, + fcuk, forbondage: porndoe, fullpornnetwork, girlsway, diff --git a/src/utils/file-entries.js b/src/utils/file-entries.js new file mode 100644 index 00000000..e2fe2b74 --- /dev/null +++ b/src/utils/file-entries.js @@ -0,0 +1,16 @@ +'use strict'; + +const fs = require('fs'); + +async function getFileEntries(location) { + if (!location) { + throw new Error('No filepath provided'); + } + + const file = await fs.promises.readFile(location, 'utf-8'); + const entries = file.split(/\n/).map(entry => entry.trim()).filter(Boolean); + + return entries; +} + +module.exports = getFileEntries; diff --git a/src/utils/qu.js b/src/utils/qu.js index 7caa72e0..f25a0944 100644 --- a/src/utils/qu.js +++ b/src/utils/qu.js @@ -125,7 +125,7 @@ function date(context, selector, format, match, attr = 'textContent') { return extractDate(dateString, format, match); } -function image(context, selector = 'img', attr, origin, protocol = 'https') { +function image(context, selector = 'img', attr, { origin, protocol = 'https' } = {}) { const imageEl = (attr && q(context, selector, attr)) || q(context, selector, 'data-src') || q(context, selector, 'src'); @@ -133,7 +133,7 @@ function image(context, selector = 'img', attr, origin, protocol = 'https') { return prefixUrl(imageEl, origin, protocol); } -function images(context, selector = 'img', attr, origin, protocol = 'https') { +function images(context, selector = 'img', attr, { origin, protocol = 'https' } = {}) { const attribute = attr || (q(context, selector, 'data-src') && 'data-src') || (q(context, selector, 'src') && 'src'); @@ -143,31 +143,31 @@ 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' } = {}) { const urlEl = q(context, selector, attr); return attr ? prefixUrl(urlEl, origin, protocol) : urlEl; } -function urls(context, selector = 'a', attr = 'href', origin, protocol = 'https') { +function urls(context, selector = 'a', attr = 'href', { origin, protocol = 'https' } = {}) { const urlEls = all(context, selector, attr); return attr ? urlEls.map(urlEl => prefixUrl(urlEl, origin, protocol)) : urlEls; } -function poster(context, selector = 'video', attr = 'poster', origin, protocol = 'https') { +function poster(context, selector = 'video', attr = 'poster', { origin, protocol = 'https' } = {}) { const posterEl = q(context, selector, attr); return attr ? prefixUrl(posterEl, origin, protocol) : posterEl; } -function video(context, selector = 'source', attr = 'src', origin, protocol = 'https') { +function video(context, selector = 'source', attr = 'src', { origin, protocol = 'https' } = {}) { const trailerEl = q(context, selector, attr); return attr ? prefixUrl(trailerEl, origin, protocol) : trailerEl; } -function videos(context, selector = 'source', attr = 'src', origin, protocol = 'https') { +function videos(context, selector = 'source', attr = 'src', { origin, protocol = 'https' } = {}) { const trailerEls = all(context, selector, attr); return attr ? trailerEls.map(trailerEl => prefixUrl(trailerEl, origin, protocol)) : trailerEls;