Fix National Geographic USA (magazine)

This commit is contained in:
magnolia1234 2021-12-19 15:09:54 +01:00
parent 8335331804
commit aae4b9cbba
5 changed files with 32 additions and 7 deletions

View file

@ -52,7 +52,7 @@ var use_google_bot, use_bing_bot;
// Set Referer // Set Referer
var use_facebook_referer, use_google_referer, use_twitter_referer; var use_facebook_referer, use_google_referer, use_twitter_referer;
// Set random IP-address // Set random IP-address
var use_random_ip = ['esprit.presse.fr']; var use_random_ip = ['esprit.presse.fr', 'nationalgeographic.com'];
// concat all sites with change of headers (useragent, referer or random ip) // concat all sites with change of headers (useragent, referer or random ip)
var change_headers; var change_headers;
@ -912,9 +912,14 @@ if (matchUrlDomain(change_headers, details.url) && !['font', 'image', 'styleshee
// random IP for sites in use_random_ip // random IP for sites in use_random_ip
if (matchUrlDomain(use_random_ip, details.url)) { if (matchUrlDomain(use_random_ip, details.url)) {
let randomIP_val;
if (matchUrlDomain('nationalgeographic.com', details.url))
randomIP_val = randomIP(185, 187);
else
randomIP_val = randomIP();
requestHeaders.push({ requestHeaders.push({
"name": "X-Forwarded-For", "name": "X-Forwarded-For",
"value": randomIP() "value": randomIP_val
}) })
} }
} }
@ -1371,10 +1376,14 @@ function randomInt(max) {
return Math.floor(Math.random() * Math.floor(max)); return Math.floor(Math.random() * Math.floor(max));
} }
function randomIP() { function randomIP(range_low = 0, range_high = 223) {
let rndmIP = []; let rndmIP = [];
for (let n = 0; n < 4; n++) for (let n = 0; n < 4; n++) {
rndmIP.push(randomInt(254) + 1); if (n === 0)
rndmIP.push(range_low + randomInt(range_high - range_low) + 1);
else
rndmIP.push(randomInt(255) + 1);
}
return rndmIP.join('.'); return rndmIP.join('.');
} }

View file

@ -11,6 +11,7 @@ Add San Antonio Express-News (local USA)
Add The Indian Express Add The Indian Express
Add Vrij Nederland Add Vrij Nederland
Fix Bloomberg (permission block js) Fix Bloomberg (permission block js)
Fix National Geographic USA (magazine)
Remove tabs-permission (amo - Firefox 86+) Remove tabs-permission (amo - Firefox 86+)
* v2.4.7.0 (2021-12-12) * v2.4.7.0 (2021-12-12)

View file

@ -3211,7 +3211,7 @@ function replaceDomElementExt(url, proxy, base64, selector, text_fail = '') {
} }
function archiveLink(url) { function archiveLink(url) {
let archive_url = 'https://archive.today?run=1&url=' + url; let archive_url = 'https://archive.today?run=1&url=' + url.split('?')[0];
let text_fail_div = document.createElement('div'); let text_fail_div = document.createElement('div');
text_fail_div.id = 'bpc_archive'; text_fail_div.id = 'bpc_archive';
text_fail_div.appendChild(document.createTextNode('BPC > Full article text:\r\n')); text_fail_div.appendChild(document.createTextNode('BPC > Full article text:\r\n'));

View file

@ -15,6 +15,11 @@
"domain": "ara.cat", "domain": "ara.cat",
"useragent": "googlebot" "useragent": "googlebot"
}, },
"Bauernzeitung.ch": {
"allow_cookies": 1,
"domain": "bauernzeitung.ch",
"useragent": "googlebot"
},
"Beobachter.ch": { "Beobachter.ch": {
"allow_cookies": 1, "allow_cookies": 1,
"domain": "beobachter.ch", "domain": "beobachter.ch",
@ -70,6 +75,11 @@
"allow_cookies": 1, "allow_cookies": 1,
"domain": "internationalepolitik.de" "domain": "internationalepolitik.de"
}, },
"Investorschronicle.co.uk": {
"allow_cookies": 1,
"domain": "investorschronicle.co.uk",
"referer": "google"
},
"Lindipendente.online": { "Lindipendente.online": {
"allow_cookies": 1, "allow_cookies": 1,
"domain": "lindipendente.online", "domain": "lindipendente.online",
@ -139,6 +149,11 @@
"domain": "thebanker.com", "domain": "thebanker.com",
"useragent": "googlebot" "useragent": "googlebot"
}, },
"Thecourier.co.uk": {
"allow_cookies": 1,
"domain": "thecourier.co.uk",
"useragent": "googlebot"
},
"Thenational.scot": { "Thenational.scot": {
"allow_cookies": 1, "allow_cookies": 1,
"block_regex": "\\.tinypass\\.com\\/", "block_regex": "\\.tinypass\\.com\\/",

View file

@ -595,5 +595,5 @@
"*://*.wallkit.net/*", "*://*.wallkit.net/*",
"*://*.wsj.net/*" "*://*.wsj.net/*"
], ],
"version": "2.4.7.7" "version": "2.4.7.8"
} }