Skip to content

Commit 52a43b9

Browse files
committed
2024.1.26.0
YT YouTubeSettings: add property DefaultVideoFPS VideoOptionsForm, YouTubeMediaContainerBase: add FPS reduction SCrawler API.Instagram: change back aspect ratio determining API.TikTok: add the ability to use a regex to clean the title API.YouTube: add the ability to ignore community errors
1 parent 5bc559c commit 52a43b9

17 files changed

Lines changed: 418 additions & 172 deletions

File tree

Changelog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# 2024.1.26.0
2+
3+
*2024-01-26*
4+
5+
- Added
6+
- YouTube (standalone app): **the ability to reduce video FPS**
7+
- TikTok: the ability to use a regex to clean the title
8+
- YouTube (SCrawler): the ability to ignore community errors
9+
- Fixed
10+
- Instagram: stories (user) downloading with the wrong aspect ratio for some users
11+
- Minor bugs
12+
113
# 2024.1.20.0
214

315
*2024-01-20*

SCrawler.YouTube/Base/YouTubeSettings.vb

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Imports PersonalUtilities.Forms
1515
Imports PersonalUtilities.Functions.XML
1616
Imports PersonalUtilities.Functions.XML.Base
1717
Imports PersonalUtilities.Functions.XML.Objects
18+
Imports PersonalUtilities.Functions.XML.Attributes
1819
Imports PersonalUtilities.Functions.XML.Attributes.Specialized
1920
Imports PersonalUtilities.Tools
2021
Imports PersonalUtilities.Tools.Grid.Base
@@ -275,6 +276,71 @@ Namespace API.YouTube.Base
275276
<Browsable(True), GridVisible, XMLVN({"DefaultsVideo"}), Category("Defaults Video"), DisplayName("Include zero size formats"),
276277
Description("Include formats with zero size (or undefined size).")>
277278
Public ReadOnly Property DefaultVideoIncludeNullSize As XMLValue(Of Boolean)
279+
<Browsable(False), XMLV("DefaultVideoFPS", {"DefaultsVideo"}, -1)>
280+
Private ReadOnly Property DefaultVideoFPS_XML As XMLValue(Of Double)
281+
<Browsable(True), GridVisible, Category("Defaults Video"), DisplayName("Defaults Video FPS"),
282+
Description("Set default video FPS (only to reduce video FPS). Default: -1 (disabled)."),
283+
TypeConverter(GetType(FieldsTypeConverter)), GridFormatProvider(GetType(FpsFormatProvider))>
284+
Public Property DefaultVideoFPS As Double
285+
Get
286+
Return DefaultVideoFPS_XML
287+
End Get
288+
Set(ByVal fps As Double)
289+
DefaultVideoFPS_XML.Value = fps
290+
End Set
291+
End Property
292+
Private Function ShouldSerializeDefaultVideoFPS() As Boolean
293+
Return DefaultVideoFPS <> DefaultVideoFPS_XML.Value
294+
End Function
295+
Private Sub ResetDefaultVideoFPS()
296+
DefaultVideoFPS = -1
297+
End Sub
298+
Friend Class FpsFormatProvider : Implements IGridConversionProvider
299+
Private Property Converter As TypeConverter Implements IGridConversionProvider.Converter
300+
Private Property Context As ITypeDescriptorContext Implements IGridConversionProvider.Context
301+
Private Property DataType As Type Implements IGridConversionProvider.DataType
302+
Private Property Instance As Object Implements IGridConversionProvider.Instance
303+
Friend Shared ReadOnly Property MyProviderDefault As ANumbers
304+
Get
305+
Return New ANumbers(ANumbers.Cultures.Primitive) With {.DecimalDigits = 5, .TrimDecimalDigits = True}
306+
End Get
307+
End Property
308+
Friend Const ErrorMessageDefault As String = "The fps value must be a number"
309+
Private ReadOnly MyProvider As ANumbers = MyProviderDefault
310+
Friend Function ToObject(ByVal Context As ITypeDescriptorContext, ByVal Culture As CultureInfo, ByVal Value As Object) As Object Implements IGridConversionProvider.ToObject
311+
Return AConvert(Of Double)(Value, MyProvider, -1)
312+
End Function
313+
Friend Overloads Function ToString(ByVal Context As ITypeDescriptorContext, ByVal Culture As CultureInfo, ByVal Value As Object,
314+
ByVal DestinationType As Type) As Object Implements IGridConversionProvider.ToString
315+
If ACheck(Of Double)(Value, AModes.Var, MyProvider) Then
316+
Return Value.ToString
317+
Else
318+
Return -1
319+
End If
320+
End Function
321+
Friend Function CreateInstance(ByVal Context As ITypeDescriptorContext, ByVal NewValue As Object, ByRef RefreshGrid As Boolean) As Object Implements IGridConversionProvider.CreateInstance
322+
If ACheck(Of Double)(NewValue, AModes.Var, MyProvider) Then
323+
Return NewValue
324+
Else
325+
RefreshGrid = True
326+
Return -1
327+
End If
328+
End Function
329+
Friend Function Convert(ByVal Value As Object, ByVal DestinationType As Type, ByVal Provider As IFormatProvider,
330+
Optional ByVal NothingArg As Object = Nothing, Optional ByVal e As ErrorsDescriber = Nothing) As Object Implements ICustomProvider.Convert
331+
Return AConvert(Value, AModes.Var, DestinationType,, True, -1, MyProvider, EDP.ReturnValue)
332+
End Function
333+
Friend Function IsValid(ByVal Context As ITypeDescriptorContext, ByVal Value As Object, ByVal DestinationType As Type) As Boolean Implements IGridValidator.IsValid
334+
If ACheck(Of Double)(Value, AModes.Var, MyProvider) Then
335+
Return True
336+
Else
337+
Throw New FormatException(ErrorMessageDefault)
338+
End If
339+
End Function
340+
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
341+
Throw New NotImplementedException("'GetFormat' is not available in 'FpsFormatProvider'")
342+
End Function
343+
End Class
278344
#End Region
279345
#Region "Defaults Audio"
280346
<Browsable(True), GridVisible, XMLVN({"DefaultsAudio"}, "AAC"), Category("Defaults Audio"), DisplayName("Default codec"),

0 commit comments

Comments
 (0)