aboutsummaryrefslogtreecommitdiffstats
path: root/src/instances
diff options
context:
space:
mode:
authorManeraKai <manerakai@protonmail.com>2022-04-15 01:38:03 +0300
committerManeraKai <manerakai@protonmail.com>2022-04-15 01:38:03 +0300
commitd0c4a7b1e6f8a55a68980399a72bbad42540eb9c (patch)
treea5ceabd51b363a0a86b50804428da1f00ddb5490 /src/instances
parentStill makin Pug structure. Finished adding LibreSpeed #170 (diff)
downloadlibredirect-d0c4a7b1e6f8a55a68980399a72bbad42540eb9c.zip
Fixed wikipedia mobile not redirecting #196. Improved Instances Fetching Script
Diffstat (limited to 'src/instances')
-rw-r--r--src/instances/data.json6
-rw-r--r--src/instances/get_instances.py7
2 files changed, 8 insertions, 5 deletions
diff --git a/src/instances/data.json b/src/instances/data.json
index c83679f7..d1212eaf 100644
--- a/src/instances/data.json
+++ b/src/instances/data.json
@@ -341,13 +341,13 @@
"https://search.st8.at",
"https://search.stinpriza.org",
"https://search.trom.tf",
+ "https://search.vojkovic.xyz",
"https://search.zdechov.net",
"https://searx.bissisoft.com",
"https://searx.divided-by-zero.eu",
"https://searx.dresden.network",
"https://searx.everdot.org",
"https://searx.fossencdi.org",
- "https://searx.gnous.eu",
"https://searx.gnu.style",
"https://searx.hardwired.link",
"https://searx.josie.lol",
@@ -412,12 +412,12 @@
"https://search.mdosch.de",
"https://search.neet.works",
"https://search.ononoki.org",
- "https://search.vojkovic.xyz",
"https://search.zzls.xyz",
"https://searx.be",
"https://searx.ebnar.xyz",
"https://searx.esmailelbob.xyz",
"https://searx.fmac.xyz",
+ "https://searx.gnous.eu",
"https://searx.mha.fi",
"https://searx.namejeff.xyz",
"https://searx.prvcy.eu",
@@ -480,7 +480,6 @@
"https://watch.riverside.rocks",
"https://peer.galaxycrow.de",
"https://sharetube.us",
- "https://dalek.zone",
"https://video.sadmin.io",
"https://stream.jurnalfm.md",
"https://video.asgardius.company",
@@ -554,7 +553,6 @@
"https://docker.videos.lecygnenoir.info",
"https://video.barcelo.cf",
"https://videotube.duckdns.org",
- "https://peertube.1001solutions.net",
"https://tv.based.quest",
"https://peertube.beardedtek.com",
"https://casnocensure.site",
diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py
index 1af243f5..8ecec164 100644
--- a/src/instances/get_instances.py
+++ b/src/instances/get_instances.py
@@ -6,6 +6,7 @@ from urllib.parse import urlparse
from bs4 import BeautifulSoup
import re
from colorama import Fore, Back, Style
+from urllib.parse import urlparse
mightyList = {}
@@ -278,7 +279,11 @@ print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Peertube')
def isValid(url): # This code is contributed by avanitrachhadiya2155
- return re.search(r"([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z0-9]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}", url)
+ try:
+ result = urlparse(url)
+ return all([result.scheme, result.netloc, result.path])
+ except:
+ return False
for k1, v1 in mightyList.items():