Unchecked Authentication Requiring instances by default #248
This commit is contained in:
parent
ab44fd04ff
commit
754c52983a
|
@ -18,7 +18,7 @@ function getRandomInstance(instances) {
|
||||||
let cloudflareList = [];
|
let cloudflareList = [];
|
||||||
async function initCloudflareList() {
|
async function initCloudflareList() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
fetch('/instances/cloudflare.json').then(response => response.text()).then(data => {
|
fetch('/instances/blocklist').then(response => response.text()).then(data => {
|
||||||
cloudflareList = JSON.parse(data);
|
cloudflareList = JSON.parse(data);
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
"https://piped.mha.fi",
|
"https://piped.mha.fi",
|
||||||
"https://send.silkky.cloud",
|
"https://send.silkky.cloud",
|
||||||
"https://nhanh.cloud",
|
"https://nhanh.cloud",
|
||||||
|
"https://nitter.nixnet.services",
|
||||||
"https://nitter.domain.glass",
|
"https://nitter.domain.glass",
|
||||||
"https://birdsite.xanny.family",
|
"https://birdsite.xanny.family",
|
||||||
"https://nitter.moomoo.me",
|
"https://nitter.moomoo.me",
|
|
@ -2,7 +2,6 @@
|
||||||
"invidious": {
|
"invidious": {
|
||||||
"normal": [
|
"normal": [
|
||||||
"https://yewtu.be",
|
"https://yewtu.be",
|
||||||
"https://vid.puffyan.us",
|
|
||||||
"https://invidious.snopyta.org",
|
"https://invidious.snopyta.org",
|
||||||
"https://invidious.kavin.rocks",
|
"https://invidious.kavin.rocks",
|
||||||
"https://inv.riverside.rocks",
|
"https://inv.riverside.rocks",
|
||||||
|
@ -19,7 +18,8 @@
|
||||||
"https://invidious.weblibre.org",
|
"https://invidious.weblibre.org",
|
||||||
"https://invidious.esmailelbob.xyz",
|
"https://invidious.esmailelbob.xyz",
|
||||||
"https://youtube.076.ne.jp",
|
"https://youtube.076.ne.jp",
|
||||||
"https://invidious.namazso.eu"
|
"https://invidious.namazso.eu",
|
||||||
|
"https://vid.puffyan.us"
|
||||||
],
|
],
|
||||||
"tor": [
|
"tor": [
|
||||||
"http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion",
|
"http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion",
|
||||||
|
@ -376,7 +376,6 @@
|
||||||
"https://searx.nixnet.services",
|
"https://searx.nixnet.services",
|
||||||
"https://searx.openhoofd.nl",
|
"https://searx.openhoofd.nl",
|
||||||
"https://searx.org",
|
"https://searx.org",
|
||||||
"https://searx.ppeb.me",
|
|
||||||
"https://searx.pwoss.org",
|
"https://searx.pwoss.org",
|
||||||
"https://searx.rasp.fr",
|
"https://searx.rasp.fr",
|
||||||
"https://searx.ru",
|
"https://searx.ru",
|
||||||
|
@ -444,6 +443,7 @@
|
||||||
"https://searx.mha.fi",
|
"https://searx.mha.fi",
|
||||||
"https://searx.namejeff.xyz",
|
"https://searx.namejeff.xyz",
|
||||||
"https://searx.orion-hub.fr",
|
"https://searx.orion-hub.fr",
|
||||||
|
"https://searx.ppeb.me",
|
||||||
"https://searx.prvcy.eu",
|
"https://searx.prvcy.eu",
|
||||||
"https://searx.sev.monster",
|
"https://searx.sev.monster",
|
||||||
"https://searx.tiekoetter.com",
|
"https://searx.tiekoetter.com",
|
||||||
|
|
|
@ -67,6 +67,16 @@ def is_cloudflare(url):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def is_authenticate(url):
|
||||||
|
try:
|
||||||
|
r = requests.get(url, timeout=5)
|
||||||
|
if 'www-authenticate' in r.headers:
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def invidious():
|
def invidious():
|
||||||
r = requests.get('https://api.invidious.io/instances.json')
|
r = requests.get('https://api.invidious.io/instances.json')
|
||||||
rJson = json.loads(r.text)
|
rJson = json.loads(r.text)
|
||||||
|
@ -366,7 +376,7 @@ searx_searxng()
|
||||||
whoogle()
|
whoogle()
|
||||||
rimgo()
|
rimgo()
|
||||||
|
|
||||||
cloudflareMightyList = []
|
blocklist = []
|
||||||
for k1, v1 in mightyList.items():
|
for k1, v1 in mightyList.items():
|
||||||
if type(mightyList[k1]) is dict:
|
if type(mightyList[k1]) is dict:
|
||||||
for k2, v2 in mightyList[k1].items():
|
for k2, v2 in mightyList[k1].items():
|
||||||
|
@ -376,7 +386,9 @@ for k1, v1 in mightyList.items():
|
||||||
# print("removed " + instance)
|
# print("removed " + instance)
|
||||||
# else:
|
# else:
|
||||||
if not instance.endswith('.onion') and not instance.endswith('.i2p') and is_cloudflare(instance):
|
if not instance.endswith('.onion') and not instance.endswith('.i2p') and is_cloudflare(instance):
|
||||||
cloudflareMightyList.append(instance)
|
blocklist.append(instance)
|
||||||
|
if not instance.endswith('.onion') and not instance.endswith('.i2p') and is_authenticate(instance):
|
||||||
|
blocklist.append(instance)
|
||||||
|
|
||||||
peertube()
|
peertube()
|
||||||
|
|
||||||
|
@ -387,9 +399,9 @@ with open('./src/instances/data.json', 'w') as outfile:
|
||||||
outfile.write(json_object)
|
outfile.write(json_object)
|
||||||
print(Fore.BLUE + 'wrote ' + Style.RESET_ALL + 'instances/data.json')
|
print(Fore.BLUE + 'wrote ' + Style.RESET_ALL + 'instances/data.json')
|
||||||
|
|
||||||
json_object = json.dumps(cloudflareMightyList, ensure_ascii=False, indent=2)
|
json_object = json.dumps(blocklist, ensure_ascii=False, indent=2)
|
||||||
with open('./src/instances/cloudflare.json', 'w') as outfile:
|
with open('./src/instances/blocklist.json', 'w') as outfile:
|
||||||
outfile.write(json_object)
|
outfile.write(json_object)
|
||||||
print(Fore.BLUE + 'wrote ' + Style.RESET_ALL + 'instances/cloudflare.json')
|
print(Fore.BLUE + 'wrote ' + Style.RESET_ALL + 'instances/blocklist')
|
||||||
|
|
||||||
# print(json_object)
|
# print(json_object)
|
||||||
|
|
|
@ -22,7 +22,7 @@ window.browser = window.browser || window.chrome;
|
||||||
|
|
||||||
browser.runtime.onInstalled.addListener(async details => {
|
browser.runtime.onInstalled.addListener(async details => {
|
||||||
if (details.reason == 'install') {
|
if (details.reason == 'install') {
|
||||||
fetch('/instances/cloudflare.json').then(response => response.text()).then(async data => {
|
fetch('/instances/blocklist.json').then(response => response.text()).then(async data => {
|
||||||
await browser.storage.local.set({ cloudflareList: JSON.parse(data) })
|
await browser.storage.local.set({ cloudflareList: JSON.parse(data) })
|
||||||
youtubeHelper.initDefaults();
|
youtubeHelper.initDefaults();
|
||||||
youtubeMusicHelper.initDefaults();
|
youtubeMusicHelper.initDefaults();
|
||||||
|
|
Loading…
Reference in New Issue