added support for tumblr

- support for tumblr is back! (i tried all types of links in clear sight and everything seems to work, lmk if something doesn't)
- increased stream lifespan up to 1 hour
- made youtube audios download without additional conversion, speed should be a bit better but not by much cause youtube limits the audio download speed :(
This commit is contained in:
wukko
2022-08-01 23:53:44 +06:00
parent 6afa8448f8
commit 20798685c2
9 changed files with 49 additions and 12 deletions

View File

@@ -18,6 +18,10 @@ export async function getJSON(originalURL, ip, lang, format, quality) {
host = "youtube";
url = `https://youtube.com/watch?v=${url.replace("youtu.be/", "").replace("https://", "")}`;
}
if (host == "tumblr" && !url.includes("blog/view")) {
if (url.slice(-1) == '/') url = url.slice(0, -1);
url = url.replace(url.split('/')[5], '');
}
if (host && host.length < 20 && host in patterns && patterns[host]["enabled"]) {
for (let i in patterns[host]["patterns"]) {
patternMatch = new UrlPattern(patterns[host]["patterns"][i]).match(cleanURL(url, host).split(".com/")[1]);