will merge later
This commit is contained in:
parent
c099e1a75f
commit
b904177520
@ -29,7 +29,7 @@ function fetchFrontendInstanceList(service, frontend, redirects, options, config
|
|||||||
for (const network in config.networks) {
|
for (const network in config.networks) {
|
||||||
tmp.push(...redirects[network], ...options[frontend][network].custom)
|
tmp.push(...redirects[network], ...options[frontend][network].custom)
|
||||||
}
|
}
|
||||||
} else if (config.services[service].frontends[frontend].singleInstance) tmp = config.services[service].frontends[frontend].singleInstance
|
}
|
||||||
return tmp
|
return tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,6 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||||||
let randomInstance
|
let randomInstance
|
||||||
let frontend
|
let frontend
|
||||||
for (const service in config.services) {
|
for (const service in config.services) {
|
||||||
|
|
||||||
if (!forceRedirection && !options[service].enabled) continue
|
if (!forceRedirection && !options[service].enabled) continue
|
||||||
|
|
||||||
if (config.services[service].embeddable && type != options[service].redirectType && options[service].redirectType != "both") continue
|
if (config.services[service].embeddable && type != options[service].redirectType && options[service].redirectType != "both") continue
|
||||||
@ -95,7 +94,7 @@ function redirect(url, type, initiator, forceRedirection) {
|
|||||||
}
|
}
|
||||||
if (instanceList.length === 0) return
|
if (instanceList.length === 0) return
|
||||||
randomInstance = utils.getRandomInstance(instanceList)
|
randomInstance = utils.getRandomInstance(instanceList)
|
||||||
} else if (config.services[service].frontends[frontend].singleInstance) randomInstance = config.services[service].frontends[frontend].singleInstance
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if (!frontend || !randomInstance) return
|
if (!frontend || !randomInstance) return
|
||||||
|
@ -447,8 +447,7 @@
|
|||||||
},
|
},
|
||||||
"osm": {
|
"osm": {
|
||||||
"name": "OpenStreetMap",
|
"name": "OpenStreetMap",
|
||||||
"instanceList": false,
|
"instanceList": true
|
||||||
"singleInstance": "https://www.openstreetmap.org"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"targets": [
|
"targets": [
|
||||||
|
@ -117,6 +117,7 @@ def is_authenticate(url):
|
|||||||
return False
|
return False
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def fetchCache(frontend, name):
|
def fetchCache(frontend, name):
|
||||||
try:
|
try:
|
||||||
with open('./src/instances/data.json') as file:
|
with open('./src/instances/data.json') as file:
|
||||||
@ -436,13 +437,19 @@ def facil():
|
|||||||
fetchFromFile('facil', 'FacilMap')
|
fetchFromFile('facil', 'FacilMap')
|
||||||
|
|
||||||
|
|
||||||
|
def osm():
|
||||||
|
fetchFromFile('osm', 'OpenStreetMap')
|
||||||
|
|
||||||
|
|
||||||
def libreTranslate():
|
def libreTranslate():
|
||||||
fetchRegexList('libreTranslate', 'LibreTranslate', 'https://raw.githubusercontent.com/LibreTranslate/LibreTranslate/main/README.md',
|
fetchRegexList('libreTranslate', 'LibreTranslate', 'https://raw.githubusercontent.com/LibreTranslate/LibreTranslate/main/README.md',
|
||||||
r"\[(?:[^\s\/]+\.)+[a-zA-Z0-9]+\]\((https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+)\/?\)\|")
|
r"\[(?:[^\s\/]+\.)+[a-zA-Z0-9]+\]\((https?:\/{2}(?:[^\s\/]+\.)+[a-zA-Z0-9]+)\/?\)\|")
|
||||||
|
|
||||||
|
|
||||||
def breezeWiki():
|
def breezeWiki():
|
||||||
fetchJsonList('breezeWiki', 'BreezeWiki', 'https://docs.breezewiki.com/files/instances.json', 'instance', False)
|
fetchJsonList('breezeWiki', 'BreezeWiki',
|
||||||
|
'https://docs.breezewiki.com/files/instances.json', 'instance', False)
|
||||||
|
|
||||||
|
|
||||||
def privateBin():
|
def privateBin():
|
||||||
fetchJsonList('privateBin', 'PrivateBin',
|
fetchJsonList('privateBin', 'PrivateBin',
|
||||||
@ -499,6 +506,7 @@ neuters()
|
|||||||
beatbump()
|
beatbump()
|
||||||
hyperpipe()
|
hyperpipe()
|
||||||
facil()
|
facil()
|
||||||
|
osm()
|
||||||
simpleertube()
|
simpleertube()
|
||||||
breezeWiki()
|
breezeWiki()
|
||||||
privateBin()
|
privateBin()
|
||||||
|
5
src/instances/osm.json
Normal file
5
src/instances/osm.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"clearnet": [
|
||||||
|
"https://www.openstreetmap.org"
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user