From 30bd0b15715ee8ffaf1343bfb26b3f93fb08f387 Mon Sep 17 00:00:00 2001 From: NoPlagiarism <37241775+NoPlagiarism@users.noreply.github.com> Date: Sun, 25 Aug 2024 19:40:52 +0500 Subject: [PATCH] Change AnonymousOverflow source to JSON --- README.md | 2 +- services/other.py | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 29a318f..bcefebf 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ - LibreTranslate: [https://github.com/LibreTranslate/LibreTranslate#mirrors](https://github.com/LibreTranslate/LibreTranslate#mirrors) - Send: [https://github.com/timvisee/send-instances](https://github.com/timvisee/send-instances) - Dumb: [https://raw.githubusercontent.com/rramiachraf/dumb/main/instances.json](https://raw.githubusercontent.com/rramiachraf/dumb/main/instances.json) -- AnonymousOverflow: [https://github.com/httpjamesm/AnonymousOverflow#clearnet-instances](https://github.com/httpjamesm/AnonymousOverflow#clearnet-instances) +- AnonymousOverflow: [https://raw.githubusercontent.com/httpjamesm/AnonymousOverflow/main/instances.json](https://raw.githubusercontent.com/httpjamesm/AnonymousOverflow/main/instances.json) - Wikiless: [https://web.archive.org/web/20220929180821/https://codeberg.org/orenom/wikiless](https://web.archive.org/web/20220929180821/https://codeberg.org/orenom/wikiless) + [https://github.com/Metastem/wikiless/wiki/Instances](https://github.com/Metastem/wikiless/wiki/Instances) - BiblioReads: [https://github.com/nesaku/BiblioReads/blob/main/instances.json](https://github.com/nesaku/BiblioReads/blob/main/instances.json) - Suds: [https://git.vern.cc/cobra/Suds/src/branch/main/instances.json](https://git.vern.cc/cobra/Suds/src/branch/main/instances.json) diff --git a/services/other.py b/services/other.py index 77e8f5d..3f56f3c 100644 --- a/services/other.py +++ b/services/other.py @@ -182,12 +182,22 @@ def jiti(mightyList): def anonymousOverflow(mightyList): - fetchRegexList( - 'anonymousOverflow', - 'https://raw.githubusercontent.com/httpjamesm/AnonymousOverflow/main/README.md', - r"\| \[(?:[^\s\/]+\.)+[a-zA-Z0-9]+\]\((https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+)\/?\) +\|", - mightyList - ) + try: + r = requests.get('https://raw.githubusercontent.com/httpjamesm/AnonymousOverflow/main/instances.json') + rJson: dict = r.json() + all_instances = dict() + for net_type, x_instances in rJson.items(): + x_res = [x['url'].strip("/") for x in x_instances] + all_instances[{ + 'clearnet': 'clearnet', + 'onion': 'tor', + 'i2p': 'i2p', + 'loki': 'loki' + }[net_type]] = x_res + mightyList['anonymousOverflow'] = all_instances + except Exception: + fetchCache('anonymousOverflow', mightyList) + logging.error(traceback.format_exc()) def proxitok(mightyList):