@@ -267,12 +267,11 @@ Namespace API.YouTube.Objects
267
267
<XMLEC(CollectionMode:=CollectionModes.String)>
268
268
Friend ReadOnly Property PostProcessing_OutputAudioFormats As List( Of String )
269
269
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
276
275
End Sub
277
276
<XMLEC( "OutputAudioBitrate" )> Protected _OutputAudioBitrate As Integer = - 1
278
277
Friend Property OutputAudioBitrate As Integer
@@ -322,21 +321,19 @@ Namespace API.YouTube.Objects
322
321
<XMLEC(CollectionMode:=CollectionModes.String)>
323
322
Friend ReadOnly Property PostProcessing_OutputSubtitlesFormats As List( Of String )
324
323
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
331
329
End Sub
332
330
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
340
337
End Sub
341
338
Private Sub SetElementsSubtitles( ByVal Source As YouTubeMediaContainerBase)
342
339
If Not Source Is Nothing And HasElements Then
@@ -442,6 +439,19 @@ Namespace API.YouTube.Objects
442
439
End Get
443
440
End Property
444
441
<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
445
455
Protected _Bitrate As Integer = 0
446
456
<XMLEC> Public Overridable Property Bitrate As Integer Implements IYouTubeMediaContainer.Bitrate
447
457
Get
@@ -459,6 +469,20 @@ Namespace API.YouTube.Objects
459
469
Me ._Bitrate = _Bitrate
460
470
End Set
461
471
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
462
486
<XMLEC> Public Property DateCreated As Date = Now Implements IYouTubeMediaContainer.DateCreated
463
487
<XMLEC> Public Property DateAdded As Date Implements IYouTubeMediaContainer.DateAdded
464
488
Private Property IUserMedia_PostDate As Date ? Implements IUserMedia.PostDate
@@ -975,7 +999,7 @@ Namespace API.YouTube.Objects
975
999
.Visible = True
976
1000
.Value = 0
977
1001
.Maximum = DownloadGetElemCountSingle()
978
- .Information = $ "Download {ObjectType} "
1002
+ .Information = "Downloading "
979
1003
End With
980
1004
End If
981
1005
@@ -1120,7 +1144,7 @@ Namespace API.YouTube.Objects
1120
1144
.Value = 0
1121
1145
.Maximum = 100
1122
1146
.Provider = ProgressProvider
1123
- .Information = $ "Download {MediaType} "
1147
+ .Information = "Downloading "
1124
1148
End With
1125
1149
End If
1126
1150
.MainProcessName = MyYouTubeSettings.YTDLP.Name '"yt-dlp"
@@ -1305,6 +1329,7 @@ Namespace API.YouTube.Objects
1305
1329
If format = mp3 And Not mp3ThumbEmbedded And MyYouTubeSettings.DefaultAudioEmbedThumbnail_ExtractedFiles Then _
1306
1330
embedThumbTo.Invoke(f) : mp3ThumbEmbedded = True
1307
1331
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)
1308
1333
End If
1309
1334
Next
1310
1335
End If
0 commit comments