auto fetch proxitok instances (#185)

This commit is contained in:
BobIsMyManager 2022-04-10 20:15:12 +00:00 committed by GitHub
parent cb5ce455f0
commit 3c2a32015b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 11450 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ web-ext-artifacts/
.DS_Store
nod
node_modules
package-lock.json

11446
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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;
}

View File

@ -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];

View File

@ -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";

View File

@ -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",

View File

@ -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')