@@ -92,7 +92,7 @@ Namespace API.Reddit
92
92
Dim URL$ = String .Empty
93
93
Try
94
94
Dim PostID$ = String .Empty
95
- Dim PostDate$, PostTitle$
95
+ Dim PostDate$
96
96
Dim n As EContainer, nn As EContainer, s As EContainer
97
97
Dim NewPostDetected As Boolean = False
98
98
Dim ExistsDetected As Boolean = False
@@ -124,30 +124,29 @@ Namespace API.Reddit
124
124
ExistsDetected = True
125
125
Continue For
126
126
End If
127
- PostTitle = nn.Value( "title" )
128
127
129
128
If CheckNode(nn) Then
130
129
_ItemsBefore = _TempMediaList.Count
131
130
added = True
132
131
s = nn.ItemF({ "source" , "url" })
133
132
If s.XmlIfNothingValue( "/" ).Contains( "redgifs.com" ) Then
134
- _TempMediaList.ListAddValue(MediaFromData(UTypes.VideoPre, s.Value, PostID, PostDate,, IsChannel, PostTitle ), LNC)
133
+ _TempMediaList.ListAddValue(MediaFromData(UTypes.VideoPre, s.Value, PostID, PostDate,, IsChannel), LNC)
135
134
Else
136
135
s = nn.ItemF({ "media" }).XmlIfNothing
137
136
__ItemType = s( "type" ).XmlIfNothingValue
138
137
Select Case __ItemType
139
- Case "gallery" : If Not DownloadGallery(s, PostID, PostDate,,, PostTitle ) Then added = False
138
+ Case "gallery" : If Not DownloadGallery(s, PostID, PostDate) Then added = False
140
139
Case "image" , "gifvideo"
141
140
If s.Contains( "content" ) Then
142
141
_TempMediaList.ListAddValue(MediaFromData(UPicType(__ItemType), s.Value( "content" ),
143
- PostID, PostDate,, IsChannel, PostTitle ), LNC)
142
+ PostID, PostDate,, IsChannel), LNC)
144
143
Else
145
144
added = False
146
145
End If
147
146
Case "video"
148
147
If Settings.UseM3U8 AndAlso s( "hlsUrl" ).XmlIfNothingValue( "/" ).ToLower.Contains( "m3u8" ) Then
149
148
_TempMediaList.ListAddValue(MediaFromData(UTypes.m3u8, s.Value( "hlsUrl" ),
150
- PostID, PostDate,, IsChannel, PostTitle ), LNC)
149
+ PostID, PostDate,, IsChannel), LNC)
151
150
Else
152
151
added = False
153
152
End If
@@ -167,7 +166,7 @@ Namespace API.Reddit
167
166
End Select
168
167
End With
169
168
If Not tmpType = UTypes.Undefined Then
170
- _TempMediaList.ListAddValue(MediaFromData(tmpType, s.Value, PostID, PostDate,, IsChannel, PostTitle ), LNC)
169
+ _TempMediaList.ListAddValue(MediaFromData(tmpType, s.Value, PostID, PostDate,, IsChannel), LNC)
171
170
End If
172
171
End If
173
172
End If
@@ -270,8 +269,7 @@ Namespace API.Reddit
270
269
# End Region
271
270
# Region "Download Base Functions"
272
271
Private Function DownloadGallery( ByVal w As EContainer, ByVal PostID As String , ByVal PostDate As String ,
273
- Optional ByVal _UserID As String = Nothing , Optional ByVal FirstOnly As Boolean = False ,
274
- Optional ByVal Title As String = Nothing ) As Boolean
272
+ Optional ByVal _UserID As String = Nothing , Optional ByVal FirstOnly As Boolean = False ) As Boolean
275
273
Try
276
274
Dim added As Boolean = False
277
275
Dim cn$ = IIf(IsChannel, "media_metadata" , "mediaMetadata" )
@@ -280,7 +278,7 @@ Namespace API.Reddit
280
278
For Each n As EContainer In w(cn)
281
279
t = n.ItemF({ "s" , "u" })
282
280
If Not t Is Nothing AndAlso Not t.Value.IsEmptyString Then
283
- _TempMediaList.ListAddValue(MediaFromData(UTypes.Picture, t.Value, PostID, PostDate, _UserID, IsChannel, Title ), LNC)
281
+ _TempMediaList.ListAddValue(MediaFromData(UTypes.Picture, t.Value, PostID, PostDate, _UserID, IsChannel), LNC)
284
282
added = True
285
283
If FirstOnly Then Exit For
286
284
End If
@@ -340,15 +338,13 @@ Namespace API.Reddit
340
338
# End Region
341
339
# Region "Structure creator"
342
340
Protected Shared Function MediaFromData( ByVal t As UTypes, ByVal _URL As String , ByVal PostID As String , ByVal PostDate As String ,
343
- Optional ByVal _UserID As String = "" , Optional ByVal IsChannel As Boolean = False ,
344
- Optional ByVal Title As String = Nothing ) As UserMedia
341
+ Optional ByVal _UserID As String = "" , Optional ByVal IsChannel As Boolean = False ) As UserMedia
345
342
If _URL.IsEmptyString And t = UTypes.Picture Then Return Nothing
346
343
_URL = LinkFormatterSecure(RegexReplace(_URL.Replace( "\" , String .Empty), LinkPattern))
347
344
Dim m As New UserMedia(_URL, t) With {.Post = New UserPost With {.ID = PostID, .UserID = _UserID}}
348
345
If t = UTypes.Picture Or t = UTypes.GIF Then m.File = UrlToFile(m.URL) Else m.File = Nothing
349
346
If m.URL.Contains( "preview" ) Then m.URL = $"https://i.redd.it/{m.File.File}"
350
347
If Not PostDate.IsEmptyString Then m.Post.Date = AConvert( Of Date )(PostDate, If (IsChannel, DateProviderChannel, DateProvider), Nothing ) Else m.Post.Date = Nothing
351
- If Not Title.IsEmptyString Then m.Post.Title = Title
352
348
Return m
353
349
End Function
354
350
Private Function TryFile( ByVal URL As String ) As Boolean
0 commit comments