fixes
- fixed neighbor quality picking for youtube videos - webm is now default for youtube downloads for all platforms except for ios - even more readme changes - a tiny bit of clean up - preparing stuff for next major update
This commit is contained in:
@@ -24,7 +24,7 @@ export default async function (host, patternMatch, url, ip, lang, format, qualit
|
||||
id: patternMatch["id"],
|
||||
lang: lang
|
||||
});
|
||||
return (!r.error) ? apiJSON(1, { u: r.split('?')[0] }) : apiJSON(0, { t: r.error });
|
||||
return (!r.error) ? apiJSON(1, { u: r }) : apiJSON(0, { t: r.error });
|
||||
|
||||
case "vk":
|
||||
r = await vk({
|
||||
|
||||
@@ -39,11 +39,7 @@ export default async function (obj) {
|
||||
if (parsbod.hasOwnProperty("extended_entities") && parsbod["extended_entities"].hasOwnProperty("media")) {
|
||||
if (parsbod["extended_entities"]["media"][0]["type"] === "video" || parsbod["extended_entities"]["media"][0]["type"] === "animated_gif") {
|
||||
let variants = parsbod["extended_entities"]["media"][0]["video_info"]["variants"]
|
||||
return variants.filter((v) => {
|
||||
if (v["content_type"] == "video/mp4") {
|
||||
return true
|
||||
}
|
||||
}).sort((a, b) => Number(b.bitrate) - Number(a.bitrate))[0]["url"]
|
||||
return variants.filter((v) => { if (v["content_type"] == "video/mp4") return true; }).sort((a, b) => Number(b.bitrate) - Number(a.bitrate))[0]["url"].split('?')[0];
|
||||
} else {
|
||||
return nothing
|
||||
}
|
||||
|
||||
@@ -27,9 +27,9 @@ export default async function (obj) {
|
||||
}).sort((a, b) => Number(b.bitrate) - Number(a.bitrate));
|
||||
if (obj.quality != "max") {
|
||||
if (videoMatch.length == 0) {
|
||||
let ss = selectQuality("youtube", obj.quality, video[0]["height"])
|
||||
let ss = selectQuality("youtube", obj.quality, video[0]["qualityLabel"].slice(0, 5).replace('p', '').trim())
|
||||
videoMatch = video.filter((a) => {
|
||||
if (a["height"] == ss) return true;
|
||||
if (a["qualityLabel"].slice(0, 5).replace('p', '').trim() == ss) return true;
|
||||
})
|
||||
} else if (fullVideoMatch.length > 0) {
|
||||
videoMatch = [fullVideoMatch[0]]
|
||||
|
||||
@@ -82,14 +82,16 @@ export async function streamAudioOnly(streamInfo, res) {
|
||||
headers = { "user-agent": genericUserAgent };
|
||||
}
|
||||
const audio = got.get(streamInfo.urls, { isStream: true, headers: headers });
|
||||
const ffmpegProcess = spawn(ffmpeg, [
|
||||
let format = streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1], args = [
|
||||
'-loglevel', '-8',
|
||||
'-i', 'pipe:3',
|
||||
'-vn',
|
||||
'-c:a', 'copy',
|
||||
'-f', `${streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1]}`,
|
||||
'pipe:4',
|
||||
], {
|
||||
];
|
||||
args = args.concat(ffmpegArgs[format])
|
||||
if (streamInfo.time) args.push('-t', msToTime(streamInfo.time));
|
||||
args.push('-f', format, 'pipe:4');
|
||||
|
||||
const ffmpegProcess = spawn(ffmpeg, args, {
|
||||
windowsHide: true,
|
||||
stdio: [
|
||||
'inherit', 'inherit', 'inherit',
|
||||
|
||||
Reference in New Issue
Block a user