Skip to content

Commit 0cacba4

Browse files
committed
2.0.0.1
Added download individual imgur media Fixed missing file Updated global settings form Fixed incorrect filling user params
1 parent 69ded7b commit 0cacba4

9 files changed

+238
-201
lines changed

Changelog.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 2.0.0.1
2+
3+
- Added
4+
- Download individual Imgur media files (use the "Download video" form).
5+
- Fixed
6+
- Incorrect filling of user parameters in the user creation form
7+
- In some cases, the global settings cannot be saved.
8+
19
# 2.0.0.0
210

311
- Added
@@ -6,7 +14,7 @@
614
- Group for regular channels in the main window
715
- Ability to change user/collection path
816
- Imgur albums downloading
9-
- NSFW Imgur content bypass (requires 'CilentID')
17+
- NSFW Imgur content bypass (requires 'ClientID')
1018
- Special user folder
1119
- Remove user while keeping data
1220
- Disabled overriding user preferences when creating a new user if it already exists in the destination (in case of deleting a user with saving data).

SCrawler/API/Imgur/Envir.vb

+22-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Imports PersonalUtilities.Functions.XML
1010
Imports PersonalUtilities.Tools.WebDocuments.JSON
1111
Imports System.Net
1212
Imports SCrawler.API.Imgur.Declarations
13+
Imports SCrawler.API.Base
1314
Namespace API.Imgur.Declarations
1415
Friend Module Imgur_Declarations
1516
Friend ReadOnly PostRegex As New RegexStructure("/([\w\d]+?)(|\.[\w]{0,4})\Z", 1)
@@ -19,7 +20,7 @@ Namespace API.Imgur
1920
Friend NotInheritable Class Envir
2021
Private Sub New()
2122
End Sub
22-
Friend Shared Function GetGallery(ByVal URL As String) As List(Of String)
23+
Friend Shared Function GetGallery(ByVal URL As String, Optional ByVal e As ErrorsDescriber = Nothing) As List(Of String)
2324
Try
2425
If Not Settings.ImgurClientID.IsEmptyString And Not URL.IsEmptyString Then
2526
Dim __url$ = RegexReplace(URL, PostRegex)
@@ -45,10 +46,11 @@ Namespace API.Imgur
4546
End If
4647
Return Nothing
4748
Catch ex As Exception
48-
Return ErrorsDescriber.Execute(EDP.ReturnValue + EDP.SendInLog, ex, $"[API.Imgur.Envir.GetGallery({URL})]", Nothing)
49+
If Not e.Exists Then e = New ErrorsDescriber(EDP.ReturnValue + EDP.SendInLog)
50+
Return ErrorsDescriber.Execute(e, ex, $"[API.Imgur.Envir.GetGallery({URL})]", Nothing)
4951
End Try
5052
End Function
51-
Friend Shared Function GetImage(ByVal URL As String) As String
53+
Friend Shared Function GetImage(ByVal URL As String, Optional ByVal e As ErrorsDescriber = Nothing) As String
5254
Try
5355
If Not Settings.ImgurClientID.IsEmptyString And Not URL.IsEmptyString Then
5456
Dim __url$ = RegexReplace(URL, PostRegex)
@@ -62,7 +64,23 @@ Namespace API.Imgur
6264
End If
6365
Return String.Empty
6466
Catch ex As Exception
65-
Return ErrorsDescriber.Execute(EDP.ReturnValue + EDP.SendInLog, ex, $"[API.Imgur.Envir.GetImage({URL})]", String.Empty)
67+
If Not e.Exists Then e = New ErrorsDescriber(EDP.ReturnValue + EDP.SendInLog)
68+
Return ErrorsDescriber.Execute(e, ex, $"[API.Imgur.Envir.GetImage({URL})]", String.Empty)
69+
End Try
70+
End Function
71+
Friend Shared Function GetVideoInfo(ByVal URL As String) As IEnumerable(Of UserMedia)
72+
Try
73+
If Not URL.IsEmptyString AndAlso URL.ToLower.Contains("imgur") AndAlso Not Settings.ImgurClientID.IsEmptyString Then
74+
Dim img$ = GetImage(URL, EDP.ReturnValue)
75+
If Not img.IsEmptyString Then
76+
Return {New UserMedia(img)}
77+
Else
78+
Return GetGallery(URL, EDP.ReturnValue).ListIfNothing.Select(Function(u) New UserMedia(u))
79+
End If
80+
End If
81+
Return Nothing
82+
Catch ex As Exception
83+
Return ErrorsDescriber.Execute(EDP.ShowMainMsg + EDP.SendInLog, ex, "Imgur standalone downloader: fetch media error")
6684
End Try
6785
End Function
6886
End Class

SCrawler/Editors/GlobalSettingsForm.Designer.vb

+179-177
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SCrawler/Editors/GlobalSettingsForm.resx

+9-9
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,15 @@
191191
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
192192
</value>
193193
</data>
194+
<metadata name="TP_FILE_NAME.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
195+
<value>False</value>
196+
</metadata>
197+
<metadata name="TP_FILE_PATTERNS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
198+
<value>False</value>
199+
</metadata>
200+
<metadata name="LBL_DATE_POS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
201+
<value>False</value>
202+
</metadata>
194203
<metadata name="TT_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
195204
<value>False</value>
196205
</metadata>
@@ -202,15 +211,6 @@
202211
This parameter specifies how the video will be stored in the users' download path.
203212
If checked, videos will be stored in separate folder; otherwise, videos will be stored along with images.</value>
204213
</data>
205-
<metadata name="TP_FILE_NAME.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
206-
<value>False</value>
207-
</metadata>
208-
<metadata name="TP_FILE_PATTERNS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
209-
<value>False</value>
210-
</metadata>
211-
<metadata name="LBL_DATE_POS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
212-
<value>False</value>
213-
</metadata>
214214
<metadata name="TP_CHANNELS_IMGS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
215215
<value>False</value>
216216
</metadata>

SCrawler/Editors/GlobalSettingsForm.vb

+4-4
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Namespace Editors
139139
End Select
140140
End If
141141

142-
If CH_FILE_NAME_CHANGE.Checked And (Not CH_FILE_DATE.Checked Or Not CH_FILE_TIME.Checked) Then
142+
If CH_FILE_NAME_CHANGE.Checked And (Not CH_FILE_DATE.Checked And Not CH_FILE_TIME.Checked) Then
143143
MsgBoxE({"You must select at least one option (Date and/or Time) if you want to change file names by date or disable file names changes",
144144
"File name options"}, vbCritical)
145145
Exit Sub
@@ -219,13 +219,13 @@ Namespace Editors
219219
Private Sub TXT_MAX_JOBS_CHANNELS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_MAX_JOBS_CHANNELS.ActionOnButtonClick
220220
If Sender.DefaultButton = ActionButton.DefaultButtons.Refresh Then TXT_MAX_JOBS_CHANNELS.Value = SettingsCLS.DefaultMaxDownloadingTasks
221221
End Sub
222-
Private Sub CH_FILE_NAME_CHANGE_CheckedChanged(sender As Object, e As EventArgs)
222+
Private Sub CH_FILE_NAME_CHANGE_CheckedChanged(sender As Object, e As EventArgs) Handles CH_FILE_NAME_CHANGE.CheckedChanged
223223
ChangeFileNameChangersEnabling()
224224
End Sub
225-
Private Sub OPT_FILE_NAME_REPLACE_CheckedChanged(sender As Object, e As EventArgs)
225+
Private Sub OPT_FILE_NAME_REPLACE_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_FILE_NAME_REPLACE.CheckedChanged
226226
ChangePositionControlsEnabling()
227227
End Sub
228-
Private Sub OPT_FILE_NAME_ADD_DATE_CheckedChanged(sender As Object, e As EventArgs)
228+
Private Sub OPT_FILE_NAME_ADD_DATE_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_FILE_NAME_ADD_DATE.CheckedChanged
229229
ChangePositionControlsEnabling()
230230
End Sub
231231
Private Sub ChangePositionControlsEnabling()

SCrawler/Editors/UserCreatorForm.vb

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ Namespace Editors
120120
Case Sites.Twitter : OPT_TWITTER.Checked = True
121121
Case Sites.Instagram : OPT_INSTAGRAM.Checked = True
122122
End Select
123+
SetParamsBySite()
123124
OPT_REDDIT.Enabled = False
124125
OPT_TWITTER.Enabled = False
125126
OPT_INSTAGRAM.Enabled = False
@@ -153,7 +154,6 @@ Namespace Editors
153154
.MyFieldsChecker = New FieldsChecker
154155
.MyFieldsChecker.AddControl(Of String)(TXT_USER, TXT_USER.CaptionText)
155156
.MyFieldsChecker.EndLoaderOperations()
156-
SetParamsBySite()
157157
.AppendDetectors()
158158
.EndLoaderOperations()
159159
End With

SCrawler/MainMod.vb

+12-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
' This program is distributed in the hope that it will be useful,
88
' but WITHOUT ANY WARRANTY
99
Imports PersonalUtilities.Functions.XML
10+
Imports PersonalUtilities.Tools.WEB
1011
Imports SCrawler.API
1112
Imports SCrawler.API.Base
1213
Friend Module MainMod
@@ -225,6 +226,7 @@ Friend Module MainMod
225226
If Not URL.IsEmptyString Then
226227
Dim um As IEnumerable(Of UserMedia) = Nothing
227228
Dim site As Sites
229+
Dim IsImgur As Boolean = False
228230
If URL.Contains("twitter") Then
229231
um = Twitter.UserData.GetVideoInfo(URL)
230232
site = Sites.Twitter
@@ -234,6 +236,9 @@ Friend Module MainMod
234236
ElseIf URL.Contains("instagram.com") Then
235237
um = Instagram.UserData.GetVideoInfo(URL)
236238
site = Sites.Instagram
239+
ElseIf URL.Contains("imgur.com") Then
240+
um = Imgur.Envir.GetVideoInfo(URL)
241+
IsImgur = True
237242
Else
238243
MsgBoxE("Site of video URL does not recognized" & vbCr & "Operation canceled", MsgBoxStyle.Exclamation, e)
239244
Return False
@@ -250,8 +255,8 @@ Friend Module MainMod
250255
Settings.LatestSavingPath.Value.Exists(SFO.Path, False) Then f.Path = Settings.LatestSavingPath.Value
251256
If AskForPath OrElse Not f.Exists(SFO.Path, False) Then
252257
#Disable Warning BC40000
253-
If site = Sites.Instagram Then
254-
ff = SFile.SaveAs(f, "Instagram files destination",,,, EDP.ReturnValue)
258+
If site = Sites.Instagram Or IsImgur Then
259+
ff = SFile.SaveAs(f, "Files destination",,,, EDP.ReturnValue)
255260
If Not ff.IsEmptyString Then
256261
f.Path = ff.Path
257262
Else
@@ -395,4 +400,9 @@ Friend Module MainMod
395400
Return UserBanned({UserName}).ListExists
396401
End Function
397402
#End Region
403+
Friend Sub CheckVersion(ByVal Force As Boolean)
404+
If Settings.CheckUpdatesAtStart Or Force Then _
405+
GitHub.DefaultVersionChecker(My.Application.Info.Version, "AAndyProgram", "SCrawler",
406+
Settings.LatestVersion.Value, Settings.ShowNewVersionNotification.Value, Force)
407+
End Sub
398408
End Module

SCrawler/My Project/AssemblyInfo.vb

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
3232
' by using the '*' as shown below:
3333
' <Assembly: AssemblyVersion("1.0.*")>
3434

35-
<Assembly: AssemblyVersion("2.0.0.0")>
36-
<Assembly: AssemblyFileVersion("2.0.0.0")>
35+
<Assembly: AssemblyVersion("2.0.0.1")>
36+
<Assembly: AssemblyFileVersion("2.0.0.1")>
3737
<Assembly: NeutralResourcesLanguage("en")>

SCrawler/SCrawler.vbproj

-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@
197197
<Compile Include="Editors\UserCreatorForm.vb">
198198
<SubType>Form</SubType>
199199
</Compile>
200-
<Compile Include="Info\InfoMod.vb" />
201200
<Compile Include="LabelsKeeper.vb" />
202201
<Compile Include="MainFrame.vb">
203202
<SubType>Form</SubType>

0 commit comments

Comments
 (0)