Fixed MindGeek scraper trying to acquire session from mindgeek.com
This commit is contained in:
parent
6b4aa64d74
commit
20d0d860d3
|
@ -156,10 +156,14 @@ function getUrl(site) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getSession(site, parameters) {
|
async function getSession(site, parameters) {
|
||||||
|
if (site.slug === 'mindgeek') {
|
||||||
|
// most MG sites have a parent network to acquire a session from, don't try to acquire session from mindgeek.com for independent channels
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const cookieJar = new CookieJar();
|
const cookieJar = new CookieJar();
|
||||||
const session = http.session({ cookieJar });
|
const session = http.session({ cookieJar });
|
||||||
|
|
||||||
// const res = await session.get(url);
|
|
||||||
const sessionUrl = site.parameters?.siteId && !(site.parameters?.native || site.parameters?.childSession || site.parent?.parameters?.childSession)
|
const sessionUrl = site.parameters?.siteId && !(site.parameters?.native || site.parameters?.childSession || site.parent?.parameters?.childSession)
|
||||||
? site.parent.url
|
? site.parent.url
|
||||||
: site.url;
|
: site.url;
|
||||||
|
|
Loading…
Reference in New Issue