mirror of
https://github.com/wukko/cobalt.git
synced 2025-06-12 13:17:45 +02:00
5.5: vine support and bug fixes
- added support for vine archives - fixed ability to download muted videos from tumblr - removed extra instagram id testing which i left by mistake
This commit is contained in:
@ -16,6 +16,7 @@ import tumblr from "./services/tumblr.js";
|
||||
import vimeo from "./services/vimeo.js";
|
||||
import soundcloud from "./services/soundcloud.js";
|
||||
import instagram from "./services/instagram.js";
|
||||
import vine from "./services/vine.js";
|
||||
|
||||
export default async function (host, patternMatch, url, lang, obj) {
|
||||
try {
|
||||
@ -104,7 +105,10 @@ export default async function (host, patternMatch, url, lang, obj) {
|
||||
});
|
||||
break;
|
||||
case "instagram":
|
||||
r = await instagram({ id: patternMatch["id"] ? patternMatch["id"] : false });
|
||||
r = await instagram({ id: patternMatch["id"] });
|
||||
break;
|
||||
case "vine":
|
||||
r = await vine({ id: patternMatch["id"] });
|
||||
break;
|
||||
default:
|
||||
return apiJSON(0, { t: errorUnsupported(lang) });
|
||||
|
@ -52,6 +52,7 @@ export default function(r, host, ip, audioFormat, isAudioOnly, lang, isAudioMute
|
||||
params = { type: "bridge" };
|
||||
break;
|
||||
|
||||
case "vine":
|
||||
case "instagram":
|
||||
case "tumblr":
|
||||
case "twitter":
|
||||
|
@ -10,5 +10,5 @@ export default async function(obj) {
|
||||
if (!html) return { error: 'ErrorCouldntFetch' };
|
||||
if (!html.includes('property="og:video" content="https://va.media.tumblr.com/')) return { error: 'ErrorEmptyDownload' };
|
||||
|
||||
return { urls: `https://va.media.tumblr.com/${html.split('property="og:video" content="https://va.media.tumblr.com/')[1].split('"')[0]}`, audioFilename: `tumblr_${obj.id}_audio` }
|
||||
return { urls: `https://va.media.tumblr.com/${html.split('property="og:video" content="https://va.media.tumblr.com/')[1].split('"')[0]}`, filename: `tumblr_${obj.id}.mp4`, audioFilename: `tumblr_${obj.id}_audio` }
|
||||
}
|
||||
|
8
src/modules/processing/services/vine.js
Normal file
8
src/modules/processing/services/vine.js
Normal file
@ -0,0 +1,8 @@
|
||||
export default async function(obj) {
|
||||
let post = await fetch(`https://archive.vine.co/posts/${obj.id}.json`).then((r) => { return r.json() }).catch(() => { return false });
|
||||
if (!post) return { error: 'ErrorEmptyDownload' };
|
||||
|
||||
if (post.videoUrl) return { urls: post.videoUrl.replace("http://", "https://"), filename: `vine_${obj.id}.mp4`, audioFilename: `vine_${obj.id}_audio` };
|
||||
|
||||
return { error: 'ErrorEmptyDownload' }
|
||||
}
|
@ -56,6 +56,12 @@
|
||||
"alias": "instagram reels & video posts",
|
||||
"patterns": ["reels/:id", "reel/:id", "p/:id"],
|
||||
"enabled": true
|
||||
},
|
||||
"vine": {
|
||||
"alias": "vine archive",
|
||||
"tld": "co",
|
||||
"patterns": ["v/:id"],
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,5 +26,7 @@ export const testers = {
|
||||
"soundcloud": (patternMatch) => ((patternMatch["author"] && patternMatch["song"]
|
||||
&& (patternMatch["author"].length + patternMatch["song"].length) <= 96) || (patternMatch["shortLink"] && patternMatch["shortLink"].length <= 32)),
|
||||
|
||||
"instagram": (patternMatch) => (patternMatch["id"] && patternMatch["id"].length <= 12)
|
||||
"instagram": (patternMatch) => (patternMatch["id"] && patternMatch["id"].length <= 12),
|
||||
|
||||
"vine": (patternMatch) => (patternMatch["id"] && patternMatch["id"].length <= 12)
|
||||
}
|
||||
|
Reference in New Issue
Block a user