This commit is contained in:
parent
dfa6c8e570
commit
9e4c9cda67
44
src/assets/images/coub-icon.svg
Normal file
44
src/assets/images/coub-icon.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 7.8 KiB |
@ -31,6 +31,7 @@ function all(service, frontend, options, config) {
|
||||
* @param {string} service
|
||||
* @param {URL} url
|
||||
* @param {{}} config
|
||||
* @param {{}} options
|
||||
* @param {string} frontend
|
||||
*/
|
||||
function regexArray(service, url, config, options, frontend) {
|
||||
@ -49,17 +50,6 @@ function regexArray(service, url, config, options, frontend) {
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {URL} url
|
||||
* @param {string} type
|
||||
* @param {URL} originUrl
|
||||
* @param {boolean} forceRedirection
|
||||
*/
|
||||
async function redirectAsync(url, type, originUrl, documentUrl, incognito, forceRedirection) {
|
||||
await init()
|
||||
return redirect(url, type, originUrl, documentUrl, incognito, forceRedirection)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {URL} url
|
||||
* @param {string} frontend
|
||||
@ -554,6 +544,13 @@ function rewrite(url, originUrl, frontend, randomInstance) {
|
||||
return `${randomInstance}/list?playlists=${encodeURIComponent(url.searchParams.get("list"))}`
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
}
|
||||
case "koub":
|
||||
if (url.pathname.startsWith("/view/") || url.pathname.startsWith("/stories/")) {
|
||||
return `${randomInstance}${url.pathname}${url.search}`
|
||||
}
|
||||
const accountReg = /^\/([^\/]+)\/?$/.exec(url.pathname)
|
||||
if (accountReg) return `${randomInstance}/account${url.pathname}${url.search}`
|
||||
|
||||
case "piped":
|
||||
case "pipedMaterial":
|
||||
case "cloudtube":
|
||||
@ -632,6 +629,20 @@ function redirect(url, type, originUrl, documentUrl, incognito, forceRedirection
|
||||
return rewrite(url, originUrl, frontend, randomInstance)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {URL} url
|
||||
* @param {string} type
|
||||
* @param {URL} originUrl
|
||||
* @param {URL} documentUrl
|
||||
* @param {boolean} incognito
|
||||
* @param {boolean} forceRedirection
|
||||
* @returns {string | undefined}
|
||||
*/
|
||||
async function redirectAsync(url, type, originUrl, documentUrl, incognito, forceRedirection) {
|
||||
await init()
|
||||
return redirect(url, type, originUrl, documentUrl, incognito, forceRedirection)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {URL} url
|
||||
* @param {*} returnFrontend
|
||||
@ -821,6 +832,7 @@ const defaultInstances = {
|
||||
skunkyArt: ["https://skunky.bloat.cat"],
|
||||
ytify: ["https://ytify.netlify.app"],
|
||||
nerdsForNerds: ["https://nn.vern.cc"],
|
||||
koub: ["https://koub.clovius.club"],
|
||||
}
|
||||
|
||||
async function getDefaults() {
|
||||
|
@ -1334,6 +1334,27 @@
|
||||
},
|
||||
"imageType": "svg",
|
||||
"url": "https://www.geeksforgeeks.org"
|
||||
},
|
||||
"coub": {
|
||||
"frontends": {
|
||||
"koub": {
|
||||
"name": "Koub",
|
||||
"instanceList": true,
|
||||
"url": "https://codeberg.org/gospodin/koub"
|
||||
}
|
||||
},
|
||||
"targets": [
|
||||
"^https?:\\/{2}(www\\.)?coub\\.com"
|
||||
],
|
||||
"name": "Coub",
|
||||
"options": {
|
||||
"enabled": false,
|
||||
"unsupportedUrls": "bypass",
|
||||
"frontend": "koub",
|
||||
"redirectOnlyInIncognito": false
|
||||
},
|
||||
"imageType": "svg",
|
||||
"url": "https://coub.com"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user