Skip to content

Commit

Permalink
Refined update instances script. Bump version => 1.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Apr 13, 2022
1 parent c86cc93 commit 0ac4e71
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
4 changes: 2 additions & 2 deletions chromium.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
### Install in Chromium, Brave and Chrome
- Download the lastest release [libredirect-1.6.2.zip](https://github.com/libredirect/libredirect/releases/download/v1.6.2/libredirect-1.6.2.zip)
- Download the lastest release [libredirect-1.6.3.zip](https://github.com/libredirect/libredirect/releases/download/v1.6.3/libredirect-1.6.3.zip)
- Unzip it with `Auto detect subfolder`
- Open `chrome://extensions`
- Enable `dev mode`
- Click `Load unpacked`. Select and Open `libredirect-1.6.2/`
- Click `Load unpacked`. Select and Open `libredirect-1.6.3/`
Updates are automatic

https://user-images.githubusercontent.com/40805353/159987051-8be73cd3-3fdf-4dd0-99d4-8886674fbdb6.mp4
2 changes: 1 addition & 1 deletion src/instances/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
"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",
Expand Down Expand Up @@ -417,7 +418,6 @@
"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",
Expand Down
42 changes: 23 additions & 19 deletions src/instances/get_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

mightyList = {}


def filterLastSlash(urlList):
tmp = []
for i in urlList:
if i.endswith('/'):
tmp.append(i[:-1])
print(Fore.YELLOW + "filtered " + Style.RESET_ALL + i)
print(Fore.YELLOW + "Fixed " + Style.RESET_ALL + i)
else:
tmp.append(i)
return tmp
Expand All @@ -32,10 +33,11 @@ def filterLastSlash(urlList):
elif instance[1]['type'] == 'onion':
invidiousList['tor'].append(instance[1]['uri'])
mightyList['invidious'] = invidiousList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Invidious')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Invidious')

# ProxiTok
r = requests.get('https://raw.githubusercontent.com/wiki/pablouser1/ProxiTok/Public-instances.md')
r = requests.get(
'https://raw.githubusercontent.com/wiki/pablouser1/ProxiTok/Public-instances.md')

tmp = re.findall(
r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|", r.text)
Expand All @@ -45,18 +47,20 @@ def filterLastSlash(urlList):
for item in tmp:
proxiTokList['normal'].append(item)
mightyList['proxiTok'] = proxiTokList
print('fetched ProxiTok')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'ProxiTok')

# Send
r = requests.get('https://gitlab.com/timvisee/send-instances/-/raw/master/README.md')
tmp = re.findall(r"- ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z0-9]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}", r.text)
r = requests.get(
'https://gitlab.com/timvisee/send-instances/-/raw/master/README.md')
tmp = re.findall(
r"- ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z0-9]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}", r.text)
sendList = {}
sendList['normal'] = []
sendList['tor'] = []
for item in tmp:
sendList['normal'].append(item)
mightyList['send'] = sendList
print(Fore.GREEN +'fetched ' + Style.RESET_ALL + 'Send')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Send')

# Nitter
r = requests.get('https://github.com/zedeus/nitter/wiki/Instances')
Expand All @@ -82,7 +86,7 @@ def filterLastSlash(urlList):
url = 'https://' + url
nitterList['normal'].append(url)
mightyList['nitter'] = nitterList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Nitter')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Nitter')

# Bibliogram
r = requests.get('https://bibliogram.pussthecat.org/api/instances')
Expand All @@ -93,7 +97,7 @@ def filterLastSlash(urlList):
for item in rJson['data']:
bibliogramList['normal'].append(item['address'])
mightyList['bibliogram'] = bibliogramList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Bibliogram')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Bibliogram')

# LibReddit
r = requests.get(
Expand All @@ -113,7 +117,7 @@ def filterLastSlash(urlList):
else:
libredditList['normal'].append(item)
mightyList['libreddit'] = libredditList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'LibReddit')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'LibReddit')

# Teddit
r = requests.get(
Expand All @@ -132,7 +136,7 @@ def filterLastSlash(urlList):
tedditList['tor'].append(onion)

mightyList['teddit'] = tedditList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Teddit')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Teddit')


# Wikiless
Expand All @@ -150,7 +154,7 @@ def filterLastSlash(urlList):
else:
wikilessList['normal'].append('https://' + item)
mightyList['wikiless'] = wikilessList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Wikiless')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Wikiless')

# Scribe
r = requests.get(
Expand All @@ -162,7 +166,7 @@ def filterLastSlash(urlList):
for item in rJson:
scribeList['normal'].append(item)
mightyList['scribe'] = scribeList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Scribe')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Scribe')

# SimplyTranslate
r = requests.get('https://simple-web.org/instances/simplytranslate')
Expand All @@ -177,7 +181,7 @@ def filterLastSlash(urlList):
simplyTranslateList['tor'].append('http://' + item)

mightyList['simplyTranslate'] = simplyTranslateList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'SimplyTranslate')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'SimplyTranslate')

# LinvgaTranslate
r = requests.get(
Expand All @@ -189,7 +193,7 @@ def filterLastSlash(urlList):
for item in rJson:
lingvaList['normal'].append(item)
mightyList['lingva'] = lingvaList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'LinvgaTranslate')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'LinvgaTranslate')


# SearX, SearXNG
Expand Down Expand Up @@ -222,7 +226,7 @@ def filterLastSlash(urlList):

mightyList['searx'] = searxList
mightyList['searxng'] = searxngList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'SearX, SearXNG')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'SearX, SearXNG')

# Whoogle
r = requests.get(
Expand All @@ -240,7 +244,7 @@ def filterLastSlash(urlList):
else:
whoogleList['normal'].append(item)
mightyList['whoogle'] = whoogleList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Whoogle')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Whoogle')

# Rimgo
r = requests.get(
Expand All @@ -258,7 +262,7 @@ def filterLastSlash(urlList):
else:
rimgoList['normal'].append('https://' + item)
mightyList['rimgo'] = rimgoList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Rimgo')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Rimgo')

# Peertube
r = requests.get(
Expand All @@ -270,7 +274,7 @@ def filterLastSlash(urlList):
myList.append('https://'+k['host'])

mightyList['peertube'] = myList
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Peertube')
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Peertube')


def isValid(url): # This code is contributed by avanitrachhadiya2155
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_extensionName__",
"description": "__MSG_extensionDescription__",
"version": "1.6.2",
"version": "1.6.3",
"manifest_version": 2,
"browser_specific_settings": {
"gecko": {
Expand Down
2 changes: 1 addition & 1 deletion src/updates/updates.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='oladmjdebphlnjjcnomfhhbfdldiimaf'>
<updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v1.6.1/libredirect-1.6.2.crx' version='1.6.2' />
<updatecheck codebase='https://github.com/libredirect/libredirect/releases/download/v1.6.1/libredirect-1.6.3.crx' version='1.6.3' />
</app>
</gupdate>

0 comments on commit 0ac4e71

Please sign in to comment.