Skip to content

Commit dd7f071

Browse files
committed
3.0.0.1
Added DownloadLimitDate, update and Reset functions in the plugin, DateLimit property in the IPluginContentProvider Fixed donation button link, images loading error, cookies error, instagram settings form, minor bugs.
1 parent 617a7f7 commit dd7f071

27 files changed

+262
-138
lines changed

Changelog.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 3.0.0.1
2+
3+
- Added
4+
- Download data up to a specific date
5+
- Update and Reset functions in the plugin (ISiteSettings)
6+
- PostsDateLimit propperty in the plugin (IPluginContentProvider)
7+
- Fixed
8+
- The donation button redirects to a broken link
9+
- In some cases, an error occurs when fast loading images
10+
- In some cases, cookies are not saved
11+
- Some design fixes
12+
- Minor bugs
13+
114
# 3.0.0.0
215

316
**Attention! This version of the program makes changes user data file (Users.xml). Once you start using this version, you will not be able to use previous versions of the program. Therefore, it is highly recommended to archive the program settings folder and archive the users' data files (you can use the [```ArchiveSCrawlerUsersDataFiles.bat```](Tools/ArchiveSCrawlerUsersDataFiles.bat) tool to archive the data files of all users).**

ProgramScreenshots/MainContext2.png

6.92 KB
Loading

SCrawler.PluginProvider/Interfaces/IPluginContentProvider.vb

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Namespace Plugin
2626
Property SeparateVideoFolder As Boolean
2727
Property DataPath As String
2828
Property PostsNumberLimit As Integer?
29+
Property PostsDateLimit As Date?
2930
Function ExchangeOptionsGet() As Object
3031
Sub ExchangeOptionsSet(ByVal Obj As Object)
3132
Sub XmlFieldsSet(ByVal Fields As List(Of KeyValuePair(Of String, String)))

SCrawler.PluginProvider/Interfaces/ISiteSettings.vb

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ Namespace Plugin
4141
Sub AfterDownload(ByVal User As Object, ByVal What As Download)
4242
Sub DownloadDone(ByVal What As Download)
4343
#End Region
44+
Sub Update()
45+
Sub Reset()
4446
Sub OpenSettingsForm()
4547
Sub UserOptions(ByRef Options As Object, ByVal OpenForm As Boolean)
4648
End Interface

SCrawler.PluginProvider/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("3.0.0.0")>
36-
<Assembly: AssemblyFileVersion("3.0.0.0")>
35+
<Assembly: AssemblyVersion("3.0.0.1")>
36+
<Assembly: AssemblyFileVersion("3.0.0.1")>
3737
<Assembly: NeutralResourcesLanguage("en")>

SCrawler/API/Base/SiteSettingsBase.vb

+5
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ Namespace API.Base
9797
Return True
9898
End Function
9999
#End Region
100+
Friend Overridable Sub Update() Implements ISiteSettings.Update
101+
If Not Responser Is Nothing Then Responser.SaveSettings()
102+
End Sub
103+
Friend Overridable Sub Reset() Implements ISiteSettings.Reset
104+
End Sub
100105
Friend Overridable Sub UserOptions(ByRef Options As Object, ByVal OpenForm As Boolean) Implements ISiteSettings.UserOptions
101106
Options = Nothing
102107
End Sub

SCrawler/API/Base/UserDataBase.vb

+14
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,7 @@ BlockNullPicture:
711711
#End Region
712712
#Region "Download functions and options"
713713
Friend Overridable Property DownloadTopCount As Integer? = Nothing Implements IUserData.DownloadTopCount, IPluginContentProvider.PostsNumberLimit
714+
Friend Overridable Property DownloadToDate As Date? = Nothing Implements IUserData.DownloadToDate, IPluginContentProvider.PostsDateLimit
714715
Protected Responser As PersonalUtilities.Tools.WEB.Response
715716
Friend Overridable Sub DownloadData(ByVal Token As CancellationToken) Implements IContentProvider.DownloadData
716717
Dim Canceled As Boolean = False
@@ -791,8 +792,20 @@ BlockNullPicture:
791792
If Not Canceled Then _DataParsed = True ': LastUpdated = Now
792793
_ContentNew.Clear()
793794
DownloadTopCount = Nothing
795+
DownloadToDate = Nothing
794796
End Try
795797
End Sub
798+
Protected Function CheckDatesLimit(ByVal DateString As String, ByVal DateProvider As IFormatProvider) As Boolean
799+
Try
800+
If DownloadToDate.HasValue And Not DateString.IsEmptyString Then
801+
Dim td As Date? = AConvert(Of Date)(DateString, DateProvider, Nothing)
802+
If td.HasValue Then Return td.Value < DownloadToDate.Value
803+
End If
804+
Return True
805+
Catch ex As Exception
806+
Return ErrorsDescriber.Execute(EDP.SendInLog, ex, $"[UserDataBase.CheckDatesLimit({DateString})]", True)
807+
End Try
808+
End Function
796809
Protected Sub UpdateDataFiles()
797810
If Not User.File.IsEmptyString Then
798811
MyFileData = User.File
@@ -1236,6 +1249,7 @@ BlockNullPicture:
12361249
Sub OpenFolder()
12371250
ReadOnly Property Self As IUserData
12381251
Property DownloadTopCount As Integer?
1252+
Property DownloadToDate As Date?
12391253
Sub SetEnvironment(ByRef h As SettingsHost, ByVal u As UserInfo, ByVal _LoadUserInformation As Boolean,
12401254
Optional ByVal AttachUserInfo As Boolean = True)
12411255
ReadOnly Property Disposed As Boolean

SCrawler/API/Instagram/SiteSettings.vb

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Namespace API.Instagram
7171
Friend ReadOnly Property RequestsWaitTimer As PropertyValue
7272
<Provider(NameOf(RequestsWaitTimer), FieldsChecker:=True)>
7373
Private ReadOnly Property RequestsWaitTimerProvider As IFormatProvider
74-
<PropertyOption(ControlText:="Request timer counter", AllowNull:=False), PXML("RequestsWaitTimerTaskCount"), ControlNumber(6)>
74+
<PropertyOption(ControlText:="Request timer counter", AllowNull:=False, LeftOffset:=120), PXML("RequestsWaitTimerTaskCount"), ControlNumber(6)>
7575
Friend ReadOnly Property RequestsWaitTimerTaskCount As PropertyValue
7676
<Provider(NameOf(RequestsWaitTimerTaskCount), FieldsChecker:=True)>
7777
Private ReadOnly Property RequestsWaitTimerTaskCountProvider As IFormatProvider

SCrawler/API/Instagram/UserData.vb

+1
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ Namespace API.Instagram
243243
If Not PostID.IsEmptyString And _TempPostsList.Contains(PostID) Then Throw New ExitException(_DownloadComplete)
244244
_TempPostsList.Add(PostID)
245245
PostDate = node.Value("taken_at_timestamp")
246+
If Not CheckDatesLimit(PostDate, DateProvider) Then Throw New ExitException(_DownloadComplete)
246247
ObtainMedia(node, PostID, PostDate, SpecFolder)
247248
End If
248249
Next

SCrawler/API/Reddit/UserData.vb

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ Namespace API.Reddit
2323
Return DirectCast(HOST.Source, SiteSettings)
2424
End Get
2525
End Property
26+
Private Shared ReadOnly Property DateTrueProvider(ByVal IsChannel As Boolean) As IFormatProvider
27+
Get
28+
Return If(IsChannel, DateProviderChannel, DateProvider)
29+
End Get
30+
End Property
2631
#Region "Channels Support"
2732
#Region "IChannelLimits Support"
2833
Friend Property DownloadLimitCount As Integer? Implements IChannelLimits.DownloadLimitCount
@@ -163,6 +168,7 @@ Namespace API.Reddit
163168
Continue For
164169
End If
165170
If nn.Contains("created") Then PostDate = nn("created").Value Else PostDate = String.Empty
171+
If DownloadToDate.HasValue AndAlso Not CheckDatesLimit(PostDate, DateTrueProvider(IsChannel)) Then Exit Sub
166172

167173
_ItemsBefore = _TempMediaList.Count
168174
added = True
@@ -455,7 +461,7 @@ Namespace API.Reddit
455461
Dim m As New UserMedia(_URL, t) With {.Post = New UserPost With {.ID = PostID, .UserID = _UserID}}
456462
If t = UTypes.Picture Or t = UTypes.GIF Then m.File = UrlToFile(m.URL) Else m.File = Nothing
457463
If m.URL.Contains("preview") Then m.URL = $"https://i.redd.it/{m.File.File}"
458-
If Not PostDate.IsEmptyString Then m.Post.Date = AConvert(Of Date)(PostDate, If(IsChannel, DateProviderChannel, DateProvider), Nothing) Else m.Post.Date = Nothing
464+
If Not PostDate.IsEmptyString Then m.Post.Date = AConvert(Of Date)(PostDate, DateTrueProvider(IsChannel), Nothing) Else m.Post.Date = Nothing
459465
Return m
460466
End Function
461467
Private Function TryFile(ByVal URL As String) As Boolean

SCrawler/API/Redgifs/UserData.vb

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Namespace API.RedGifs
3737
pTotal = j.Value("pages").FromXML(Of Integer)(0)
3838
For Each g As EContainer In j("gifs")
3939
postDate = g.Value("createDate")
40+
If Not CheckDatesLimit(postDate, DateProvider) Then Exit Sub
4041
postID = g.Value("id")
4142
If Not _TempPostsList.Contains(postID) Then _TempPostsList.Add(postID) Else Exit For
4243
With g("urls")

SCrawler/API/Twitter/UserData.vb

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Namespace API.Twitter
6464
'Date Pattern:
6565
'Sat Jan 01 01:10:15 +0000 2000
6666
If nn.Contains("created_at") Then PostDate = nn("created_at").Value Else PostDate = String.Empty
67+
If Not CheckDatesLimit(PostDate, Declarations.DateProvider) Then Exit Sub
6768

6869
If Not _TempPostsList.Contains(PostID) Then
6970
NewPostDetected = True

SCrawler/Download/ActiveDownloadingProgress.vb

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Namespace DownloadObjects
1414
Private MyView As FormsView
1515
Friend Property Opened As Boolean = False
1616
Private ReadOnly JobsList As List(Of DownloadProgress)
17+
Friend Property DisableProgressChange As Boolean = False
1718
Friend Sub New()
1819
InitializeComponent()
1920
JobsList = New List(Of DownloadProgress)
@@ -66,7 +67,11 @@ Namespace DownloadObjects
6667
TP_MAIN.Refresh()
6768
End Sub
6869
Private Sub Jobs_OnTotalCountChange()
69-
If JobsList.Count > 0 Then MainProgress.TotalCount = JobsList.Sum(Function(j) CLng(j.Job.Progress.TotalCount))
70+
If JobsList.Count > 0 And Not DisableProgressChange Then
71+
MainProgress.TotalCount = JobsList.Sum(Function(j) CLng(j.Job.Progress.TotalCount))
72+
MainProgress.CurrentCounter = Math.Max(JobsList.Sum(Function(j) CLng(j.Job.Progress.CurrentCounter)) - 1, 0)
73+
If MainProgress.CurrentCounter > 0 Then MainProgress.Perform()
74+
End If
7075
End Sub
7176
End Class
7277
End Namespace

SCrawler/Download/TDownloader.vb

+4-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ Namespace DownloadObjects
217217
Private Sub JobsChecker()
218218
Try
219219
MainProgress.TotalCount = 0
220-
Do While Pool.Exists(Function(p) p.Count > 0)
220+
MainProgress.CurrentCounter = 0
221+
MyProgressForm.DisableProgressChange = False
222+
Do While Pool.Exists(Function(p) p.Count > 0 Or p.Working)
221223
For Each j As Job In Pool
222224
If j.Count > 0 And Not j.Working Then j.Start(New ThreadStart(Sub() StartDownloading(j)))
223225
Next
@@ -231,6 +233,7 @@ Namespace DownloadObjects
231233
.InformationTemporary = "All data downloaded"
232234
.Enabled(EOptions.ProgressBar) = False
233235
End With
236+
MyProgressForm.DisableProgressChange = True
234237
If Pool.Count > 0 Then Pool.ForEach(Sub(p) If Not p.Progress Is Nothing Then p.Progress.TotalCount = 0)
235238
End Try
236239
End Sub

SCrawler/Editors/GlobalSettingsForm.Designer.vb

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

0 commit comments

Comments
 (0)