Added generic Gamma photo and actor scraper for XEmpire, 21Sextury, Blowpass and Evil Angel.

This commit is contained in:
2020-01-22 22:25:58 +01:00
parent 4e4323704a
commit f8175f6054
17 changed files with 347 additions and 290 deletions

View File

@@ -60,7 +60,7 @@ function destructConfigNetworks(networks) {
}
async function findSiteByUrl(url) {
const { hostname, origin } = new URL(url);
const { hostname } = new URL(url);
const domain = hostname.replace(/www.|tour./, '');
const sites = await knex('sites')
@@ -69,8 +69,8 @@ async function findSiteByUrl(url) {
'sites.*',
'networks.name as network_name', 'networks.slug as network_slug', 'networks.url as network_url', 'networks.description as network_description', 'networks.parameters as network_parameters',
)
.where('sites.url', 'like', `${domain}`)
.orWhere('sites.url', 'like', `${origin}`)
.where('sites.url', 'like', `%${domain}`)
.orWhere('sites.url', 'like', url)
.orWhere('sites.url', url);
if (sites.length > 0) {