@@ -695,25 +695,29 @@ export default defineComponent({
695
695
/** @type {import('../../helpers/api/local').LocalFormat[] } */
696
696
const formats = [ ...result . streaming_data . formats , ...result . streaming_data . adaptive_formats ]
697
697
698
- const downloadLinks = formats . map ( ( format ) => {
699
- const qualityLabel = format . quality_label ?? format . bitrate
700
- const fps = format . fps ? `${ format . fps } fps` : 'kbps'
701
- const type = format . mime_type . split ( ';' ) [ 0 ]
702
- let label = `${ qualityLabel } ${ fps } - ${ type } `
703
-
704
- if ( format . has_audio !== format . has_video ) {
705
- if ( format . has_video ) {
706
- label += ` ${ this . $t ( 'Video.video only' ) } `
707
- } else {
708
- label += ` ${ this . $t ( 'Video.audio only' ) } `
698
+ const downloadLinks = [ ]
699
+
700
+ for ( const format of formats ) {
701
+ if ( format . freeTubeUrl ) {
702
+ const qualityLabel = format . quality_label ?? format . bitrate
703
+ const fps = format . fps ? `${ format . fps } fps` : 'kbps'
704
+ const type = format . mime_type . split ( ';' ) [ 0 ]
705
+ let label = `${ qualityLabel } ${ fps } - ${ type } `
706
+
707
+ if ( format . has_audio !== format . has_video ) {
708
+ if ( format . has_video ) {
709
+ label += ` ${ this . $t ( 'Video.video only' ) } `
710
+ } else {
711
+ label += ` ${ this . $t ( 'Video.audio only' ) } `
712
+ }
709
713
}
710
- }
711
714
712
- return {
713
- url : format . freeTubeUrl ,
714
- label : label
715
+ downloadLinks . push ( {
716
+ url : format . freeTubeUrl ,
717
+ label : label
718
+ } )
715
719
}
716
- } )
720
+ }
717
721
718
722
if ( result . captions ) {
719
723
const captionTracks = result . captions ?. caption_tracks ?. map ( ( caption ) => {
@@ -779,7 +783,7 @@ export default defineComponent({
779
783
return
780
784
}
781
785
782
- if ( result . streaming_data ?. adaptive_formats . length > 0 ) {
786
+ if ( result . streaming_data ?. adaptive_formats . length > 0 && result . streaming_data . adaptive_formats [ 0 ] . freeTubeUrl ) {
783
787
this . vrProjection = result . streaming_data . adaptive_formats
784
788
. find ( format => {
785
789
return format . has_video &&
0 commit comments