Separated SearX and SearXNG https://github.com/libredirect/browser_extension/issues/700
このコミットが含まれているのは:
コミット
80cefe35b6
|
@ -21,7 +21,7 @@ jobs:
|
||||||
- name: install python packages
|
- name: install python packages
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install requests colorama
|
pip install requests colorama pyyaml
|
||||||
|
|
||||||
- name: run script
|
- name: run script
|
||||||
run: python instances.py
|
run: python instances.py
|
||||||
|
|
59
instances.py
59
instances.py
|
@ -8,6 +8,7 @@ from urllib.parse import urlparse
|
||||||
import re
|
import re
|
||||||
from colorama import Fore, Style
|
from colorama import Fore, Style
|
||||||
import socket
|
import socket
|
||||||
|
import yaml
|
||||||
|
|
||||||
mightyList = {}
|
mightyList = {}
|
||||||
networks = {}
|
networks = {}
|
||||||
|
@ -335,42 +336,47 @@ def linvgatranslate():
|
||||||
'lingva', 'https://raw.githubusercontent.com/TheDavidDelta/lingva-translate/main/instances.json', None, False)
|
'lingva', 'https://raw.githubusercontent.com/TheDavidDelta/lingva-translate/main/instances.json', None, False)
|
||||||
|
|
||||||
|
|
||||||
def searx_searxng():
|
def searxng():
|
||||||
r = requests.get(
|
r = requests.get(
|
||||||
'https://searx.space/data/instances.json')
|
'https://searx.space/data/instances.json')
|
||||||
rJson = json.loads(r.text)
|
rJson = json.loads(r.text)
|
||||||
searxList = {}
|
|
||||||
searxList['clearnet'] = []
|
|
||||||
searxList['tor'] = []
|
|
||||||
searxList['i2p'] = []
|
|
||||||
searxList['loki'] = []
|
|
||||||
searxngList = {}
|
searxngList = {}
|
||||||
searxngList['clearnet'] = []
|
searxngList['clearnet'] = []
|
||||||
searxngList['tor'] = []
|
searxngList['tor'] = []
|
||||||
searxngList['i2p'] = []
|
searxngList['i2p'] = []
|
||||||
searxngList['loki'] = []
|
searxngList['loki'] = []
|
||||||
for item in rJson['instances']:
|
|
||||||
if re.search(torRegex, item[:-1]):
|
|
||||||
if (rJson['instances'][item].get('generator') == 'searxng'):
|
for item in rJson['instances']:
|
||||||
searxngList['tor'].append(item[:-1])
|
if re.search(torRegex, item[:-1] and rJson['instances'][item].get('generator') == 'searxng'):
|
||||||
else:
|
searxngList['tor'].append(item[:-1])
|
||||||
searxList['tor'].append(item[:-1])
|
elif re.search(i2pRegex, item[:-1] and rJson['instances'][item].get('generator') == 'searxng'):
|
||||||
elif re.search(i2pRegex, item[:-1]):
|
searxngList['i2p'].append(item[:-1])
|
||||||
if (rJson['instances'][item].get('generator') == 'searxng'):
|
elif rJson['instances'][item].get('generator') == 'searxng':
|
||||||
searxngList['i2p'].append(item[:-1])
|
searxngList['clearnet'].append(item[:-1])
|
||||||
else:
|
|
||||||
searxList['i2p'].append(item[:-1])
|
|
||||||
else:
|
|
||||||
if (rJson['instances'][item].get('generator') == 'searxng'):
|
|
||||||
searxngList['clearnet'].append(item[:-1])
|
|
||||||
else:
|
|
||||||
searxList['clearnet'].append(item[:-1])
|
|
||||||
|
|
||||||
mightyList['searx'] = searxList
|
|
||||||
mightyList['searxng'] = searxngList
|
mightyList['searxng'] = searxngList
|
||||||
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'SearX, SearXNG')
|
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'SearX, SearXNG')
|
||||||
|
|
||||||
|
|
||||||
|
def searx():
|
||||||
|
searxList = {}
|
||||||
|
searxList['clearnet'] = []
|
||||||
|
searxList['tor'] = []
|
||||||
|
searxList['i2p'] = []
|
||||||
|
searxList['loki'] = []
|
||||||
|
r = requests.get(
|
||||||
|
'https://raw.githubusercontent.com/searx/searx-instances/master/searxinstances/instances.yml')
|
||||||
|
data = yaml.safe_load(r.text)
|
||||||
|
for key in data:
|
||||||
|
searxList['clearnet'].append(key)
|
||||||
|
if 'additional_urls' in data[key]:
|
||||||
|
for additional_url in data[key]['additional_urls']:
|
||||||
|
if data[key]['additional_urls'][additional_url] == "Hidden Service":
|
||||||
|
searxList['tor'].append(additional_url)
|
||||||
|
mightyList['searx'] = searxList
|
||||||
|
|
||||||
|
|
||||||
def whoogle():
|
def whoogle():
|
||||||
fetchRegexList('whoogle', 'https://raw.githubusercontent.com/benbusby/whoogle-search/main/README.md',
|
fetchRegexList('whoogle', 'https://raw.githubusercontent.com/benbusby/whoogle-search/main/README.md',
|
||||||
r"\| \[https?:\/{2}(?:[^\s\/]+\.)*(?:[^\s\/]+\.)+[a-zA-Z0-9]+\]\((https?:\/{2}(?:[^\s\/]+\.)*(?:[^\s\/]+\.)+[a-zA-Z0-9]+)\/?\) \| ")
|
r"\| \[https?:\/{2}(?:[^\s\/]+\.)*(?:[^\s\/]+\.)+[a-zA-Z0-9]+\]\((https?:\/{2}(?:[^\s\/]+\.)*(?:[^\s\/]+\.)+[a-zA-Z0-9]+)\/?\) \| ")
|
||||||
|
@ -501,6 +507,7 @@ def gothub():
|
||||||
r"\| \[.*\]\((https:\/{2}.*?)\).*\|.*(?!No|Yes)"
|
r"\| \[.*\]\((https:\/{2}.*?)\).*\|.*(?!No|Yes)"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def mikuInvidious():
|
def mikuInvidious():
|
||||||
fetchFromFile('mikuInvidious')
|
fetchFromFile('mikuInvidious')
|
||||||
|
|
||||||
|
@ -517,6 +524,8 @@ wolfreeAlpha_url_list = [
|
||||||
"https://uqq.gitlab.io"
|
"https://uqq.gitlab.io"
|
||||||
]
|
]
|
||||||
wolfreeAlpha_url_list_i = 0
|
wolfreeAlpha_url_list_i = 0
|
||||||
|
|
||||||
|
|
||||||
def wolfreeAlpha(i):
|
def wolfreeAlpha(i):
|
||||||
global wolfreeAlpha_url_list_i
|
global wolfreeAlpha_url_list_i
|
||||||
frontend = 'wolfreeAlpha'
|
frontend = 'wolfreeAlpha'
|
||||||
|
@ -561,7 +570,8 @@ libremdb()
|
||||||
simplytranslate()
|
simplytranslate()
|
||||||
linvgatranslate()
|
linvgatranslate()
|
||||||
libreTranslate()
|
libreTranslate()
|
||||||
searx_searxng()
|
searxng()
|
||||||
|
searx()
|
||||||
whoogle()
|
whoogle()
|
||||||
librex()
|
librex()
|
||||||
rimgo()
|
rimgo()
|
||||||
|
@ -585,7 +595,6 @@ mikuInvidious()
|
||||||
wolfreeAlpha(wolfreeAlpha_url_list_i)
|
wolfreeAlpha(wolfreeAlpha_url_list_i)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mightyList = filterLastSlash(mightyList)
|
mightyList = filterLastSlash(mightyList)
|
||||||
mightyList = idnaEncode(mightyList)
|
mightyList = idnaEncode(mightyList)
|
||||||
|
|
||||||
|
|
読み込み中…
新しいイシューから参照