auto fetch proxitok instances (#185)
This commit is contained in:
parent
cb5ce455f0
commit
3c2a32015b
|
@ -2,3 +2,4 @@ web-ext-artifacts/
|
|||
.DS_Store
|
||||
nod
|
||||
node_modules
|
||||
package-lock.json
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9,6 +9,7 @@ import translateHelper from "./translate/translate.js";
|
|||
import wikipediaHelper from "./wikipedia.js";
|
||||
import localise from '../localise.js'
|
||||
import sendTargetsHelper from "./sendTargets.js";
|
||||
import tikTokHelper from "./tiktok.js";
|
||||
|
||||
function getRandomInstance(instances) {
|
||||
return instances[~~(instances.length * Math.random())];
|
||||
|
@ -24,6 +25,7 @@ async function wholeInit() {
|
|||
await wikipediaHelper.init();
|
||||
await mediumHelper.init();
|
||||
await sendTargetsHelper.init();
|
||||
await tikTokHelper.init();
|
||||
}
|
||||
|
||||
async function updateInstances() {
|
||||
|
@ -59,6 +61,8 @@ async function updateInstances() {
|
|||
|
||||
sendTargetsHelper.setRedirects(instances.send);
|
||||
|
||||
tikTokHelper.setRedirects(instances.proxiTok);
|
||||
|
||||
console.info("Successfully updated Instances");
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -154,11 +154,11 @@ async function init() {
|
|||
"sendTargetsProtocol"
|
||||
],
|
||||
r => {
|
||||
redirects.send = dataJson.send;
|
||||
disable = r.disableSendTarget ?? false;
|
||||
|
||||
protocol = r.sendTargetsProtocol ?? "normal";
|
||||
|
||||
redirects.send = dataJson.send;
|
||||
if (r.sendTargetsRedirects) redirects = r.sendTargetsRedirects;
|
||||
|
||||
sendNormalRedirectsChecks = r.sendNormalRedirectsChecks ?? [...redirects.send.normal];
|
||||
|
|
|
@ -8,9 +8,7 @@ const targets = [
|
|||
|
||||
let redirects = {
|
||||
"proxiTok": {
|
||||
"normal": [
|
||||
"https://proxitok.herokuapp.com"
|
||||
],
|
||||
"normal": [],
|
||||
"tor": []
|
||||
}
|
||||
}
|
||||
|
@ -131,6 +129,7 @@ async function init() {
|
|||
"tiktokProtocol"
|
||||
],
|
||||
r => {
|
||||
redirects.proxiTok = dataJson.proxiTok;
|
||||
disable = r.disableTiktok ?? false;
|
||||
|
||||
protocol = r.tiktokProtocol ?? "normal";
|
||||
|
|
|
@ -33,6 +33,12 @@
|
|||
"http://2rorw2w54tr7jkasn53l5swbjnbvz3ubebhswscnc54yac6gmkxaeeqd.onion"
|
||||
]
|
||||
},
|
||||
"proxiTok": {
|
||||
"normal": [
|
||||
"https://proxitok.herokuapp.com"
|
||||
],
|
||||
"tor": []
|
||||
},
|
||||
"send": {
|
||||
"normal": [
|
||||
"https://send.vis.ee",
|
||||
|
@ -457,6 +463,14 @@
|
|||
]
|
||||
},
|
||||
"peertube": [
|
||||
"https://vid.twhtv.club",
|
||||
"https://video.retroedge.tech",
|
||||
"https://truvitv.com",
|
||||
"https://mooretube.com",
|
||||
"https://tube.itsg.host",
|
||||
"https://pt.ilyamikcoder.com",
|
||||
"https://peertube.sensin.eu",
|
||||
"https://watch.riverside.rocks",
|
||||
"https://peer.galaxycrow.de",
|
||||
"https://sharetube.us",
|
||||
"https://dalek.zone",
|
||||
|
|
|
@ -34,6 +34,18 @@ for instance in rJson:
|
|||
mightyList['invidious'] = invidiousList
|
||||
print(Fore.GREEN + 'fetched ' + Style.RESET_ALL + 'Invidious')
|
||||
|
||||
# ProxiTok
|
||||
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)
|
||||
proxiTokList = {}
|
||||
proxiTokList['normal'] = []
|
||||
proxiTokList['tor'] = []
|
||||
for item in tmp:
|
||||
proxiTokList['normal'].append(item)
|
||||
mightyList['proxiTok'] = proxiTokList
|
||||
print('fetched ProxiTok')
|
||||
|
||||
# Send
|
||||
r = requests.get('https://gitlab.com/timvisee/send-instances/-/raw/master/README.md')
|
||||
|
|
Loading…
Reference in New Issue