mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-22 10:46:19 +01:00
api/youtube: expect one of itags to be empty
This commit is contained in:
parent
0ab3fe4d2a
commit
ee3ef60a20
1 changed files with 3 additions and 3 deletions
|
@ -351,7 +351,7 @@ export default async function (o) {
|
|||
Number(b.bitrate) - Number(a.bitrate)
|
||||
).forEach(format => {
|
||||
Object.keys(codecList).forEach(yCodec => {
|
||||
const matchingItag = slot => !itag || itag[slot] === format.itag;
|
||||
const matchingItag = slot => !itag?.[slot] || itag[slot] === format.itag;
|
||||
const sorted = sorted_formats[yCodec];
|
||||
const goodFormat = checkFormat(format, yCodec);
|
||||
if (!goodFormat) return;
|
||||
|
@ -453,8 +453,8 @@ export default async function (o) {
|
|||
}
|
||||
|
||||
itag = {
|
||||
video: video.itag,
|
||||
audio: audio.itag
|
||||
video: video?.itag,
|
||||
audio: audio?.itag
|
||||
};
|
||||
|
||||
const originalRequest = {
|
||||
|
|
Loading…
Reference in a new issue