Fixed MindGeek scraper trying to acquire session from mindgeek.com

This commit is contained in:
DebaucheryLibrarian 2021-11-22 02:51:52 +01:00
parent 6b4aa64d74
commit 20d0d860d3
1 changed files with 5 additions and 1 deletions

View File

@ -156,10 +156,14 @@ function getUrl(site) {
}
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 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)
? site.parent.url
: site.url;