Allowing mobile parameter to be set on Gamma network. Added mobile to 21Naturals and 21Sextreme, moved 21Sextury mobile to network.

This commit is contained in:
2020-03-06 19:26:23 +01:00
parent 19f46d4d86
commit 96eef822d6
3 changed files with 9 additions and 24 deletions

View File

@@ -467,11 +467,11 @@ async function fetchUpcoming(site) {
return scrapeAll(res.body.toString(), site, null, false);
}
function getDeepUrl(url, site, release, mobile = false) {
function getDeepUrl(url, site, release, mobile) {
const pathname = release?.path || new URL(url).pathname;
if (mobile) {
return `${site.parameters.mobile}${pathname.replace('/en/video', '')}`;
return `${mobile}${pathname.replace('/en/video', '')}`;
}
if (site.parameters?.deep === 'network') {
@@ -491,7 +491,7 @@ async function fetchScene(url, site, release) {
}
const deepUrl = getDeepUrl(url, site, release);
const mobileUrl = site.parameters?.mobile && getDeepUrl(url, site, release, true);
const mobileUrl = getDeepUrl(url, site, release, site.parameters?.mobile || site.network.parameters?.mobile);
if (deepUrl) {
const [res, mobileRes] = await Promise.all([