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

@@ -6,7 +6,7 @@ export default function(res, ip, id, hmac, exp) {
try {
let streamInfo = verifyStream(ip, id, hmac, exp, process.env.streamSalt);
if (!streamInfo.error) {
if (streamInfo.isAudioOnly) {
if (streamInfo.isAudioOnly && streamInfo.type == "render") {
streamAudioOnly(streamInfo, res);
} else {
switch (streamInfo.type) {

View File

@@ -81,7 +81,7 @@ export async function streamAudioOnly(streamInfo, res) {
if (streamInfo.service == "bilibili") {
headers = { "user-agent": genericUserAgent };
}
const audio = got.get(streamInfo.urls[0], { isStream: true, headers: headers });
const audio = got.get(streamInfo.urls, { isStream: true, headers: headers });
const ffmpegProcess = spawn(ffmpeg, [
'-loglevel', '-8',
'-i', 'pipe:3',