@@ -267,12 +267,11 @@ Namespace API.YouTube.Objects
267267 <XMLEC(CollectionMode:=CollectionModes.String)>
268268 Friend ReadOnly Property PostProcessing_OutputAudioFormats As List( Of String )
269269 Friend Sub PostProcessing_OutputAudioFormats_Reset()
270- PostProcessing_OutputAudioFormats.Clear()
271- PostProcessing_OutputAudioFormats.ListAddList(MyYouTubeSettings.DefaultAudioCodecAddit)
272- If PostProcessing_OutputAudioFormats.Count > 0 Then
273- PostProcessing_OutputAudioFormats.Sort()
274- PostProcessing_OutputAudioFormats.RemoveAll( Function (s) s = - 1 )
275- End If
270+ With PostProcessing_OutputAudioFormats
271+ .Clear()
272+ .ListAddList(MyYouTubeSettings.DefaultAudioCodecAddit)
273+ If .Count > 0 Then .Sort()
274+ End With
276275 End Sub
277276 <XMLEC( "OutputAudioBitrate" )> Protected _OutputAudioBitrate As Integer = - 1
278277 Friend Property OutputAudioBitrate As Integer
@@ -322,21 +321,19 @@ Namespace API.YouTube.Objects
322321 <XMLEC(CollectionMode:=CollectionModes.String)>
323322 Friend ReadOnly Property PostProcessing_OutputSubtitlesFormats As List( Of String )
324323 Friend Sub PostProcessing_OutputSubtitlesFormats_Reset()
325- PostProcessing_OutputSubtitlesFormats.Clear()
326- PostProcessing_OutputSubtitlesFormats.ListAddList(MyYouTubeSettings.DefaultSubtitlesFormatAddit)
327- If PostProcessing_OutputSubtitlesFormats.Count > 0 Then
328- PostProcessing_OutputSubtitlesFormats.Sort()
329- PostProcessing_OutputSubtitlesFormats.RemoveAll( Function (s) s = - 1 )
330- End If
324+ With PostProcessing_OutputSubtitlesFormats
325+ .Clear()
326+ .ListAddList(MyYouTubeSettings.DefaultSubtitlesFormatAddit)
327+ If .Count > 0 Then .Sort()
328+ End With
331329 End Sub
332330 Friend Sub SubtitlesSelectedIndexesReset()
333- SubtitlesSelectedIndexes.Clear()
334- Dim subs As List( Of Subtitles) = Subtitles
335- SubtitlesSelectedIndexes.ListAddList(MyYouTubeSettings.DefaultSubtitles.Select( Function (s) subs.FindIndex( Function (ss) ss.ID = s)))
336- If SubtitlesSelectedIndexes.Count > 0 Then
337- SubtitlesSelectedIndexes.Sort()
338- SubtitlesSelectedIndexes.RemoveAll( Function (s) s = - 1 )
339- End If
331+ With SubtitlesSelectedIndexes
332+ .Clear()
333+ Dim subs As List( Of Subtitles) = Subtitles
334+ .ListAddList(MyYouTubeSettings.DefaultSubtitles.Select( Function (s) subs.FindIndex( Function (ss) ss.ID = s)))
335+ If .Count > 0 Then .Sort() : .RemoveAll( Function (s) s = - 1 )
336+ End With
340337 End Sub
341338 Private Sub SetElementsSubtitles( ByVal Source As YouTubeMediaContainerBase)
342339 If Not Source Is Nothing And HasElements Then
@@ -442,6 +439,19 @@ Namespace API.YouTube.Objects
442439 End Get
443440 End Property
444441 <XMLEC> Public Property Height As Integer Implements IYouTubeMediaContainer.Height
442+ Friend ReadOnly Property HeightBase As Integer
443+ Get
444+ If Height > 0 Then
445+ Return Height
446+ ElseIf SelectedVideoIndex.ValueBetween( 0 , MediaObjects.Count - 1 ) Then
447+ Return SelectedVideo.Height
448+ ElseIf SelectedAudioIndex.ValueBetween( 0 , MediaObjects.Count - 1 ) Then
449+ Return SelectedAudio.Height
450+ Else
451+ Return 0
452+ End If
453+ End Get
454+ End Property
445455 Protected _Bitrate As Integer = 0
446456 <XMLEC> Public Overridable Property Bitrate As Integer Implements IYouTubeMediaContainer.Bitrate
447457 Get
@@ -459,6 +469,20 @@ Namespace API.YouTube.Objects
459469 Me ._Bitrate = _Bitrate
460470 End Set
461471 End Property
472+ Friend ReadOnly Property BitrateBase As Integer
473+ Get
474+ If Bitrate > 0 Then
475+ Return Bitrate
476+ ElseIf OutputAudioBitrate > 0 Then
477+ Return OutputAudioBitrate
478+ ElseIf HasElements Then
479+ Try : Return Elements.Average( Function (e) DirectCast (e, YouTubeMediaContainerBase).BitrateBase) : Catch : End Try
480+ ElseIf SelectedAudioIndex.ValueBetween( 0 , MediaObjects.Count - 1 ) Then
481+ Return SelectedAudio.Bitrate
482+ End If
483+ Return 0
484+ End Get
485+ End Property
462486 <XMLEC> Public Property DateCreated As Date = Now Implements IYouTubeMediaContainer.DateCreated
463487 <XMLEC> Public Property DateAdded As Date Implements IYouTubeMediaContainer.DateAdded
464488 Private Property IUserMedia_PostDate As Date ? Implements IUserMedia.PostDate
@@ -975,7 +999,7 @@ Namespace API.YouTube.Objects
975999 .Visible = True
9761000 .Value = 0
9771001 .Maximum = DownloadGetElemCountSingle()
978- .Information = $ "Download {ObjectType} "
1002+ .Information = "Downloading "
9791003 End With
9801004 End If
9811005
@@ -1120,7 +1144,7 @@ Namespace API.YouTube.Objects
11201144 .Value = 0
11211145 .Maximum = 100
11221146 .Provider = ProgressProvider
1123- .Information = $ "Download {MediaType} "
1147+ .Information = "Downloading "
11241148 End With
11251149 End If
11261150 .MainProcessName = MyYouTubeSettings.YTDLP.Name '"yt-dlp"
@@ -1305,6 +1329,7 @@ Namespace API.YouTube.Objects
13051329 If format = mp3 And Not mp3ThumbEmbedded And MyYouTubeSettings.DefaultAudioEmbedThumbnail_ExtractedFiles Then _
13061330 embedThumbTo.Invoke(f) : mp3ThumbEmbedded = True
13071331 If Not M3U8_PlaylistFiles.ListExists AndAlso f.Exists Then M3U8_Append(f)
1332+ If format = mp3 AndAlso f.Exists AndAlso MyYouTubeSettings.VideoPlaylist_AddExtractedMP3.Value Then M3U8_Append(f)
13081333 End If
13091334 Next
13101335 End If
0 commit comments