diff --git a/Changelog.md b/Changelog.md index 1d79ff8..9054f25 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,22 @@ +# 2023.8.27.0 + +*2023-08-27* + +- Added + - **JustForFans** + - Advanced download (`Download` - `Download (advanced)`) + - Advanced filter (`View` - `Advanced filter`) + - Auto downloader: cloning plans + - Feed: add button to go to custom page + - Special log for non-existent users + - Twitter: group 'limit' notifications + - Ability to set custom color for subscription users + - Other improvements +- Fixed + - Auto downloader: new plan date display bug + - Auto downloader: downloading stuck + - Minor bugs + # 2023.8.6.0 *2023-08-06* diff --git a/ProgramScreenshots/SettingsGlobalBasis.png b/ProgramScreenshots/SettingsGlobalBasis.png index a36abb9..04f5713 100644 Binary files a/ProgramScreenshots/SettingsGlobalBasis.png and b/ProgramScreenshots/SettingsGlobalBasis.png differ diff --git a/ProgramScreenshots/SettingsGlobalDesign.png b/ProgramScreenshots/SettingsGlobalDesign.png new file mode 100644 index 0000000..9e59dfd Binary files /dev/null and b/ProgramScreenshots/SettingsGlobalDesign.png differ diff --git a/ProgramScreenshots/SettingsSiteJustForFans.png b/ProgramScreenshots/SettingsSiteJustForFans.png new file mode 100644 index 0000000..7065def Binary files /dev/null and b/ProgramScreenshots/SettingsSiteJustForFans.png differ diff --git a/README.md b/README.md index 236f003..0f4c089 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ :eu: :greece: -A program to download photo and video from [any site](#supported-sites) (e.g. YouTube, YouTube Music, OnlyFans, Reddit, Twitter, Mastodon, Instagram, TikTok, RedGifs, PornHub, XHamster, XVIDEOS, ThisVid, LPSG, Pinterest). +A program to download photo and video from [any site](#supported-sites) (e.g. YouTube, YouTube Music, OnlyFans, Reddit, Twitter, Mastodon, Instagram, TikTok, RedGifs, JustForFans, PornHub, XHamster, XVIDEOS, ThisVid, LPSG, Pinterest). **If you like SCrawler, please like the program on [this site](https://alternativeto.net/software/scrawler/about/) and/or [this](https://www.softpedia.com/get/Internet/Download-Managers/Social-networks-crawler.shtml)** @@ -128,16 +122,17 @@ The program parses user posts and compares file names with existing ones to remo - [Reddit](https://github.com/AAndyProgram/SCrawler/wiki/Settings#reddit) - [Twitter](https://github.com/AAndyProgram/SCrawler/wiki/Settings#twitter) - [OnlyFans](https://github.com/AAndyProgram/SCrawler/wiki/Settings#onlyfans) - - [Mastodon](https://github.com/AAndyProgram/SCrawler/wiki/Settings#Mastodon) + - [Mastodon](https://github.com/AAndyProgram/SCrawler/wiki/Settings#mastodon) - [Instagram](https://github.com/AAndyProgram/SCrawler/wiki/Settings#instagram) + - [JustForFans](https://github.com/AAndyProgram/SCrawler/wiki/Settings#justforfans) - [TikTok](https://github.com/AAndyProgram/SCrawler/wiki/Settings#tiktok) - [RedGifs](https://github.com/AAndyProgram/SCrawler/wiki/Settings#redgifs) - - [YouTube](https://github.com/AAndyProgram/SCrawler/wiki/Settings#YouTube) + - [YouTube](https://github.com/AAndyProgram/SCrawler/wiki/Settings#youtube) - [Pinterest](https://github.com/AAndyProgram/SCrawler/wiki/Settings#Pinterest) - [PornHub](https://github.com/AAndyProgram/SCrawler/wiki/Settings#pornhub) - [XHamster](https://github.com/AAndyProgram/SCrawler/wiki/Settings#xhamster) - [XVIDEOS](https://github.com/AAndyProgram/SCrawler/wiki/Settings#xvideos) - - [ThisVid](https://github.com/AAndyProgram/SCrawler/wiki/Settings#ThisVid) + - [ThisVid](https://github.com/AAndyProgram/SCrawler/wiki/Settings#thisvid) - [LPSG](https://github.com/AAndyProgram/SCrawler/wiki/Settings#lpsg) **Full guide you can find [here](https://github.com/AAndyProgram/SCrawler/wiki)** diff --git a/SCrawler.YouTube/My Project/AssemblyInfo.vb b/SCrawler.YouTube/My Project/AssemblyInfo.vb index 0b246d2..4c141e5 100644 --- a/SCrawler.YouTube/My Project/AssemblyInfo.vb +++ b/SCrawler.YouTube/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb b/SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb index 9028021..494853d 100644 --- a/SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb +++ b/SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/SCrawler/API/Base/UserDataBase.vb b/SCrawler/API/Base/UserDataBase.vb index b425cca..910ea83 100644 --- a/SCrawler/API/Base/UserDataBase.vb +++ b/SCrawler/API/Base/UserDataBase.vb @@ -1448,7 +1448,7 @@ BlockNullPicture: For i = 0 To _ContentList.Count - 1 data = _ContentList(i) ProgressPre.Perform() - If (data.Type = UTypes.GIF Or data.Type = UTypes.Picture) Then + If data.Type = UTypes.GIF Or data.Type = UTypes.Picture Then If data.MD5.IsEmptyString Then ThrowAny(Token) eIndx = existingFiles.FindIndex(eFinder) diff --git a/SCrawler/API/JustForFans/SiteSettings.vb b/SCrawler/API/JustForFans/SiteSettings.vb index 1c6dc84..8e5ac03 100644 --- a/SCrawler/API/JustForFans/SiteSettings.vb +++ b/SCrawler/API/JustForFans/SiteSettings.vb @@ -30,10 +30,9 @@ Namespace API.JustForFans Friend ReadOnly Property UserID As PropertyValue Friend ReadOnly Property UserHash4 As PropertyValue - + Friend ReadOnly Property HeaderAccept As PropertyValue - - Friend ReadOnly Property UserAgent As PropertyValue + Friend ReadOnly Property UserAgent As PropertyValue Private Sub UpdateHeader(ByVal HeaderName As String, ByVal HeaderValue As String) Select Case HeaderName Case NameOf(HeaderAccept) : If HeaderValue.IsEmptyString Then Responser.Accept = Nothing Else Responser.Accept = HeaderValue diff --git a/SCrawler/API/Reddit/Channel.vb b/SCrawler/API/Reddit/Channel.vb index 37cf9e7..3d40fe3 100644 --- a/SCrawler/API/Reddit/Channel.vb +++ b/SCrawler/API/Reddit/Channel.vb @@ -270,13 +270,14 @@ Namespace API.Reddit End With Dim b% = Posts.Count Posts.ListAddList(d.GetNewChannelPosts(), LNC) - If Posts.Count - b > 0 Then CountOfLoadedPostsPerSession.Add(Posts.Count - b) + If Posts.Count - b > 0 Then _Saved = False : CountOfLoadedPostsPerSession.Add(Posts.Count - b) Posts.Sort() LatestParsedDate = If(Posts.FirstOrDefault(Function(pp) pp.Date.HasValue).Date, LatestParsedDate) UpdateUsersStats() End Using Catch oex As OperationCanceledException When Token.IsCancellationRequested Finally + SaveUnsaved() _Downloading = False End Try End Sub @@ -344,14 +345,13 @@ Namespace API.Reddit Using x As New XmlFile(f, Protector.Modes.All, False) With {.XmlReadOnly = True, .AllowSameNames = True} x.LoadData() If x.Count > 0 Then - Dim XMLDateProvider As New ADateTime(ADateTime.Formats.BaseDateTime) Dim lc As New ListAddParams(LAP.ClearBeforeAdd) Name = x.Value(Name_Name) ID = x.Value(Name_ID) ViewMode = x.Value(Name_ViewMode).FromXML(Of Integer)(CInt(View.[New])) ViewPeriod = x.Value(Name_ViewPeriod).FromXML(Of Integer)(CInt(Period.All)) If FilePosts.Exists Then PostsNames.ListAddList(FilePosts.GetText.StringToList(Of String)("|"), LNC) - LatestParsedDate = AConvert(Of Date)(x.Value(Name_Date), XMLDateProvider, Nothing) + LatestParsedDate = AConvert(Of Date)(x.Value(Name_Date), DateTimeDefaultProvider, Nothing) CountOfAddedUsers.ListAddList(x.Value(Name_UsersAdded).StringToList(Of Integer)("|"), lc) CountOfLoadedPostsPerSession.ListAddList(x.Value(Name_PostsDownloaded).StringToList(Of Integer)("|"), lc) ChannelExistentUserNames.ListAddList(x.Value(Name_UsersExistent).StringToList(Of String)("|"), LNC) @@ -359,7 +359,7 @@ Namespace API.Reddit With x(Name_PostsNode).XmlIfNothing If .Count > 0 Then .ForEach(Sub(ee) PostsLatest.Add(New UserPost With { .ID = ee.Attribute(Name_ID), - .[Date] = AConvert(Of Date)(ee.Attribute(Name_Date).Value, XMLDateProvider, Nothing)})) + .[Date] = AConvert(Of Date)(ee.Attribute(Name_Date).Value, DateTimeDefaultProvider, Nothing)})) End With End If End If @@ -367,45 +367,53 @@ Namespace API.Reddit End If Return True End Function + Private _Saved As Boolean = True + Friend Function SaveUnsaved() As Boolean + Return _Saved OrElse Save() + End Function Friend Overloads Function Save(Optional ByVal f As SFile = Nothing, Optional ByVal e As ErrorsDescriber = Nothing) As Boolean Implements ILoaderSaver.Save - Dim XMLDateProvider As New ADateTime(ADateTime.Formats.BaseDateTime) - UpdateUsersStats() - If Not ViewMode = View.New Then - Dim l As New List(Of String) - If Posts.Count > 0 Or PostsLatest.Count > 0 Then l.ListAddList((From p In PostsAll Where Not p.ID.IsEmptyString Select p.ID), LNC) - l.ListAddList(PostsNames, LNC) - If l.Count > 0 Then TextSaver.SaveTextToFile(l.ListToString("|"), FilePosts, True,, EDP.SendToLog) - End If - Using x As New XmlFile With {.AllowSameNames = True, .Name = "Channel"} - x.Add(Name_Name, Name) - x.Add(Name_ID, ID) - x.Add(Name_ViewMode, CInt(ViewMode)) - x.Add(Name_ViewPeriod, CInt(ViewPeriod)) - x.Add(Name_UsersAdded, CountOfAddedUsers.ListToString("|")) - x.Add(Name_PostsDownloaded, CountOfLoadedPostsPerSession.ListToString("|")) - x.Add(Name_UsersExistent, ChannelExistentUserNames.ListToString("|")) - If Posts.Count > 0 Or PostsLatest.Count > 0 Then - Dim tmpPostList As List(Of UserPost) = Nothing - tmpPostList.ListAddList(Posts).ListAddList(PostsLatest) - tmpPostList.Sort() - LatestParsedDate = tmpPostList.FirstOrDefault(Function(pd) pd.Date.HasValue).Date - x.Add(Name_Date, AConvert(Of String)(LatestParsedDate, XMLDateProvider, String.Empty)) - x.Add(Name_PostsNode, String.Empty) - With x(Name_PostsNode) - tmpPostList.Take(200).ToList.ForEach(Sub(p) .Add(New EContainer("Post", - String.Empty, - { - New EAttribute(Name_ID, p.ID), - New EAttribute(Name_Date, AConvert(Of String)(p.Date, XMLDateProvider, String.Empty)) - }) - ) - ) - End With - tmpPostList.Clear() + Try + UpdateUsersStats() + If Not ViewMode = View.New Then + Dim l As New List(Of String) + If Posts.Count > 0 Or PostsLatest.Count > 0 Then l.ListAddList((From p In PostsAll Where Not p.ID.IsEmptyString Select p.ID), LNC) + l.ListAddList(PostsNames, LNC) + If l.Count > 0 Then TextSaver.SaveTextToFile(l.ListToString("|"), FilePosts, True,, EDP.SendToLog) End If - x.Save(File) - End Using - Return True + Using x As New XmlFile With {.AllowSameNames = True, .Name = "Channel"} + x.Add(Name_Name, Name) + x.Add(Name_ID, ID) + x.Add(Name_ViewMode, CInt(ViewMode)) + x.Add(Name_ViewPeriod, CInt(ViewPeriod)) + x.Add(Name_UsersAdded, CountOfAddedUsers.ListToString("|")) + x.Add(Name_PostsDownloaded, CountOfLoadedPostsPerSession.ListToString("|")) + x.Add(Name_UsersExistent, ChannelExistentUserNames.ListToString("|")) + If Posts.Count > 0 Or PostsLatest.Count > 0 Then + Dim tmpPostList As List(Of UserPost) = Nothing + tmpPostList.ListAddList(Posts).ListAddList(PostsLatest) + tmpPostList.Sort() + LatestParsedDate = tmpPostList.FirstOrDefault(Function(pd) pd.Date.HasValue).Date + x.Add(Name_Date, AConvert(Of String)(LatestParsedDate, DateTimeDefaultProvider, String.Empty)) + x.Add(Name_PostsNode, String.Empty) + With x(Name_PostsNode) + tmpPostList.Take(200).ToList.ForEach(Sub(p) .Add(New EContainer("Post", + String.Empty, + { + New EAttribute(Name_ID, p.ID), + New EAttribute(Name_Date, AConvert(Of String)(p.Date, DateTimeDefaultProvider, String.Empty)) + }) + ) + ) + End With + tmpPostList.Clear() + End If + _Saved = x.Save(File) + End Using + Return True + Catch ex As Exception + If Not e.Exists Then e = EDP.ReturnValue + Return ErrorsDescriber.Execute(e, ex, "API.Reddit.Channel.Save", _Saved) + End Try End Function #End Region #Region "IDisposable Support" diff --git a/SCrawler/API/Reddit/ChannelsCollection.vb b/SCrawler/API/Reddit/ChannelsCollection.vb index ddaa9f7..e38d3b8 100644 --- a/SCrawler/API/Reddit/ChannelsCollection.vb +++ b/SCrawler/API/Reddit/ChannelsCollection.vb @@ -90,7 +90,7 @@ Namespace API.Reddit End If End Sub Friend Sub Update() - If Count > 0 Then Channels.ForEach(Sub(c) c.Save()) + If Count > 0 Then Channels.ForEach(Sub(c) c.SaveUnsaved()) End Sub Friend ReadOnly Property Count As Integer Implements ICollection(Of Channel).Count, IMyEnumerator(Of Channel).MyEnumeratorCount Get diff --git a/SCrawler/API/Reddit/SiteSettings.vb b/SCrawler/API/Reddit/SiteSettings.vb index 0c38160..86c7d73 100644 --- a/SCrawler/API/Reddit/SiteSettings.vb +++ b/SCrawler/API/Reddit/SiteSettings.vb @@ -218,39 +218,57 @@ Namespace API.Reddit Return True End Function Private Overloads Function UpdateToken() As Boolean - Return UpdateToken(AuthUserName.Value, AuthPassword.Value, ApiClientID.Value, ApiClientSecret.Value) + Return UpdateToken(AuthUserName.Value, AuthPassword.Value, ApiClientID.Value, ApiClientSecret.Value, EDP.SendToLog + EDP.ReturnValue) End Function Private Overloads Function UpdateToken(ByVal UserName As String, ByVal Password As String, ByVal ClientID As String, ByVal ClientSecret As String) As Boolean + Return UpdateToken(UserName, Password, ClientID, ClientSecret, EDP.LogMessageValue) + End Function + Private Overloads Function UpdateToken(ByVal UserName As String, ByVal Password As String, ByVal ClientID As String, ByVal ClientSecret As String, ByVal e As ErrorsDescriber) As Boolean Try Dim result As Boolean = True If {UserName, Password, ClientID, ClientSecret}.All(Function(v) Not v.IsEmptyString) Then result = False Dim r$ = String.Empty - Using resp As New Responser With { - .Mode = Responser.Modes.Curl, - .Method = "POST", - .CurlArgumentsLeft = $"-d ""grant_type=password&username={UserName}&password={Password}"" --user ""{ClientID}:{ClientSecret}""" - } - r = resp.GetResponse("https://www.reddit.com/api/v1/access_token") - End Using - If Not r.IsEmptyString Then - Using j As EContainer = JsonDocument.Parse(r) - If j.ListExists Then - Dim newToken$ = j.Value("access_token") - If Not newToken.IsEmptyString Then - BearerToken.Value = $"Bearer {newToken}" - BearerTokenDateUpdate.Value = Now - Responser.SaveSettings() - result = True - End If - End If + Dim c% = 0 + Dim _found As Boolean + Do + c += 1 + Using resp As New Responser With { + .Method = "POST", + .ProcessExceptionDecision = Function(status, obj, ee) If(status.StatusCode = 429, EDP.ReturnValue, ee) + } + With resp + With .PayLoadValues + .Add("grant_type", "password") + .Add("username", UserName) + .Add("password", Password) + End With + .CredentialsUserName = ClientID + .CredentialsPassword = ClientSecret + .PreAuthenticate = True + End With + r = resp.GetResponse("https://www.reddit.com/api/v1/access_token",, EDP.ThrowException) End Using - End If + If Not r.IsEmptyString Then + Using j As EContainer = JsonDocument.Parse(r) + If j.ListExists Then + _found = True + Dim newToken$ = j.Value("access_token") + If Not newToken.IsEmptyString Then + BearerToken.Value = $"Bearer {newToken}" + BearerTokenDateUpdate.Value = Now + Responser.SaveSettings() + result = True + End If + End If + End Using + End If + Loop While c < 5 And Not _found End If Return result Catch ex As Exception - Return ErrorsDescriber.Execute(EDP.SendToLog + EDP.ReturnValue, ex, "[Reddit.SiteSettings.UpdateToken]", False) + Return ErrorsDescriber.Execute(e, ex, "[Reddit.SiteSettings.UpdateToken]", False) End Try End Function #End Region diff --git a/SCrawler/Download/Automation/AutoDownloader.vb b/SCrawler/Download/Automation/AutoDownloader.vb index 1c17a7a..b11bee2 100644 --- a/SCrawler/Download/Automation/AutoDownloader.vb +++ b/SCrawler/Download/Automation/AutoDownloader.vb @@ -324,6 +324,24 @@ Namespace DownloadObjects Initialization = False End Sub #End Region +#Region "ICopier Support" + Friend Overrides Function Copy() As Object + Dim newObj As New AutoDownloader(True) + newObj.Copy(Me) + With newObj + .Name = String.Empty + ._Mode = _Mode + .Groups.ListAddList(Groups, LAP.ClearBeforeAdd) + .Timer = Timer + .StartupDelay = StartupDelay + .ShowNotifications = ShowNotifications + .ShowPictureDownloaded = ShowPictureDownloaded + .ShowPictureUser = ShowPictureUser + .ShowSimpleNotification = ShowSimpleNotification + End With + Return newObj + End Function +#End Region #Region "Groups Support" Friend Sub GROUPS_Updated(ByVal Sender As DownloadGroup) If Groups.Count > 0 Then diff --git a/SCrawler/Download/Automation/SchedulerEditorForm.vb b/SCrawler/Download/Automation/SchedulerEditorForm.vb index 55d79f4..be47944 100644 --- a/SCrawler/Download/Automation/SchedulerEditorForm.vb +++ b/SCrawler/Download/Automation/SchedulerEditorForm.vb @@ -8,10 +8,12 @@ ' but WITHOUT ANY WARRANTY Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms.Toolbars +Imports ECI = PersonalUtilities.Forms.Toolbars.EditToolbar.ControlItem Namespace DownloadObjects Friend Class SchedulerEditorForm #Region "Declarations" Private WithEvents MyDefs As DefaultFormOptions + Private WithEvents BTT_CLONE As ToolStripButton Private ReadOnly MENU_SKIP As ToolStripDropDownButton Private WithEvents BTT_SKIP As ToolStripMenuItem Private WithEvents BTT_SKIP_MIN As ToolStripMenuItem @@ -26,6 +28,13 @@ Namespace DownloadObjects Friend Sub New() InitializeComponent() MyDefs = New DefaultFormOptions(Me, Settings.Design) + BTT_CLONE = New ToolStripButton With { + .Text = "Clone", + .DisplayStyle = ToolStripItemDisplayStyle.ImageAndText, + .Image = My.Resources.PlusPic_24, + .ToolTipText = "Create a copy of the selected plan", + .AutoToolTip = True + } MENU_SKIP = New ToolStripDropDownButton With { .Text = "Skip", .ToolTipText = String.Empty, @@ -86,7 +95,7 @@ Namespace DownloadObjects Private Sub SchedulerEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load With MyDefs .MyViewInitialize() - .AddEditToolbarPlus({New ToolStripSeparator, BTT_START, BTT_START_FORCE, MENU_SKIP, BTT_PAUSE}) + .AddEditToolbar({ECI.Add, BTT_CLONE, ECI.Edit, ECI.Delete, ECI.Update, ECI.Separator, BTT_START, BTT_START_FORCE, MENU_SKIP, BTT_PAUSE}) PauseArr.AddButtons(BTT_PAUSE, .MyEditToolbar.ToolStrip) Refill() .EndLoaderOperations(False) @@ -118,17 +127,24 @@ Namespace DownloadObjects End Try End Sub #Region "Add, Edit, Delete" - Private Sub MyDefs_ButtonAddClick(ByVal Sender As Object, ByVal e As EditToolbarEventArgs) Handles MyDefs.ButtonAddClick - Dim a As New AutoDownloader(True) - Using f As New AutoDownloaderEditorForm(a) - f.ShowDialog() - If f.DialogResult = DialogResult.OK Then - Settings.Automation.Add(a) - Refill() - Else - a.Dispose() - End If - End Using + Private Sub MyDefs_ButtonAddClick(ByVal Sender As Object, ByVal e As EventArgs) Handles MyDefs.ButtonAddClick, BTT_CLONE.Click + Dim a As AutoDownloader = Nothing + If Sender Is BTT_CLONE Then + If _LatestSelected.ValueBetween(0, Settings.Automation.Count - 1) Then a = Settings.Automation(_LatestSelected).Copy + Else + a = New AutoDownloader(True) + End If + If Not a Is Nothing Then + Using f As New AutoDownloaderEditorForm(a) + f.ShowDialog() + If f.DialogResult = DialogResult.OK Then + Settings.Automation.Add(a) + Refill() + Else + a.Dispose() + End If + End Using + End If End Sub Private Sub Edit() Handles MyDefs.ButtonEditClick If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then diff --git a/SCrawler/Download/DownloadedInfoForm.vb b/SCrawler/Download/DownloadedInfoForm.vb index d984459..c0bde9f 100644 --- a/SCrawler/Download/DownloadedInfoForm.vb +++ b/SCrawler/Download/DownloadedInfoForm.vb @@ -165,33 +165,45 @@ Namespace DownloadObjects #End Region #Region "Toolbar controls" Private Sub MENU_VIEW_Click(ByVal Sender As ToolStripMenuItem, ByVal e As EventArgs) Handles MENU_VIEW_SESSION.Click, MENU_VIEW_ALL.Click - Dim __refill As Boolean = False - Dim clicked As ToolStripMenuItem = Sender - Dim other As ToolStripMenuItem = If(Sender Is MENU_VIEW_SESSION, MENU_VIEW_ALL, MENU_VIEW_SESSION) - If other.Checked Then - clicked.Checked = True - other.Checked = False - __refill = True - Else - clicked.Checked = False - End If - ViewMode = IIf(MENU_VIEW_SESSION.Checked, ViewModes.Session, ViewModes.All) - ControlInvokeFast(ToolbarTOP, BTT_CLEAR, Sub() BTT_CLEAR.Visible = ViewMode = ViewModes.Session) - If __refill Then RefillList() + Try + Dim __refill As Boolean = False + Dim clicked As ToolStripMenuItem = Sender + Dim other As ToolStripMenuItem = If(Sender Is MENU_VIEW_SESSION, MENU_VIEW_ALL, MENU_VIEW_SESSION) + ControlInvokeFast(ToolbarTOP, clicked, Sub() + If other.Checked Then + clicked.Checked = True + other.Checked = False + __refill = True + Else + clicked.Checked = False + End If + ViewMode = IIf(MENU_VIEW_SESSION.Checked, ViewModes.Session, ViewModes.All) + BTT_CLEAR.Visible = ViewMode = ViewModes.Session + End Sub, EDP.SendToLog) + If __refill Then RefillList() + Catch ex As Exception + ErrorsDescriber.Execute(EDP.SendToLog, ex, "DownloadedInfoForm.ViewChange") + End Try End Sub Private Sub OPT_Click(ByVal Sender As ToolStripMenuItem, ByVal e As EventArgs) Handles OPT_DEFAULT.Click, OPT_SUBSCRIPTIONS.Click - Dim __refill As Boolean = False - Dim clicked As ToolStripMenuItem = Sender - Dim other As ToolStripMenuItem = If(Sender Is OPT_DEFAULT, OPT_SUBSCRIPTIONS, OPT_DEFAULT) - If other.Checked Then - clicked.Checked = True - other.Checked = False - __refill = True - Else - clicked.Checked = False - End If - Settings.InfoViewDefault.Value = OPT_DEFAULT.Checked - If __refill Then RefillList() + Try + Dim __refill As Boolean = False + Dim clicked As ToolStripMenuItem = Sender + Dim other As ToolStripMenuItem = If(Sender Is OPT_DEFAULT, OPT_SUBSCRIPTIONS, OPT_DEFAULT) + ControlInvokeFast(ToolbarTOP, clicked, Sub() + If other.Checked Then + clicked.Checked = True + other.Checked = False + __refill = True + Else + clicked.Checked = False + End If + End Sub, EDP.SendToLog) + Settings.InfoViewDefault.Value = OPT_DEFAULT.Checked + If __refill Then RefillList() + Catch ex As Exception + ErrorsDescriber.Execute(EDP.SendToLog, ex, "DownloadedInfoForm.SubscriptionChange") + End Try End Sub Private Sub BTT_FIND_Click(sender As Object, e As EventArgs) Handles BTT_FIND.Click Try : RaiseEvent UserFind(If(Settings.GetUser(SelectedUser, True)?.Key, String.Empty)) : Catch : End Try diff --git a/SCrawler/Download/Feed/DownloadFeedForm.vb b/SCrawler/Download/Feed/DownloadFeedForm.vb index 01a90bf..1a29a62 100644 --- a/SCrawler/Download/Feed/DownloadFeedForm.vb +++ b/SCrawler/Download/Feed/DownloadFeedForm.vb @@ -58,8 +58,10 @@ Namespace DownloadObjects LastWinState = WindowState With MyRange .AutoToolTip = True + .Buttons = {RCI.First, RCI.Previous, RCI.Label, RCI.Next, RCI.Last, RCI.Separator, RCI.GoTo} .ButtonKey(RCI.Previous) = Keys.F3 .ButtonKey(RCI.Next) = Keys.F4 + .ButtonKey(RCI.GoTo) = New ButtonKey(Keys.G, True) .AddThisToolbar() End With ToolbarTOP.Items.AddRange({New ToolStripSeparator, BTT_DELETE_SELECTED}) @@ -88,15 +90,7 @@ Namespace DownloadObjects DataList.Clear() End Sub Private Sub DownloadFeedForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown - Dim b As Boolean = True - If e.KeyCode = Keys.F5 Then - RefillList() - ElseIf e.Control And e.KeyCode = Keys.G Then - MyRange.GoToF() - Else - b = False - End If - If b Then e.Handled = True + If e.KeyCode = Keys.F5 Then RefillList() : e.Handled = True End Sub #End Region #Region "Settings" diff --git a/SCrawler/Download/Feed/FeedMedia.vb b/SCrawler/Download/Feed/FeedMedia.vb index 06bc98a..a076948 100644 --- a/SCrawler/Download/Feed/FeedMedia.vb +++ b/SCrawler/Download/Feed/FeedMedia.vb @@ -112,7 +112,7 @@ Namespace DownloadObjects If Media.User.ForeColor.HasValue Then f = Media.User.ForeColor If Media.User.IsSubscription And Media.User.IsUser Then If Not b.HasValue And Settings.MainFrameUsersSubscriptionsColorBack_USERS.Exists Then b = Settings.MainFrameUsersSubscriptionsColorBack_USERS.Value - If Not f.HasValue And Settings.MainFrameUsersSubscriptionsColorFore_USERS.Exists Then b = Settings.MainFrameUsersSubscriptionsColorFore_USERS.Value + If Not f.HasValue And Settings.MainFrameUsersSubscriptionsColorFore_USERS.Exists Then f = Settings.MainFrameUsersSubscriptionsColorFore_USERS.Value End If End If If Not b.HasValue And Settings.FeedBackColor.Exists Then b = Settings.FeedBackColor.Value diff --git a/SCrawler/Download/Groups/GroupParameters.vb b/SCrawler/Download/Groups/GroupParameters.vb index 6451ee9..0efa957 100644 --- a/SCrawler/Download/Groups/GroupParameters.vb +++ b/SCrawler/Download/Groups/GroupParameters.vb @@ -22,7 +22,7 @@ Namespace DownloadObjects.Groups Property SubscriptionsOnly As Boolean Property UsersCount As Integer End Interface - Friend Class GroupParameters : Implements IGroup, IDisposable + Friend Class GroupParameters : Implements IGroup, IDisposable, ICopier Protected Const Name_Name As String = "Name" Protected Const Name_Temporary As String = "Temporary" Protected Const Name_Favorite As String = "Favorite" @@ -53,6 +53,28 @@ Namespace DownloadObjects.Groups Sites = New List(Of String) SitesExcluded = New List(Of String) End Sub +#Region "ICopier Support" + Friend Overridable Overloads Function Copy() As Object Implements ICopier.Copy + Return (New GroupParameters).Copy(Me) + End Function + Friend Overridable Overloads Function Copy(ByVal Source As Object) As Object Implements ICopier.Copy + With DirectCast(Source, GroupParameters) + Name = .Name + Labels.ListAddList(.Labels, LAP.ClearBeforeAdd) + LabelsExcluded.ListAddList(.LabelsExcluded, LAP.ClearBeforeAdd) + Sites.ListAddList(.Sites, LAP.ClearBeforeAdd) + SitesExcluded.ListAddList(.SitesExcluded, LAP.ClearBeforeAdd) + Temporary = .Temporary + Favorite = .Favorite + ReadyForDownload = .ReadyForDownload + ReadyForDownloadIgnore = .ReadyForDownloadIgnore + Subscriptions = .Subscriptions + SubscriptionsOnly = .SubscriptionsOnly + UsersCount = .UsersCount + End With + Return Source + End Function +#End Region Protected Sub Import(ByVal e As EContainer) Name = e.Value(Name_Name) Temporary = e.Value(Name_Temporary).FromXML(Of Integer)(CInt(CheckState.Indeterminate)) diff --git a/SCrawler/Download/MissingPostsForm.vb b/SCrawler/Download/MissingPostsForm.vb index be0d017..5d84ee0 100644 --- a/SCrawler/Download/MissingPostsForm.vb +++ b/SCrawler/Download/MissingPostsForm.vb @@ -22,7 +22,7 @@ Namespace DownloadObjects Private WithEvents BTT_INFO As ToolStripButton #End Region #Region "Initializer" - Friend Sub New() + Public Sub New() InitializeComponent() MUsers = New List(Of IUserData) MyDefs = New DefaultFormOptions(Me, Settings.Design) diff --git a/SCrawler/Editors/UsersInfoForm.vb b/SCrawler/Editors/UsersInfoForm.vb index 2f26053..4632a80 100644 --- a/SCrawler/Editors/UsersInfoForm.vb +++ b/SCrawler/Editors/UsersInfoForm.vb @@ -225,7 +225,7 @@ Namespace Editors #End Region #End Region #Region "Initializer" - Friend Sub New() + Public Sub New() InitializeComponent() MyView = New FormView(Me, Settings.Design) MyProgress = New MyProgress(Toolbar_BOTTOM, PR_MAIN, LBL_STATUS) diff --git a/SCrawler/GlobalSuppressions.vb b/SCrawler/GlobalSuppressions.vb index 94960e5..760fd35 100644 --- a/SCrawler/GlobalSuppressions.vb +++ b/SCrawler/GlobalSuppressions.vb @@ -6,4 +6,6 @@ Imports System.Diagnostics.CodeAnalysis - \ No newline at end of file + + + \ No newline at end of file diff --git a/SCrawler/MainFrame.vb b/SCrawler/MainFrame.vb index 8bd9be7..61a24de 100644 --- a/SCrawler/MainFrame.vb +++ b/SCrawler/MainFrame.vb @@ -418,20 +418,20 @@ CloseResume: End Sub #End Region #Region "Info, Feed, Channels, Saved posts" +#Region "Info" Private Sub MENU_INFO_SHOW_INFO_Click(sender As Object, e As EventArgs) Handles MENU_INFO_SHOW_INFO.Click - InfoForm.FormShow() + InfoForm.FormShow(EDP.LogMessageValue) End Sub Private Sub MENU_INFO_SHOW_QUEUE_Click(sender As Object, e As EventArgs) Handles MENU_INFO_SHOW_QUEUE.Click - DownloadQueue.FormShow() + DownloadQueue.FormShow(EDP.LogMessageValue) End Sub Private Sub MENU_INFO_SHOW_MISSING_Click(sender As Object, e As EventArgs) Handles MENU_INFO_SHOW_MISSING.Click - If MyMissingPosts Is Nothing Then MyMissingPosts = New MissingPostsForm - If MyMissingPosts.Visible Then MyMissingPosts.BringToFront() Else MyMissingPosts.Show() + MyMissingPosts.FormShow(EDP.LogMessageValue) End Sub Private Sub MENU_INFO_SHOW_USER_METRICS_Click(sender As Object, e As EventArgs) Handles MENU_INFO_SHOW_USER_METRICS.Click - If MyUserMetrics Is Nothing Then MyUserMetrics = New UsersInfoForm - MyUserMetrics.FormShowS + MyUserMetrics.FormShow(EDP.LogMessageValue) End Sub +#End Region Private Sub ShowFeed() Handles BTT_FEED.Click, BTT_TRAY_FEED_SHOW.Click If MyFeed Is Nothing Then MyFeed = New DownloadFeedForm : AddHandler Downloader.FeedFilesChanged, AddressOf MyFeed.Downloader_FilesChanged If MyFeed.Visible Then MyFeed.BringToFront() Else MyFeed.Show() diff --git a/SCrawler/My Project/AssemblyInfo.vb b/SCrawler/My Project/AssemblyInfo.vb index 4c93362..ceb8707 100644 --- a/SCrawler/My Project/AssemblyInfo.vb +++ b/SCrawler/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + +