Added Accept-Language header to MindGeek requests, seems to help with acquiring sessions.

This commit is contained in:
DebaucheryLibrarian 2022-03-30 01:17:54 +02:00
parent 3ec6911d46
commit 61123fdb6a
1 changed files with 7 additions and 0 deletions

View File

@ -222,6 +222,9 @@ async function getSession(site, parameters, url) {
const res = await http.get(sessionUrl, { const res = await http.get(sessionUrl, {
session, session,
headers: {
'Accept-Language': 'en-US,en;', // somehow seems essential for some MG sites
},
interval: parameters?.interval, interval: parameters?.interval,
concurrency: parameters?.concurrency, concurrency: parameters?.concurrency,
parse: false, parse: false,
@ -310,6 +313,7 @@ async function fetchLatest(site, page = 1, options) {
Instance: instanceToken, Instance: instanceToken,
Origin: site.url, Origin: site.url,
Referer: url, Referer: url,
'Accept-Language': 'en-US,en;', // somehow seems essential for some MG sites
}, },
}); });
@ -334,6 +338,7 @@ async function fetchUpcoming(site, page, options) {
Instance: instanceToken, Instance: instanceToken,
Origin: site.url, Origin: site.url,
Referer: url, Referer: url,
'Accept-Language': 'en-US,en;', // somehow seems essential for some MG sites
}, },
}); });
@ -359,6 +364,7 @@ async function fetchRelease(url, site, baseScene, options) {
concurrency: options.parameters.concurrency, concurrency: options.parameters.concurrency,
headers: { headers: {
Instance: instanceToken, Instance: instanceToken,
'Accept-Language': 'en-US,en;', // somehow seems essential for some MG sites
}, },
}); });
@ -381,6 +387,7 @@ async function fetchProfile({ name: actorName, slug: actorSlug }, { entity, para
concurrency: parameters.concurrency, concurrency: parameters.concurrency,
headers: { headers: {
Instance: instanceToken, Instance: instanceToken,
'Accept-Language': 'en-US,en;', // somehow seems essential for some MG sites
}, },
}); });