aboutsummaryrefslogtreecommitdiffstats
path: root/src/instances
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2022-12-27 17:16:31 +0300
committerManeraKai <manerakai@protonmail.com>2022-12-27 17:16:31 +0300
commit02d11100840a6f66981ced4f53df56a7bc32d786 (patch)
tree535e5106b1d86a0a686965b229dbc9632aa75e6d /src/instances
parentupdated instances (diff)
parentShift to OpenCollective (diff)
downloadlibredirect-02d11100840a6f66981ced4f53df56a7bc32d786.zip
Merge https://github.com/libredirect/libredirect
Diffstat (limited to 'src/instances')
-rwxr-xr-xsrc/instances/get_instances.py23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py
index 913ee1c4..8121cea5 100755
--- a/src/instances/get_instances.py
+++ b/src/instances/get_instances.py
@@ -117,21 +117,6 @@ def is_authenticate(url):
return False
return False
-
-def is_offline(url):
- try:
- r = requests.get(url, timeout=5, headers=headers)
- if r.status_code >= 400:
- print(url + ' is ' + Fore.RED + 'offline' + Style.RESET_ALL)
- print("Status code")
- print(r.status_code)
- return True
- else:
- return False
- except Exception:
- return False
-
-
def fetchCache(frontend, name):
try:
with open('./src/instances/data.json') as file:
@@ -457,9 +442,7 @@ def libreTranslate():
def breezeWiki():
- fetchRegexList('breezeWiki', 'BreezeWiki', 'https://gitdab.com/cadence/breezewiki-docs/raw/branch/main/docs.scrbl',
- r"\(\"[^\n\s\r\t\f\v\"]+\" \"https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+(?:\/[^\s\/]+)*\" \"(https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+(?:\/[^\s\/]+)*)\"\)")
-
+ fetchJsonList('breezeWiki', 'BreezeWiki', 'https://docs.breezewiki.com/files/instances.json', 'instance', False)
def privateBin():
fetchJsonList('privateBin', 'PrivateBin',
@@ -524,7 +507,6 @@ mightyList = idnaEncode(mightyList)
cloudflare = []
authenticate = []
-offline = []
for k1, v1 in mightyList.items():
if type(mightyList[k1]) is dict:
for k2, v2 in mightyList[k1].items():
@@ -537,15 +519,12 @@ for k1, v1 in mightyList.items():
cloudflare.append(instance)
if not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_authenticate(instance):
authenticate.append(instance)
- elif not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_offline(instance):
- offline.append(instance)
peertube()
blacklist = {
'cloudflare': cloudflare,
'authenticate': authenticate,
- 'offline': offline
}
# Writing to file