auto fetch proxitok instances (#185)
This commit is contained in:
parent
cb5ce455f0
commit
3c2a32015b
|
@ -2,3 +2,4 @@ web-ext-artifacts/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
nod
|
nod
|
||||||
node_modules
|
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 wikipediaHelper from "./wikipedia.js";
|
||||||
import localise from '../localise.js'
|
import localise from '../localise.js'
|
||||||
import sendTargetsHelper from "./sendTargets.js";
|
import sendTargetsHelper from "./sendTargets.js";
|
||||||
|
import tikTokHelper from "./tiktok.js";
|
||||||
|
|
||||||
function getRandomInstance(instances) {
|
function getRandomInstance(instances) {
|
||||||
return instances[~~(instances.length * Math.random())];
|
return instances[~~(instances.length * Math.random())];
|
||||||
|
@ -24,6 +25,7 @@ async function wholeInit() {
|
||||||
await wikipediaHelper.init();
|
await wikipediaHelper.init();
|
||||||
await mediumHelper.init();
|
await mediumHelper.init();
|
||||||
await sendTargetsHelper.init();
|
await sendTargetsHelper.init();
|
||||||
|
await tikTokHelper.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateInstances() {
|
async function updateInstances() {
|
||||||
|
@ -59,6 +61,8 @@ async function updateInstances() {
|
||||||
|
|
||||||
sendTargetsHelper.setRedirects(instances.send);
|
sendTargetsHelper.setRedirects(instances.send);
|
||||||
|
|
||||||
|
tikTokHelper.setRedirects(instances.proxiTok);
|
||||||
|
|
||||||
console.info("Successfully updated Instances");
|
console.info("Successfully updated Instances");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,11 +154,11 @@ async function init() {
|
||||||
"sendTargetsProtocol"
|
"sendTargetsProtocol"
|
||||||
],
|
],
|
||||||
r => {
|
r => {
|
||||||
|
redirects.send = dataJson.send;
|
||||||
disable = r.disableSendTarget ?? false;
|
disable = r.disableSendTarget ?? false;
|
||||||
|
|
||||||
protocol = r.sendTargetsProtocol ?? "normal";
|
protocol = r.sendTargetsProtocol ?? "normal";
|
||||||
|
|
||||||
redirects.send = dataJson.send;
|
|
||||||
if (r.sendTargetsRedirects) redirects = r.sendTargetsRedirects;
|
if (r.sendTargetsRedirects) redirects = r.sendTargetsRedirects;
|
||||||
|
|
||||||
sendNormalRedirectsChecks = r.sendNormalRedirectsChecks ?? [...redirects.send.normal];
|
sendNormalRedirectsChecks = r.sendNormalRedirectsChecks ?? [...redirects.send.normal];
|
||||||
|
|
|
@ -8,9 +8,7 @@ const targets = [
|
||||||
|
|
||||||
let redirects = {
|
let redirects = {
|
||||||
"proxiTok": {
|
"proxiTok": {
|
||||||
"normal": [
|
"normal": [],
|
||||||
"https://proxitok.herokuapp.com"
|
|
||||||
],
|
|
||||||
"tor": []
|
"tor": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,6 +129,7 @@ async function init() {
|
||||||
"tiktokProtocol"
|
"tiktokProtocol"
|
||||||
],
|
],
|
||||||
r => {
|
r => {
|
||||||
|
redirects.proxiTok = dataJson.proxiTok;
|
||||||
disable = r.disableTiktok ?? false;
|
disable = r.disableTiktok ?? false;
|
||||||
|
|
||||||
protocol = r.tiktokProtocol ?? "normal";
|
protocol = r.tiktokProtocol ?? "normal";
|
||||||
|
|
|
@ -33,6 +33,12 @@
|
||||||
"http://2rorw2w54tr7jkasn53l5swbjnbvz3ubebhswscnc54yac6gmkxaeeqd.onion"
|
"http://2rorw2w54tr7jkasn53l5swbjnbvz3ubebhswscnc54yac6gmkxaeeqd.onion"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"proxiTok": {
|
||||||
|
"normal": [
|
||||||
|
"https://proxitok.herokuapp.com"
|
||||||
|
],
|
||||||
|
"tor": []
|
||||||
|
},
|
||||||
"send": {
|
"send": {
|
||||||
"normal": [
|
"normal": [
|
||||||
"https://send.vis.ee",
|
"https://send.vis.ee",
|
||||||
|
@ -457,6 +463,14 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"peertube": [
|
"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://peer.galaxycrow.de",
|
||||||
"https://sharetube.us",
|
"https://sharetube.us",
|
||||||
"https://dalek.zone",
|
"https://dalek.zone",
|
||||||
|
|
|
@ -34,6 +34,18 @@ for instance in rJson:
|
||||||
mightyList['invidious'] = invidiousList
|
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')
|
||||||
|
|
||||||
|
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
|
# Send
|
||||||
r = requests.get('https://gitlab.com/timvisee/send-instances/-/raw/master/README.md')
|
r = requests.get('https://gitlab.com/timvisee/send-instances/-/raw/master/README.md')
|
||||||
|
|
Loading…
Reference in New Issue