Update src/libpoketube/init/pages-video.js

This commit is contained in:
ashley 2024-07-03 21:00:40 +00:00
parent 8cc53b114b
commit 5c62905ce5

View file

@ -243,28 +243,9 @@ module.exports = function (app, config, renderTemplate) {
const videoObject = inv_vid?.adaptiveFormats; const videoObject = inv_vid?.adaptiveFormats;
function findItag(adaptiveFormats) { function findItag(adaptiveFormats) {
let itag298 = null; return;
let itag136 = null;
adaptiveFormats.forEach((format) => {
if (format.itag == 298) {
itag298 = format;
}
if (format.itag == 136) {
itag136 = format;
}
});
if (itag298 && itag136) {
return { itag298, itag136 };
} else if (itag298) {
return itag298;
} else if (itag136) {
return itag136;
} else {
return null;
}
} }
const itag_hd = findItag(videoObject); const itag_hd = findItag(videoObject);
var proxyurl = config.p_url; var proxyurl = config.p_url;
var vidurl = u.url; var vidurl = u.url;