prevent crash if youtube video is fucked up

ill remake a youtube function to pick a good video instead of broken one later, i just dont want cobalt to hang if one youtube cdn is down

i hate youtube so much
This commit is contained in:
wukko
2022-08-14 23:09:06 +06:00
parent 7ff5f56538
commit a5e081e2bf
3 changed files with 34 additions and 22 deletions

View File

@@ -2,7 +2,7 @@ import { apiJSON } from "../sub/utils.js";
import { verifyStream } from "./manage.js";
import { streamAudioOnly, streamDefault, streamLiveRender } from "./types.js";
export default function(res, ip, id, hmac, exp, lang) {
export default function(res, ip, id, hmac, exp) {
try {
let streamInfo = verifyStream(ip, id, hmac, exp, process.env.streamSalt);
if (!streamInfo.error) {
@@ -11,10 +11,10 @@ export default function(res, ip, id, hmac, exp, lang) {
} else {
switch (streamInfo.type) {
case "render":
streamLiveRender(streamInfo, res, lang);
streamLiveRender(streamInfo, res);
break;
default:
streamDefault(streamInfo, res, lang);
streamDefault(streamInfo, res);
break;
}
}