vimeo support revamp and bug fixes

- completely reworked vimeo module.
- added support for audio downloads from vimeo.
- added support for chop type of dash for vimeo.
- added ability to choose between progressive and dash vimeo downloads. both to api and settings on frontend.
- added support for single m3u8 playlists. will be useful for future additions and is currently used for vimeo.
- proper error is now shown if there are no matching vimeo videos found
- temporarily disabled douyin support because bytedance killed off old endpoint.
- fixed the issue related to periods in tiktok usernames. (closes #96)
- fixed error text value patching in match module.
- fixed video stream removal for audio only option, wouldn't work in some edge cases.
- minor clean up.
This commit is contained in:
wukko
2023-03-15 22:18:31 +06:00
parent f6ee934949
commit 6e9f9efa28
16 changed files with 149 additions and 117 deletions

View File

@@ -17,6 +17,7 @@ export default function(res, ip, id, hmac, exp) {
case "render":
streamLiveRender(streamInfo, res);
break;
case "videoM3U8":
case "mute":
streamVideoOnly(streamInfo, res);
break;

View File

@@ -92,11 +92,15 @@ export function streamAudioOnly(streamInfo, res) {
args.push('-vn')
}
args = args.concat(metadataManager(streamInfo.metadata))
} else {
args.push('-vn')
}
let arg = streamInfo.copy ? ffmpegArgs["copy"] : ffmpegArgs["audio"]
args = args.concat(arg)
let arg = streamInfo.copy ? ffmpegArgs["copy"] : ffmpegArgs["audio"];
args = args.concat(arg);
if (ffmpegArgs[streamInfo.audioFormat]) args = args.concat(ffmpegArgs[streamInfo.audioFormat]);
args.push('-f', streamInfo.audioFormat === "m4a" ? "ipod" : streamInfo.audioFormat, 'pipe:3');
const ffmpegProcess = spawn(ffmpeg, args, {
windowsHide: true,
stdio: [
@@ -126,9 +130,11 @@ export function streamVideoOnly(streamInfo, res) {
let format = streamInfo.filename.split('.')[streamInfo.filename.split('.').length - 1], args = [
'-loglevel', '-8',
'-i', streamInfo.urls,
'-c', 'copy', '-an'
'-c', 'copy'
]
if (format === "mp4") args.push('-movflags', 'faststart+frag_keyframe+empty_moov')
if (streamInfo.mute) args.push('-an');
if (streamInfo.service === "vimeo") args.push('-bsf:a', 'aac_adtstoasc');
if (format === "mp4") args.push('-movflags', 'faststart+frag_keyframe+empty_moov');
args.push('-f', format, 'pipe:3');
const ffmpegProcess = spawn(ffmpeg, args, {
windowsHide: true,
@@ -138,7 +144,7 @@ export function streamVideoOnly(streamInfo, res) {
],
});
res.setHeader('Connection', 'keep-alive');
res.setHeader('Content-Disposition', `attachment; filename="${streamInfo.filename.split('.')[0]}_mute.${format}"`);
res.setHeader('Content-Disposition', `attachment; filename="${streamInfo.filename.split('.')[0]}${streamInfo.mute ? '_mute' : ''}.${format}"`);
ffmpegProcess.stdio[3].pipe(res);
ffmpegProcess.on('disconnect', () => ffmpegProcess.kill());