mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
youtube: better audio checking
This commit is contained in:
parent
7071157580
commit
57051968f3
1 changed files with 3 additions and 3 deletions
|
@ -176,7 +176,7 @@ export default async function(o) {
|
||||||
|
|
||||||
if (bestQuality) bestQuality = qual(bestQuality);
|
if (bestQuality) bestQuality = qual(bestQuality);
|
||||||
|
|
||||||
if (!bestQuality && !o.isAudioOnly || !hasAudio)
|
if ((!bestQuality && !o.isAudioOnly) || !hasAudio)
|
||||||
return { error: 'ErrorYTTryOtherCodec' };
|
return { error: 'ErrorYTTryOtherCodec' };
|
||||||
|
|
||||||
if (basicInfo.duration > env.durationLimit)
|
if (basicInfo.duration > env.durationLimit)
|
||||||
|
@ -227,7 +227,7 @@ export default async function(o) {
|
||||||
youtubeDubName: isDubbed ? o.dubLang : false
|
youtubeDubName: isDubbed ? o.dubLang : false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasAudio && o.isAudioOnly) return {
|
if (audio && o.isAudioOnly) return {
|
||||||
type: "render",
|
type: "render",
|
||||||
isAudioOnly: true,
|
isAudioOnly: true,
|
||||||
urls: audio.decipher(yt.session.player),
|
urls: audio.decipher(yt.session.player),
|
||||||
|
@ -252,7 +252,7 @@ export default async function(o) {
|
||||||
|
|
||||||
const video = adaptive_formats.find(checkRender);
|
const video = adaptive_formats.find(checkRender);
|
||||||
|
|
||||||
if (!match && video) {
|
if (!match && video && audio) {
|
||||||
match = video;
|
match = video;
|
||||||
type = "render";
|
type = "render";
|
||||||
urls = [
|
urls = [
|
||||||
|
|
Loading…
Reference in a new issue