mirror of
https://github.com/imputnet/cobalt.git
synced 2025-12-17 05:28:52 +00:00
vxtwitter support
- moved out host overrides to its own file - added mastodon verification
This commit is contained in:
41
src/modules/processing/hostOverrides.js
Normal file
41
src/modules/processing/hostOverrides.js
Normal file
@@ -0,0 +1,41 @@
|
||||
export default function (inHost, inURL) {
|
||||
let host = String(inHost);
|
||||
let url = String(inURL);
|
||||
|
||||
switch(host) {
|
||||
case "youtu":
|
||||
if (url.startsWith("https://youtu.be/")) {
|
||||
host = "youtube";
|
||||
url = `https://youtube.com/watch?v=${url.replace("https://youtu.be/", "")}`;
|
||||
}
|
||||
break;
|
||||
case "goo":
|
||||
if (url.startsWith("https://soundcloud.app.goo.gl/")) {
|
||||
host = "soundcloud";
|
||||
url = `https://soundcloud.com/${url.replace("https://soundcloud.app.goo.gl/", "").split('/')[0]}`
|
||||
}
|
||||
break;
|
||||
case "vxtwitter":
|
||||
case "x":
|
||||
if (url.startsWith("https://x.com/")) {
|
||||
host = "twitter";
|
||||
url = url.replace("https://x.com/", "https://twitter.com/")
|
||||
}
|
||||
if (url.startsWith("https://vxtwitter.com/")) {
|
||||
host = "twitter";
|
||||
url = url.replace("https://vxtwitter.com/", "https://twitter.com/")
|
||||
}
|
||||
break;
|
||||
case "tumblr":
|
||||
if (!url.includes("blog/view")) {
|
||||
if (url.slice(-1) === '/') url = url.slice(0, -1);
|
||||
url = url.replace(url.split('/')[5], '')
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return {
|
||||
host: host,
|
||||
url: url
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { maxVideoDuration } from "../../config.js";
|
||||
|
||||
// vimeo you're fucked in the head for this
|
||||
const resolutionMatch = {
|
||||
"3840": "2160",
|
||||
"2732": "1440",
|
||||
@@ -11,7 +12,6 @@ const resolutionMatch = {
|
||||
"640": "360",
|
||||
"426": "240"
|
||||
}
|
||||
// ^ vimeo you're fucked in the head for this ^
|
||||
|
||||
const qualityMatch = {
|
||||
"2160": "4K",
|
||||
|
||||
Reference in New Issue
Block a user