Add TekstoLibre, frontend for Tekstowo.pl

This commit is contained in:
Daniel 2023-11-11 17:02:42 +01:00
parent 62d10a2d0c
commit b146ce0714
3 changed files with 29 additions and 0 deletions

View File

@ -539,6 +539,9 @@ function redirect(url, type, initiator, forceRedirection) {
}
return `${randomInstance}${url.pathname}${url.search}`
}
case "tekstoLibre": {
return `${randomInstance}/?${url.pathname.slice(1)}`;
}
default: {
return `${randomInstance}${url.pathname}${url.search}`
}
@ -641,6 +644,9 @@ async function reverse(url) {
}
return
}
case "tekstowo": {
return `${config.services[service].url}/${url.search.slice(1)}`
}
default:
return
}
@ -694,6 +700,7 @@ const defaultInstances = {
'proxigram': ['https://proxigram.privacyfrontends.repl.co'],
'tuboYoutube': ['https://tubo.migalmoreno.com'],
'tuboSoundcloud': ['https://tubo.migalmoreno.com'],
'tekstoLibre': ['https://davilarek.github.io/TekstoLibre'],
}
function initDefaults() {

View File

@ -10,6 +10,8 @@ function camelCase(str) {
function protocolHost(url) {
if (url.username && url.password) return `${url.protocol}//${url.username}:${url.password}@${url.host}`
if (url.pathname == "/TekstoLibre/" && url.host.endsWith("github.io")) // workaround
return `${url.protocol}//${url.host}${url.pathname.slice(0, -1)}`
return `${url.protocol}//${url.host}`
}

View File

@ -943,6 +943,26 @@
},
"imageType": "svg",
"url": "https://www.wolframalpha.com"
},
"tekstowo": {
"frontends": {
"tekstoLibre": {
"name": "TekstoLibre",
"instanceList": true,
"url": "https://github.com/Davilarek/TekstoLibre"
}
},
"targets": [
"^https?:\\/{2}(www\\.)?tekstowo\\.pl\\/"
],
"name": "Tekstowo.pl",
"options": {
"enabled": false,
"unsupportedUrls": "bypass",
"frontend": "tekstoLibre"
},
"imageType": "png",
"url": "https://www.tekstowo.pl"
}
}
}