mirror of
https://github.com/AAndyProgram/SCrawler.git
synced 2026-03-14 15:52:18 +00:00
2022.8.22.0
Cleaned up the code Replace some old functions with new ones Adapted to the new library environment Enable/Disable display user/downloaded image Autodownloader option 'Show notification' not saved Separate thread for standalone video downloader Expanded the description of some errors with additional information Fixed date/time renaming issue Fixed internal library bugs Fixed minor bugs
This commit is contained in:
@@ -11,10 +11,14 @@ I welcome requests! Follow these steps to contribute:
|
|||||||
|
|
||||||
1. Delete the "PersonalUtilities" project from the solution.
|
1. Delete the "PersonalUtilities" project from the solution.
|
||||||
1. Delete the "PersonalUtilities.Notifications" project from the solution.
|
1. Delete the "PersonalUtilities.Notifications" project from the solution.
|
||||||
1. Add the latest versions of the ```PersonalUtilities.dll``` and ```PersonalUtilities.Notifications.dll``` libraries (from the [latest release](https://github.com/AAndyProgram/SCrawler/releases/latest)).
|
1. The following libraries must be added to project references with the '**Copy to output folder**' option:
|
||||||
|
- ```PersonalUtilities.dll```
|
||||||
|
- ```PersonalUtilities.Notifications.dll```
|
||||||
|
- ```Microsoft.Toolkit.Uwp.Notifications.dll```
|
||||||
|
- ```System.ValueTuple.dll```
|
||||||
1. Import PersonalUtilities.Functions for the whole project.
|
1. Import PersonalUtilities.Functions for the whole project.
|
||||||
|
|
||||||
**Always use the correct "PersonalUtilities.dll" library. You must download this library from the release of the code you downloaded.**
|
**Always use the correct libraries. You must download libraries from the same release date as the code commit date.**
|
||||||
|
|
||||||
# How to request a new site
|
# How to request a new site
|
||||||
|
|
||||||
|
|||||||
66
Changelog.md
66
Changelog.md
@@ -1,5 +1,21 @@
|
|||||||
|
# 2022.8.22.0
|
||||||
|
|
||||||
|
*2022-08-22*
|
||||||
|
|
||||||
|
- Added
|
||||||
|
- Ability to enable/disable the display of the downloaded image in toast notifications (AutoDownloader)
|
||||||
|
- Ability to enable/disable the display of the user icon in toast notifications (AutoDownloader)
|
||||||
|
- Downloading with standalone video downloader has been moved to a separate thread
|
||||||
|
- Fixed
|
||||||
|
- (Issue #35) The file name does not change only by date
|
||||||
|
- (Issue #62) Internal library error
|
||||||
|
- AutoDownloader option ```Show notifications``` not saved
|
||||||
|
- Minor bugs
|
||||||
|
|
||||||
# 2022.7.7.0
|
# 2022.7.7.0
|
||||||
|
|
||||||
|
*2022-07-07*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- **Scheduler** (creating multiple automation tasks)
|
- **Scheduler** (creating multiple automation tasks)
|
||||||
- Automation startup delay
|
- Automation startup delay
|
||||||
@@ -16,6 +32,8 @@
|
|||||||
|
|
||||||
# 2022.6.10.0
|
# 2022.6.10.0
|
||||||
|
|
||||||
|
*2022-06-10*
|
||||||
|
|
||||||
**Attention! From now on, Instagram requires Cookies, Hash and authorization headers!**
|
**Attention! From now on, Instagram requires Cookies, Hash and authorization headers!**
|
||||||
|
|
||||||
- Fixed
|
- Fixed
|
||||||
@@ -23,6 +41,8 @@
|
|||||||
|
|
||||||
# 2022.6.6.0
|
# 2022.6.6.0
|
||||||
|
|
||||||
|
*2022-06-06*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Ability to pause automation
|
- Ability to pause automation
|
||||||
- Fixed
|
- Fixed
|
||||||
@@ -31,6 +51,8 @@
|
|||||||
|
|
||||||
# 2022.6.3.0
|
# 2022.6.3.0
|
||||||
|
|
||||||
|
*2022-06-03*
|
||||||
|
|
||||||
Changed version numbering method. From now on, new versions will be numbered by release date (YYYY.M.D)
|
Changed version numbering method. From now on, new versions will be numbered by release date (YYYY.M.D)
|
||||||
|
|
||||||
**Attention! Starting with this release, SCrawler may not work on windows 7 and 8 or may not work correctly. All future releases will only be guaranteed to work on windows 10 and 11.**
|
**Attention! Starting with this release, SCrawler may not work on windows 7 and 8 or may not work correctly. All future releases will only be guaranteed to work on windows 10 and 11.**
|
||||||
@@ -44,6 +66,8 @@ Changed version numbering method. From now on, new versions will be numbered by
|
|||||||
|
|
||||||
# 3.0.0.10
|
# 3.0.0.10
|
||||||
|
|
||||||
|
*2022-05-23*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- **Downloading groups**
|
- **Downloading groups**
|
||||||
- **Download saved Twitter posts** (bookmarks)
|
- **Download saved Twitter posts** (bookmarks)
|
||||||
@@ -65,6 +89,8 @@ Changed version numbering method. From now on, new versions will be numbered by
|
|||||||
|
|
||||||
# 3.0.0.9
|
# 3.0.0.9
|
||||||
|
|
||||||
|
*2022-04-24*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Excluded labels
|
- Excluded labels
|
||||||
- Ability to disable user grouping
|
- Ability to disable user grouping
|
||||||
@@ -75,6 +101,8 @@ Changed version numbering method. From now on, new versions will be numbered by
|
|||||||
|
|
||||||
# 3.0.0.8
|
# 3.0.0.8
|
||||||
|
|
||||||
|
*2022-04-19*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Script mode ```command```
|
- Script mode ```command```
|
||||||
- Disabled Instagram error 403 (Forbidden) logging for downloading tagged data
|
- Disabled Instagram error 403 (Forbidden) logging for downloading tagged data
|
||||||
@@ -83,6 +111,8 @@ Changed version numbering method. From now on, new versions will be numbered by
|
|||||||
|
|
||||||
# 3.0.0.7
|
# 3.0.0.7
|
||||||
|
|
||||||
|
*2022-04-14*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Ability to run a script after the user download is complete
|
- Ability to run a script after the user download is complete
|
||||||
- Hotkey ```F2``` for additional options in the user creation form
|
- Hotkey ```F2``` for additional options in the user creation form
|
||||||
@@ -93,6 +123,8 @@ Changed version numbering method. From now on, new versions will be numbered by
|
|||||||
|
|
||||||
# 3.0.0.6
|
# 3.0.0.6
|
||||||
|
|
||||||
|
*2022-04-04*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- ```GoTo Start``` channels button
|
- ```GoTo Start``` channels button
|
||||||
- ```GoTo End``` channels button
|
- ```GoTo End``` channels button
|
||||||
@@ -104,17 +136,23 @@ Changed version numbering method. From now on, new versions will be numbered by
|
|||||||
|
|
||||||
# 3.0.0.5
|
# 3.0.0.5
|
||||||
|
|
||||||
|
*2022-04-02*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- ```New```, ```Hot```, ```Top``` Reddit channel and user download modes
|
- ```New```, ```Hot```, ```Top``` Reddit channel and user download modes
|
||||||
|
|
||||||
# 3.0.0.4
|
# 3.0.0.4
|
||||||
|
|
||||||
|
*2022-03-26*
|
||||||
|
|
||||||
- Fixed
|
- Fixed
|
||||||
- External plugins do not save information about downloaded files
|
- External plugins do not save information about downloaded files
|
||||||
- The user cannot be added to the collection if a special path has been specified.
|
- The user cannot be added to the collection if a special path has been specified.
|
||||||
|
|
||||||
# 3.0.0.3
|
# 3.0.0.3
|
||||||
|
|
||||||
|
*2022-03-24*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Download all by specific sites
|
- Download all by specific sites
|
||||||
- Download all, ignoring the ```Ready for download``` option
|
- Download all, ignoring the ```Ready for download``` option
|
||||||
@@ -126,6 +164,8 @@ Changed version numbering method. From now on, new versions will be numbered by
|
|||||||
|
|
||||||
# 3.0.0.2
|
# 3.0.0.2
|
||||||
|
|
||||||
|
*2022-03-22*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- **LPSG** site plugin
|
- **LPSG** site plugin
|
||||||
- **XVIDEOS** site plugin
|
- **XVIDEOS** site plugin
|
||||||
@@ -136,6 +176,8 @@ Changed version numbering method. From now on, new versions will be numbered by
|
|||||||
|
|
||||||
# 3.0.0.1
|
# 3.0.0.1
|
||||||
|
|
||||||
|
*2022-03-20*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Download data up to a specific date
|
- Download data up to a specific date
|
||||||
- Update and Reset functions in the plugin (ISiteSettings)
|
- Update and Reset functions in the plugin (ISiteSettings)
|
||||||
@@ -149,6 +191,8 @@ Changed version numbering method. From now on, new versions will be numbered by
|
|||||||
|
|
||||||
# 3.0.0.0
|
# 3.0.0.0
|
||||||
|
|
||||||
|
*2022-03-17*
|
||||||
|
|
||||||
**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).**
|
**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).**
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
@@ -189,6 +233,8 @@ At the requests of some users, I added [screenshots](ProgramScreenshots) of the
|
|||||||
|
|
||||||
# 2.0.0.4
|
# 2.0.0.4
|
||||||
|
|
||||||
|
*2022-02-07*
|
||||||
|
|
||||||
**Removed compatibility of program settings with version 1.0.0.4 and lower.**
|
**Removed compatibility of program settings with version 1.0.0.4 and lower.**
|
||||||
|
|
||||||
**If your program version is 1.0.0.4 and lower, it is strongly recommended that you upgrade to release 2.0.0.1 to update the program settings (and run the program). Then update to this release. Otherwise, you will have to configure the program settings again**
|
**If your program version is 1.0.0.4 and lower, it is strongly recommended that you upgrade to release 2.0.0.1 to update the program settings (and run the program). Then update to this release. Otherwise, you will have to configure the program settings again**
|
||||||
@@ -203,6 +249,8 @@ At the requests of some users, I added [screenshots](ProgramScreenshots) of the
|
|||||||
|
|
||||||
# 2.0.0.3
|
# 2.0.0.3
|
||||||
|
|
||||||
|
*2022-02-02*
|
||||||
|
|
||||||
**Removed compatibility of program settings with version 1.0.0.4 and lower.**
|
**Removed compatibility of program settings with version 1.0.0.4 and lower.**
|
||||||
|
|
||||||
**If your program version is 1.0.0.4 and lower, it is strongly recommended that you upgrade to release 2.0.0.1 to update the program settings (and run the program). Then update to this release. Otherwise, you will have to configure the program settings again**
|
**If your program version is 1.0.0.4 and lower, it is strongly recommended that you upgrade to release 2.0.0.1 to update the program settings (and run the program). Then update to this release. Otherwise, you will have to configure the program settings again**
|
||||||
@@ -218,6 +266,8 @@ At the requests of some users, I added [screenshots](ProgramScreenshots) of the
|
|||||||
|
|
||||||
# 2.0.0.2
|
# 2.0.0.2
|
||||||
|
|
||||||
|
*2022-01-23*
|
||||||
|
|
||||||
**This is the last release that supports program settings of version 1.0.0.4 and lower. Compatibility of program settings with version 1.0.0.4 and lower will be removed in future releases. It is strongly recommended that you upgrade to this release before future releases. Otherwise, you will have to configure the program settings again. If your program version is 1.0.1.0 or higher, you should not pay attention to this message.**
|
**This is the last release that supports program settings of version 1.0.0.4 and lower. Compatibility of program settings with version 1.0.0.4 and lower will be removed in future releases. It is strongly recommended that you upgrade to this release before future releases. Otherwise, you will have to configure the program settings again. If your program version is 1.0.1.0 or higher, you should not pay attention to this message.**
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
@@ -240,6 +290,8 @@ At the requests of some users, I added [screenshots](ProgramScreenshots) of the
|
|||||||
|
|
||||||
# 2.0.0.1
|
# 2.0.0.1
|
||||||
|
|
||||||
|
*2021-12-29*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Download individual Imgur media files (use the "Download video" form).
|
- Download individual Imgur media files (use the "Download video" form).
|
||||||
- Fixed
|
- Fixed
|
||||||
@@ -248,6 +300,8 @@ At the requests of some users, I added [screenshots](ProgramScreenshots) of the
|
|||||||
|
|
||||||
# 2.0.0.0
|
# 2.0.0.0
|
||||||
|
|
||||||
|
*2021-12-27*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- **Instagram**
|
- **Instagram**
|
||||||
- Filter by site
|
- Filter by site
|
||||||
@@ -265,6 +319,8 @@ At the requests of some users, I added [screenshots](ProgramScreenshots) of the
|
|||||||
|
|
||||||
# 1.0.1.0
|
# 1.0.1.0
|
||||||
|
|
||||||
|
*2021-12-20*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Extended site settings
|
- Extended site settings
|
||||||
- Non-existend users will be marked in red
|
- Non-existend users will be marked in red
|
||||||
@@ -286,6 +342,8 @@ At the requests of some users, I added [screenshots](ProgramScreenshots) of the
|
|||||||
|
|
||||||
# 1.0.0.4
|
# 1.0.0.4
|
||||||
|
|
||||||
|
*2021-12-12*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Full channels support (you can now add channel (subreddit) for standard download)
|
- Full channels support (you can now add channel (subreddit) for standard download)
|
||||||
- ```Ready for download``` now available for collections and can be changed for multiple user
|
- ```Ready for download``` now available for collections and can be changed for multiple user
|
||||||
@@ -294,12 +352,16 @@ At the requests of some users, I added [screenshots](ProgramScreenshots) of the
|
|||||||
|
|
||||||
# 1.0.0.3
|
# 1.0.0.3
|
||||||
|
|
||||||
|
*2021-12-11*
|
||||||
|
|
||||||
- Fixed
|
- Fixed
|
||||||
- Custom "Download videos" option is not saved
|
- Custom "Download videos" option is not saved
|
||||||
- The "Download all" button is not activated after changing modes
|
- The "Download all" button is not activated after changing modes
|
||||||
|
|
||||||
# 1.0.0.2
|
# 1.0.0.2
|
||||||
|
|
||||||
|
*2021-12-10*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Ability to choose what types of media you want to download (images only, videos only, both)
|
- Ability to choose what types of media you want to download (images only, videos only, both)
|
||||||
- Ability to name files by date
|
- Ability to name files by date
|
||||||
@@ -308,6 +370,8 @@ At the requests of some users, I added [screenshots](ProgramScreenshots) of the
|
|||||||
|
|
||||||
# 1.0.0.1
|
# 1.0.0.1
|
||||||
|
|
||||||
|
*2021-12-09*
|
||||||
|
|
||||||
- Added
|
- Added
|
||||||
- Limited download if user added from the channel
|
- Limited download if user added from the channel
|
||||||
- Forced limited download for any user
|
- Forced limited download for any user
|
||||||
@@ -330,4 +394,6 @@ At the requests of some users, I added [screenshots](ProgramScreenshots) of the
|
|||||||
|
|
||||||
# 1.0.0.0
|
# 1.0.0.0
|
||||||
|
|
||||||
|
*2021-12-07*
|
||||||
|
|
||||||
Initial release
|
Initial release
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
@@ -100,10 +100,7 @@ Just download [latest](https://github.com/AAndyProgram/SCrawler/releases/latest)
|
|||||||
|
|
||||||
# How to build from source
|
# How to build from source
|
||||||
|
|
||||||
1. Delete the "PersonalUtilities" project from the solution.
|
Read about how to build from source [here](CONTRIBUTING.md#how-to-build-from-source)
|
||||||
1. Delete the "PersonalUtilities.Notifications" project from the solution.
|
|
||||||
1. Add the latest versions of the ```PersonalUtilities.dll``` and ```PersonalUtilities.Notifications.dll``` libraries (from the [latest release](https://github.com/AAndyProgram/SCrawler/releases/latest)).
|
|
||||||
1. Import PersonalUtilities.Functions for the whole project.
|
|
||||||
|
|
||||||
# How to make a plugin
|
# How to make a plugin
|
||||||
|
|
||||||
|
|||||||
@@ -30,19 +30,5 @@ Friend Module Declarations
|
|||||||
Friend ReadOnly Property FileRegExExt As New RParams(FileUrlRegexDefault, 0, Nothing, InputForbidRemover)
|
Friend ReadOnly Property FileRegExExt As New RParams(FileUrlRegexDefault, 0, Nothing, InputForbidRemover)
|
||||||
Friend ReadOnly Property FileRegExExt2 As New RParams("([^/]+?)(?=(\Z|&))", 0, Nothing, InputForbidRemover)
|
Friend ReadOnly Property FileRegExExt2 As New RParams("([^/]+?)(?=(\Z|&))", 0, Nothing, InputForbidRemover)
|
||||||
Friend ReadOnly Property FileExistsRegEx As RParams = RParams.DMS(FileUrlRegexDefault, 2)
|
Friend ReadOnly Property FileExistsRegEx As RParams = RParams.DMS(FileUrlRegexDefault, 2)
|
||||||
Private Class PUMComparer : Implements IEqualityComparer, IEqualityComparer(Of PluginUserMedia)
|
Friend ReadOnly TempListAddParams As New ListAddParams(LAP.NotContainsOnly) With {.Comparer = New FComparer(Of PluginUserMedia)(Function(x, y) x.URL = y.URL)}
|
||||||
Private Overloads Function Equals(ByVal x As PluginUserMedia, ByVal y As PluginUserMedia) As Boolean Implements IEqualityComparer(Of PluginUserMedia).Equals
|
|
||||||
Return x.URL = y.URL
|
|
||||||
End Function
|
|
||||||
Private Function IEqualityComparer_Equals(ByVal x As Object, ByVal y As Object) As Boolean Implements IEqualityComparer.Equals
|
|
||||||
Return DirectCast(x, PluginUserMedia).URL = DirectCast(y, PluginUserMedia).URL
|
|
||||||
End Function
|
|
||||||
Private Overloads Function GetHashCode(ByVal Obj As Object) As Integer Implements IEqualityComparer.GetHashCode
|
|
||||||
Throw New NotImplementedException()
|
|
||||||
End Function
|
|
||||||
Private Overloads Function GetHashCode(ByVal Obj As PluginUserMedia) As Integer Implements IEqualityComparer(Of PluginUserMedia).GetHashCode
|
|
||||||
Throw New NotImplementedException()
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
Friend ReadOnly TempListAddParams As New ListAddParams(LAP.NotContainsOnly) With {.Comparer = New PUMComparer}
|
|
||||||
End Module
|
End Module
|
||||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyDescription("LPSG plugin for SCrawler")>
|
<Assembly: AssemblyDescription("LPSG plugin for SCrawler")>
|
||||||
<Assembly: AssemblyCompany("AndyProgram")>
|
<Assembly: AssemblyCompany("AndyProgram")>
|
||||||
<Assembly: AssemblyProduct("LPSG")>
|
<Assembly: AssemblyProduct("LPSG")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("AndyProgram")>
|
<Assembly: AssemblyTrademark("AndyProgram")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2022.7.7.0")>
|
<Assembly: AssemblyVersion("2022.8.22.0")>
|
||||||
<Assembly: AssemblyFileVersion("2022.7.7.0")>
|
<Assembly: AssemblyFileVersion("2022.8.22.0")>
|
||||||
<Assembly: NeutralResourcesLanguage("en")>
|
<Assembly: NeutralResourcesLanguage("en")>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Public Class SiteSettings : Implements ISiteSettings
|
|||||||
.LoadSettings()
|
.LoadSettings()
|
||||||
Else
|
Else
|
||||||
.CookiesDomain = "www.lpsg.com"
|
.CookiesDomain = "www.lpsg.com"
|
||||||
.Cookies = New CookieKeeper("www.lpsg.com")
|
.Cookies = New CookieKeeper(.CookiesDomain)
|
||||||
End If
|
End If
|
||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
@@ -81,7 +81,7 @@ Public Class SiteSettings : Implements ISiteSettings
|
|||||||
Else
|
Else
|
||||||
Return Nothing
|
Return Nothing
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch
|
||||||
Return Nothing
|
Return Nothing
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ Public Class UserData : Implements IPluginContentProvider
|
|||||||
If Responser.StatusCode = Net.HttpStatusCode.ServiceUnavailable Then
|
If Responser.StatusCode = Net.HttpStatusCode.ServiceUnavailable Then
|
||||||
LogProvider.Add("LPSG not available")
|
LogProvider.Add("LPSG not available")
|
||||||
Else
|
Else
|
||||||
LogProvider.Add(ex, "[LPSG.UserData.GetMedia]")
|
LogProvider.Add(ex, $"[LPSG.UserData.GetMedia({Name})]")
|
||||||
End If
|
End If
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -47,8 +47,7 @@ Friend NotInheritable Class M3U8
|
|||||||
CachePath.Delete(SFO.Path, SFODelete.None, EDP.None)
|
CachePath.Delete(SFO.Path, SFODelete.None, EDP.None)
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
Friend Shared Function Download(ByVal URL As String, ByVal Appender As String, ByVal ffmpegFile As SFile, ByVal f As SFile,
|
Friend Shared Function Download(ByVal URL As String, ByVal Appender As String, ByVal ffmpegFile As SFile, ByVal f As SFile, ByRef Logger As ILogProvider) As SFile
|
||||||
ByRef Logger As ILogProvider) As SFile
|
|
||||||
Try
|
Try
|
||||||
If Not URL.IsEmptyString Then
|
If Not URL.IsEmptyString Then
|
||||||
Using w As New WebClient
|
Using w As New WebClient
|
||||||
@@ -62,7 +61,7 @@ Friend NotInheritable Class M3U8
|
|||||||
End If
|
End If
|
||||||
Return Nothing
|
Return Nothing
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
If Not ex.HelpLink = 1 Then Logger.Add(ex, "[M3U8.Download]")
|
If Not ex.HelpLink = 1 Then Logger.Add(ex, $"[M3U8.Download({URL}, {Appender}, {ffmpegFile}, {f})]")
|
||||||
Throw ex
|
Throw ex
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyDescription("XVIDEOS plugin for SCrawler")>
|
<Assembly: AssemblyDescription("XVIDEOS plugin for SCrawler")>
|
||||||
<Assembly: AssemblyCompany("AndyProgram")>
|
<Assembly: AssemblyCompany("AndyProgram")>
|
||||||
<Assembly: AssemblyProduct("XVIDEOS")>
|
<Assembly: AssemblyProduct("XVIDEOS")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("AndyProgram")>
|
<Assembly: AssemblyTrademark("AndyProgram")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2022.7.7.0")>
|
<Assembly: AssemblyVersion("2022.8.22.0")>
|
||||||
<Assembly: AssemblyFileVersion("2022.7.7.0")>
|
<Assembly: AssemblyFileVersion("2022.8.22.0")>
|
||||||
<Assembly: NeutralResourcesLanguage("en")>
|
<Assembly: NeutralResourcesLanguage("en")>
|
||||||
|
|||||||
@@ -17,19 +17,15 @@ Public Class SettingsForm
|
|||||||
MyDefs = New DefaultFormOptions(Me, Design)
|
MyDefs = New DefaultFormOptions(Me, Design)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub SettingsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub SettingsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
Try
|
With MyDefs
|
||||||
With MyDefs
|
.MyViewInitialize(True)
|
||||||
.MyViewInitialize(True)
|
.AddEditToolbar({EditToolbar.ControlItem.Add, EditToolbar.ControlItem.Delete})
|
||||||
.AddEditToolbar({EditToolbar.ControlItem.Add, EditToolbar.ControlItem.Delete})
|
.AddOkCancelToolbar()
|
||||||
.AddOkCancelToolbar()
|
If Settings.Domains.Count > 0 Then Settings.Domains.ForEach(Sub(d) LIST_DOMAINS.Items.Add(d))
|
||||||
If Settings.Domains.Count > 0 Then Settings.Domains.ForEach(Sub(d) LIST_DOMAINS.Items.Add(d))
|
.EndLoaderOperations()
|
||||||
.EndLoaderOperations()
|
End With
|
||||||
End With
|
|
||||||
Catch ex As Exception
|
|
||||||
MyDefs.InvokeLoaderError(ex)
|
|
||||||
End Try
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub MyDefs_ButtonOkClick() Handles MyDefs.ButtonOkClick
|
Private Sub MyDefs_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonOkClick
|
||||||
Settings.Domains.Clear()
|
Settings.Domains.Clear()
|
||||||
With LIST_DOMAINS
|
With LIST_DOMAINS
|
||||||
If .Items.Count > 0 Then
|
If .Items.Count > 0 Then
|
||||||
@@ -39,7 +35,7 @@ Public Class SettingsForm
|
|||||||
Settings.UpdateDomains()
|
Settings.UpdateDomains()
|
||||||
MyDefs.CloseForm()
|
MyDefs.CloseForm()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub MyDefs_ButtonAddClick() Handles MyDefs.ButtonAddClick
|
Private Sub MyDefs_ButtonAddClick(ByVal Sender As Object, ByVal e As EditToolbar.EditToolbarEventArgs) Handles MyDefs.ButtonAddClick
|
||||||
Dim nd$ = InputBoxE("Enter a new domain using the pattern [xvideos.com]:", "New domain")
|
Dim nd$ = InputBoxE("Enter a new domain using the pattern [xvideos.com]:", "New domain")
|
||||||
If Not nd.IsEmptyString Then
|
If Not nd.IsEmptyString Then
|
||||||
If Not LIST_DOMAINS.Items.Contains(nd) Then
|
If Not LIST_DOMAINS.Items.Contains(nd) Then
|
||||||
@@ -49,11 +45,10 @@ Public Class SettingsForm
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub MyDefs_ButtonDeleteClick() Handles MyDefs.ButtonDeleteClickE
|
Private Sub MyDefs_ButtonDeleteClickE(ByVal Sender As Object, ByVal e As EditToolbar.EditToolbarEventArgs) Handles MyDefs.ButtonDeleteClickE
|
||||||
If _LatestSelected.ValueBetween(0, LIST_DOMAINS.Items.Count - 1) Then
|
If _LatestSelected.ValueBetween(0, LIST_DOMAINS.Items.Count - 1) Then
|
||||||
Dim n$ = LIST_DOMAINS.Items(_LatestSelected)
|
Dim n$ = LIST_DOMAINS.Items(_LatestSelected)
|
||||||
If MsgBoxE({$"Are you sure you want to delete the [{n}] domain?",
|
If MsgBoxE({$"Are you sure you want to delete the [{n}] domain?", "Removing domains"}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
||||||
"Removing domains"}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
|
||||||
LIST_DOMAINS.Items.RemoveAt(_LatestSelected)
|
LIST_DOMAINS.Items.RemoveAt(_LatestSelected)
|
||||||
MsgBoxE($"Domain [{n}] removed")
|
MsgBoxE($"Domain [{n}] removed")
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Public Class SiteSettings : Implements ISiteSettings
|
|||||||
Public Property Logger As ILogProvider Implements ISiteSettings.Logger
|
Public Property Logger As ILogProvider Implements ISiteSettings.Logger
|
||||||
#Region "M3U8"
|
#Region "M3U8"
|
||||||
Private ReadOnly OS64 As Boolean
|
Private ReadOnly OS64 As Boolean
|
||||||
Private ReadOnly FfmpegExists As Boolean
|
Friend ReadOnly FfmpegExists As Boolean
|
||||||
Friend ReadOnly FfmpegFile As SFile
|
Friend ReadOnly FfmpegFile As SFile
|
||||||
Friend ReadOnly Property UseM3U8 As Boolean
|
Friend ReadOnly Property UseM3U8 As Boolean
|
||||||
Get
|
Get
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ Imports UStates = SCrawler.Plugin.PluginUserMedia.States
|
|||||||
Imports UTypes = SCrawler.Plugin.PluginUserMedia.Types
|
Imports UTypes = SCrawler.Plugin.PluginUserMedia.Types
|
||||||
Public Class UserData : Implements IPluginContentProvider
|
Public Class UserData : Implements IPluginContentProvider
|
||||||
#Region "Interface declarations"
|
#Region "Interface declarations"
|
||||||
Public Event ProgressChanged(Count As Integer) Implements IPluginContentProvider.ProgressChanged
|
Public Event ProgressChanged(ByVal Count As Integer) Implements IPluginContentProvider.ProgressChanged
|
||||||
Public Event TotalCountChanged(Count As Integer) Implements IPluginContentProvider.TotalCountChanged
|
Public Event TotalCountChanged(ByVal Count As Integer) Implements IPluginContentProvider.TotalCountChanged
|
||||||
Public Property Thrower As IThrower Implements IPluginContentProvider.Thrower
|
Public Property Thrower As IThrower Implements IPluginContentProvider.Thrower
|
||||||
Public Property LogProvider As ILogProvider Implements IPluginContentProvider.LogProvider
|
Public Property LogProvider As ILogProvider Implements IPluginContentProvider.LogProvider
|
||||||
Public Property ESettings As ISiteSettings Implements IPluginContentProvider.Settings
|
Public Property ESettings As ISiteSettings Implements IPluginContentProvider.Settings
|
||||||
@@ -56,7 +56,14 @@ Public Class UserData : Implements IPluginContentProvider
|
|||||||
Private Property Responser As Response
|
Private Property Responser As Response
|
||||||
Public Sub GetMedia() Implements IPluginContentProvider.GetMedia
|
Public Sub GetMedia() Implements IPluginContentProvider.GetMedia
|
||||||
Try
|
Try
|
||||||
If Not Settings.UseM3U8 Then LogProvider.Add("File [ffmpeg.exe] not found") : Exit Sub
|
If Not Settings.UseM3U8 Then
|
||||||
|
If Settings.FfmpegExists Then
|
||||||
|
LogProvider.Add($"XVIDEOS [{Name}]: The plugin only works with x64 OS.")
|
||||||
|
Else
|
||||||
|
LogProvider.Add($"XVIDEOS [{Name}]: File [ffmpeg.exe] not found")
|
||||||
|
End If
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
If Not Responser Is Nothing Then Responser.Dispose()
|
If Not Responser Is Nothing Then Responser.Dispose()
|
||||||
Responser = New Response
|
Responser = New Response
|
||||||
Responser.Copy(Settings.Responser)
|
Responser.Copy(Settings.Responser)
|
||||||
@@ -105,9 +112,7 @@ Public Class UserData : Implements IPluginContentProvider
|
|||||||
If TempMediaList.Count > 0 Then
|
If TempMediaList.Count > 0 Then
|
||||||
For i% = 0 To TempMediaList.Count - 1
|
For i% = 0 To TempMediaList.Count - 1
|
||||||
Thrower.ThrowAny()
|
Thrower.ThrowAny()
|
||||||
With TempMediaList(i)
|
With TempMediaList(i) : TempMediaList(i) = GetVideoData(.URL, Responser, Settings.DownloadUHD.Value, .PostID, LogProvider) : End With
|
||||||
TempMediaList(i) = GetVideoData(.URL, Responser, Settings.DownloadUHD.Value, .PostID, LogProvider)
|
|
||||||
End With
|
|
||||||
Next
|
Next
|
||||||
TempMediaList.RemoveAll(Function(m) m.URL.IsEmptyString)
|
TempMediaList.RemoveAll(Function(m) m.URL.IsEmptyString)
|
||||||
End If
|
End If
|
||||||
@@ -149,7 +154,7 @@ Public Class UserData : Implements IPluginContentProvider
|
|||||||
Dim t$ = RegexReplace(r, VideoTitleRegex)
|
Dim t$ = RegexReplace(r, VideoTitleRegex)
|
||||||
r = resp.GetResponse(m,, EDP.ThrowException)
|
r = resp.GetResponse(m,, EDP.ThrowException)
|
||||||
If Not r.IsEmptyString Then
|
If Not r.IsEmptyString Then
|
||||||
Dim ls As List(Of VSize) = FNF.RegexFields(Of VSize)(r, {M3U8Reparse}, {1, 2})
|
Dim ls As List(Of VSize) = RegexFields(Of VSize)(r, {M3U8Reparse}, {1, 2})
|
||||||
If ls.ListExists And Not DownloadUHD Then ls.RemoveAll(Function(v) v.Size > 1080)
|
If ls.ListExists And Not DownloadUHD Then ls.RemoveAll(Function(v) v.Size > 1080)
|
||||||
If ls.ListExists Then
|
If ls.ListExists Then
|
||||||
ls.Sort()
|
ls.Sort()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyDescription("Plugin provider for SCrawler")>
|
<Assembly: AssemblyDescription("Plugin provider for SCrawler")>
|
||||||
<Assembly: AssemblyCompany("AndyProgram")>
|
<Assembly: AssemblyCompany("AndyProgram")>
|
||||||
<Assembly: AssemblyProduct("SCrawler.PluginProvider")>
|
<Assembly: AssemblyProduct("SCrawler.PluginProvider")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("AndyProgram")>
|
<Assembly: AssemblyTrademark("AndyProgram")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2022.7.7.0")>
|
<Assembly: AssemblyVersion("2022.8.22.0")>
|
||||||
<Assembly: AssemblyFileVersion("2022.7.7.0")>
|
<Assembly: AssemblyFileVersion("2022.8.22.0")>
|
||||||
<Assembly: NeutralResourcesLanguage("en")>
|
<Assembly: NeutralResourcesLanguage("en")>
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ Namespace Plugin
|
|||||||
Public HostKey As String
|
Public HostKey As String
|
||||||
Public IsChannel As Boolean
|
Public IsChannel As Boolean
|
||||||
Public Exists As Boolean
|
Public Exists As Boolean
|
||||||
Public Sub New(ByVal Site As String, ByVal _Name As String)
|
Public Sub New(ByVal Site As String, ByVal Name As String)
|
||||||
UserName = _Name
|
UserName = Name
|
||||||
SiteName = Site
|
SiteName = Site
|
||||||
End Sub
|
End Sub
|
||||||
Public Sub New(ByVal Site As String, ByVal _Name As String, ByVal _IsChannel As Boolean)
|
Public Sub New(ByVal Site As String, ByVal Name As String, ByVal IsChannel As Boolean)
|
||||||
Me.New(Site, _Name)
|
Me.New(Site, Name)
|
||||||
IsChannel = _IsChannel
|
Me.IsChannel = IsChannel
|
||||||
End Sub
|
End Sub
|
||||||
End Structure
|
End Structure
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -10,9 +10,9 @@ Namespace Plugin
|
|||||||
Public Structure PropertyData
|
Public Structure PropertyData
|
||||||
Public ReadOnly Name As String
|
Public ReadOnly Name As String
|
||||||
Public ReadOnly Value As Object
|
Public ReadOnly Value As Object
|
||||||
Public Sub New(ByVal _Name As String, ByVal _Value As Object)
|
Public Sub New(ByVal Name As String, ByVal Value As Object)
|
||||||
Name = _Name
|
Me.Name = Name
|
||||||
Value = _Value
|
Me.Value = Value
|
||||||
End Sub
|
End Sub
|
||||||
End Structure
|
End Structure
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -37,7 +37,7 @@ Namespace API.Base
|
|||||||
Using w As New WebClient
|
Using w As New WebClient
|
||||||
Dim r$ = w.DownloadString($"https://downdetector.co.uk/status/{Site}/")
|
Dim r$ = w.DownloadString($"https://downdetector.co.uk/status/{Site}/")
|
||||||
If Not r.IsEmptyString Then
|
If Not r.IsEmptyString Then
|
||||||
l = FNF.RegexFields(Of Data)(r, {Params}, {1, 2})
|
l = RegexFields(Of Data)(r, {Params}, {1, 2})
|
||||||
If l.ListExists(2) Then
|
If l.ListExists(2) Then
|
||||||
l.Sort()
|
l.Sort()
|
||||||
l2 = New List(Of Data)
|
l2 = New List(Of Data)
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
'
|
'
|
||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports SCrawler.Plugin.Hosts
|
|
||||||
Imports System.Threading
|
Imports System.Threading
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
Imports PersonalUtilities.Forms.Toolbars
|
||||||
|
Imports SCrawler.Plugin.Hosts
|
||||||
Imports PDownload = SCrawler.Plugin.ISiteSettings.Download
|
Imports PDownload = SCrawler.Plugin.ISiteSettings.Download
|
||||||
Namespace API.Base
|
Namespace API.Base
|
||||||
Friend NotInheritable Class ProfileSaved
|
Friend NotInheritable Class ProfileSaved
|
||||||
@@ -27,11 +27,8 @@ Namespace API.Base
|
|||||||
Using user As IUserData = HOST.GetInstance(PDownload.SavedPosts, Nothing, False, False)
|
Using user As IUserData = HOST.GetInstance(PDownload.SavedPosts, Nothing, False, False)
|
||||||
If Not user Is Nothing AndAlso (Not user.Name.IsEmptyString Or Not HOST.IsMyClass) Then
|
If Not user Is Nothing AndAlso (Not user.Name.IsEmptyString Or Not HOST.IsMyClass) Then
|
||||||
u.Name = user.Name
|
u.Name = user.Name
|
||||||
With DirectCast(user, UserDataBase).User
|
|
||||||
u.IsChannel = .IsChannel
|
|
||||||
u.UpdateUserFile()
|
|
||||||
End With
|
|
||||||
With DirectCast(user, UserDataBase)
|
With DirectCast(user, UserDataBase)
|
||||||
|
With .User : u.IsChannel = .IsChannel : u.UpdateUserFile() : End With
|
||||||
.User = u
|
.User = u
|
||||||
.LoadUserInformation()
|
.LoadUserInformation()
|
||||||
.IsSavedPosts = True
|
.IsSavedPosts = True
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Namespace API.Base
|
|||||||
Site = SiteName
|
Site = SiteName
|
||||||
Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml")
|
Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml")
|
||||||
With Responser
|
With Responser
|
||||||
If .File.Exists Then .LoadSettings() Else .CookiesDomain = CookiesDomain : .SaveSettings()
|
If .File.Exists Then .LoadSettings() Else .CookiesDomain = CookiesDomain : .Cookies = New CookieKeeper(.CookiesDomain) : .SaveSettings()
|
||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
#Region "XML"
|
#Region "XML"
|
||||||
|
|||||||
@@ -83,11 +83,11 @@ Namespace API.Base
|
|||||||
Dim cb As Color = SystemColors.Control
|
Dim cb As Color = SystemColors.Control
|
||||||
Dim cf As Color = SystemColors.ControlText
|
Dim cf As Color = SystemColors.ControlText
|
||||||
If Not UserExists Then
|
If Not UserExists Then
|
||||||
cb = ColorBttDeleteBack
|
cb = MyColor.DeleteBack
|
||||||
cf = ColorBttDeleteFore
|
cf = MyColor.DeleteFore
|
||||||
ElseIf UserSuspended Then
|
ElseIf UserSuspended Then
|
||||||
cb = ColorBttEditBack
|
cb = MyColor.EditBack
|
||||||
cf = ColorBttEditFore
|
cf = MyColor.EditFore
|
||||||
End If
|
End If
|
||||||
For Each b As ToolStripMenuItem In {BTT_CONTEXT_DOWN, BTT_CONTEXT_EDIT, BTT_CONTEXT_DELETE, BTT_CONTEXT_OPEN_PATH, BTT_CONTEXT_OPEN_SITE}
|
For Each b As ToolStripMenuItem In {BTT_CONTEXT_DOWN, BTT_CONTEXT_EDIT, BTT_CONTEXT_DELETE, BTT_CONTEXT_OPEN_PATH, BTT_CONTEXT_OPEN_SITE}
|
||||||
If Not b Is Nothing Then b.BackColor = cb : b.ForeColor = cf
|
If Not b Is Nothing Then b.BackColor = cb : b.ForeColor = cf
|
||||||
@@ -227,21 +227,21 @@ Namespace API.Base
|
|||||||
Return Nothing
|
Return Nothing
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
Friend Function GetUserPictureAddress() As SFile
|
Friend Function GetUserPictureToastAddress() As SFile
|
||||||
Return GetPicture(Of SFile)(False)
|
Return GetPicture(Of SFile)(False, True)
|
||||||
End Function
|
End Function
|
||||||
Friend Overridable Sub SetPicture(ByVal f As SFile) Implements IUserData.SetPicture
|
Friend Overridable Sub SetPicture(ByVal f As SFile) Implements IUserData.SetPicture
|
||||||
Try
|
Try
|
||||||
If Not f.IsEmptyString AndAlso f.Exists Then
|
If f.Exists Then
|
||||||
Using p As New UserImage(f, User.File) : p.Save() : End Using
|
Using p As New UserImage(f, User.File) : p.Save() : End Using
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Protected Function GetNullPicture(ByVal MaxHeigh As XML.Base.XMLValue(Of Integer)) As Bitmap
|
Protected Function GetNullPicture(ByVal MaxHeigh As XML.Base.XMLValue(Of Integer)) As Bitmap
|
||||||
Return New Bitmap(CInt(DivideWithZeroChecking(MaxHeigh.Value, 100) * 75), MaxHeigh.Value)
|
Return New Bitmap(CInt(DivideWithZeroChecking(MaxHeigh.Value, 100) * 75), MaxHeigh.Value)
|
||||||
End Function
|
End Function
|
||||||
Protected Function GetPicture(Of T)(Optional ByVal ReturnNullImageOnNothing As Boolean = True) As T
|
Protected Function GetPicture(Of T)(Optional ByVal ReturnNullImageOnNothing As Boolean = True, Optional ByVal GetToast As Boolean = False) As T
|
||||||
Dim rsfile As Boolean = GetType(T) Is GetType(SFile)
|
Dim rsfile As Boolean = GetType(T) Is GetType(SFile)
|
||||||
Dim f As SFile = Nothing
|
Dim f As SFile = Nothing
|
||||||
Dim p As UserImage = Nothing
|
Dim p As UserImage = Nothing
|
||||||
@@ -273,7 +273,7 @@ BlockPictureScan:
|
|||||||
New ErrorsDescriber(EDP.ReturnValue) With {
|
New ErrorsDescriber(EDP.ReturnValue) With {
|
||||||
.ReturnValue = New List(Of SFile),
|
.ReturnValue = New List(Of SFile),
|
||||||
.ReturnValueExists = True}).FirstOrDefault
|
.ReturnValueExists = True}).FirstOrDefault
|
||||||
If Not NewPicFile.IsEmptyString AndAlso NewPicFile.Exists Then
|
If NewPicFile.Exists Then
|
||||||
p = New UserImage(NewPicFile, MyFile)
|
p = New UserImage(NewPicFile, MyFile)
|
||||||
p.Save()
|
p.Save()
|
||||||
GoTo BlockReturn
|
GoTo BlockReturn
|
||||||
@@ -288,8 +288,14 @@ BlockReturn:
|
|||||||
On Error GoTo BlockNullPicture
|
On Error GoTo BlockNullPicture
|
||||||
If Not p Is Nothing Then
|
If Not p Is Nothing Then
|
||||||
Dim i As Image = Nothing
|
Dim i As Image = Nothing
|
||||||
Dim a As SFile = p.Address
|
Dim a As SFile = Nothing
|
||||||
If Not rsfile Then
|
If rsfile Then
|
||||||
|
If GetToast Then
|
||||||
|
a = p.Large.Address
|
||||||
|
Else
|
||||||
|
a = p.Address
|
||||||
|
End If
|
||||||
|
Else
|
||||||
Select Case Settings.ViewMode.Value
|
Select Case Settings.ViewMode.Value
|
||||||
Case View.LargeIcon : i = p.Large.OriginalImage.Clone
|
Case View.LargeIcon : i = p.Large.OriginalImage.Clone
|
||||||
Case View.SmallIcon : i = p.Small.OriginalImage.Clone
|
Case View.SmallIcon : i = p.Small.OriginalImage.Clone
|
||||||
@@ -301,8 +307,8 @@ BlockReturn:
|
|||||||
BlockNullPicture:
|
BlockNullPicture:
|
||||||
If ReturnNullImageOnNothing Then
|
If ReturnNullImageOnNothing Then
|
||||||
Select Case Settings.ViewMode.Value
|
Select Case Settings.ViewMode.Value
|
||||||
Case View.LargeIcon : Return CObj(GetNullPicture(Settings.MaxLargeImageHeigh))
|
Case View.LargeIcon : Return CObj(GetNullPicture(Settings.MaxLargeImageHeight))
|
||||||
Case View.SmallIcon : Return CObj(GetNullPicture(Settings.MaxSmallImageHeigh))
|
Case View.SmallIcon : Return CObj(GetNullPicture(Settings.MaxSmallImageHeight))
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
Return Nothing
|
Return Nothing
|
||||||
@@ -678,17 +684,8 @@ BlockNullPicture:
|
|||||||
x.LoadData()
|
x.LoadData()
|
||||||
If x.Count > 0 Then
|
If x.Count > 0 Then
|
||||||
Dim fs$ = MyFile.CutPath.PathWithSeparator
|
Dim fs$ = MyFile.CutPath.PathWithSeparator
|
||||||
Dim gfn As Func(Of String, String) = Function(ByVal Input As String) As String
|
Dim gfn As Func(Of String, String) = Function(Input) If(Input.IsEmptyString, String.Empty,
|
||||||
If Input.IsEmptyString Then
|
If(Input.Contains("\"), Input.CSFile.File, Input))
|
||||||
Return String.Empty
|
|
||||||
Else
|
|
||||||
If Input.Contains("\") Then
|
|
||||||
Return New SFile(Input).File
|
|
||||||
Else
|
|
||||||
Return Input
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End Function
|
|
||||||
For Each v As EContainer In x
|
For Each v As EContainer In x
|
||||||
_ContentList.Add(New UserMedia With {
|
_ContentList.Add(New UserMedia With {
|
||||||
.Type = AConvert(Of Integer)(v.Attribute(Name_MediaType).Value, 0),
|
.Type = AConvert(Of Integer)(v.Attribute(Name_MediaType).Value, 0),
|
||||||
@@ -743,7 +740,7 @@ BlockNullPicture:
|
|||||||
If Not URL.IsEmptyString Then Process.Start(URL)
|
If Not URL.IsEmptyString Then Process.Start(URL)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
If Not e.Exists Then e = New ErrorsDescriber(EDP.ShowAllMsg)
|
If Not e.Exists Then e = New ErrorsDescriber(EDP.ShowAllMsg)
|
||||||
MsgBoxE({$"Error on trying to open [{Site}] page of user [{Name}]", $"User [{ToString()}]"}, MsgBoxStyle.Critical, e, ex)
|
MsgBoxE({$"Error when trying to open [{Site}] page of user [{Name}]", $"User [{ToString()}]"}, MsgBoxStyle.Critical, e, ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Friend Overridable Sub OpenFolder() Implements IUserData.OpenFolder
|
Friend Overridable Sub OpenFolder() Implements IUserData.OpenFolder
|
||||||
@@ -852,7 +849,7 @@ BlockNullPicture:
|
|||||||
MyFilePosts.Name &= "_Posts"
|
MyFilePosts.Name &= "_Posts"
|
||||||
MyFilePosts.Extension = "txt"
|
MyFilePosts.Extension = "txt"
|
||||||
Else
|
Else
|
||||||
Throw New ArgumentNullException("User.File", "User file does not detected")
|
Throw New ArgumentNullException("User.File", "User file not detected")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Protected MustOverride Sub DownloadDataF(ByVal Token As CancellationToken)
|
Protected MustOverride Sub DownloadDataF(ByVal Token As CancellationToken)
|
||||||
@@ -962,8 +959,8 @@ BlockNullPicture:
|
|||||||
Protected Function ChangeFileNameByProvider(ByVal f As SFile, ByVal m As UserMedia) As SFile
|
Protected Function ChangeFileNameByProvider(ByVal f As SFile, ByVal m As UserMedia) As SFile
|
||||||
Dim ff As SFile = Nothing
|
Dim ff As SFile = Nothing
|
||||||
Try
|
Try
|
||||||
If Not f.IsEmptyString AndAlso f.Exists Then
|
If f.Exists Then
|
||||||
If Settings.FileReplaceNameByDate Or Settings.FileAddTimeToFileName Then
|
If Not Settings.FileReplaceNameByDate.Value = FileNameReplaceMode.None Then
|
||||||
ff = f
|
ff = f
|
||||||
ff.Name = String.Format(FileDateAppenderPattern, f.Name, CStr(AConvert(Of String)(If(m.Post.Date, Now), FileDateAppenderProvider, String.Empty)))
|
ff.Name = String.Format(FileDateAppenderPattern, f.Name, CStr(AConvert(Of String)(If(m.Post.Date, Now), FileDateAppenderProvider, String.Empty)))
|
||||||
ff = SFile.Indexed_IndexFile(ff,, New NumberedFile(ff))
|
ff = SFile.Indexed_IndexFile(ff,, New NumberedFile(ff))
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ Namespace API.Imgur
|
|||||||
End If
|
End If
|
||||||
Return Nothing
|
Return Nothing
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Return ErrorsDescriber.Execute(EDP.ShowMainMsg + EDP.SendInLog, ex, "Imgur standalone downloader: fetch media error")
|
Return ErrorsDescriber.Execute(EDP.ShowMainMsg + EDP.SendInLog + EDP.ReturnValue, ex, "Imgur standalone downloader: fetch media error")
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
Private Shared Function DownloadingException(ByVal ex As Exception, ByVal Message As String,
|
Private Shared Function DownloadingException(ByVal ex As Exception, ByVal Message As String,
|
||||||
|
|||||||
@@ -11,15 +11,6 @@ Namespace API.Instagram
|
|||||||
Friend Module Declarations
|
Friend Module Declarations
|
||||||
Friend Const InstagramSite As String = "Instagram"
|
Friend Const InstagramSite As String = "Instagram"
|
||||||
Friend ReadOnly FilesPattern As RParams = RParams.DMS(".+?([^/\?]+?\.[\w\d]{3,4})(?=(\?|\Z))", 1, EDP.ReturnValue)
|
Friend ReadOnly FilesPattern As RParams = RParams.DMS(".+?([^/\?]+?\.[\w\d]{3,4})(?=(\?|\Z))", 1, EDP.ReturnValue)
|
||||||
Friend ReadOnly Property DateProvider As New JsonDate
|
Friend ReadOnly Property DateProvider As New CustomProvider(Function(v, d, p, n, e) ADateTime.ParseUnicode(v))
|
||||||
Friend Class JsonDate : Implements ICustomProvider
|
|
||||||
Private Function Convert(ByVal Value As Object, ByVal DestinationType As Type, ByVal Provider As IFormatProvider,
|
|
||||||
Optional ByVal NothingArg As Object = Nothing, Optional ByVal e As ErrorsDescriber = Nothing) As Object Implements ICustomProvider.Convert
|
|
||||||
Return ADateTime.ParseUnicode(Value)
|
|
||||||
End Function
|
|
||||||
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
|
|
||||||
Throw New NotImplementedException("GetFormat is not available in this context")
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
End Module
|
End Module
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -7,19 +7,18 @@
|
|||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
|
||||||
Namespace API.Instagram
|
Namespace API.Instagram
|
||||||
Friend Class OptionsForm : Implements IOkCancelToolbar
|
Friend Class OptionsForm
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Private ReadOnly Property MyExchangeOptions As EditorExchangeOptions
|
Private ReadOnly Property MyExchangeOptions As EditorExchangeOptions
|
||||||
Friend Sub New(ByRef ExchangeOptions As EditorExchangeOptions)
|
Friend Sub New(ByRef ExchangeOptions As EditorExchangeOptions)
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
MyExchangeOptions = ExchangeOptions
|
MyExchangeOptions = ExchangeOptions
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OptionsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub OptionsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
With MyDefs
|
With MyDefs
|
||||||
.MyViewInitialize(Me, Settings.Design, True)
|
.MyViewInitialize(True)
|
||||||
.AddOkCancelToolbar()
|
.AddOkCancelToolbar()
|
||||||
With MyExchangeOptions
|
With MyExchangeOptions
|
||||||
CH_GET_STORIES.Checked = .GetStories
|
CH_GET_STORIES.Checked = .GetStories
|
||||||
@@ -28,15 +27,12 @@ Namespace API.Instagram
|
|||||||
.EndLoaderOperations()
|
.EndLoaderOperations()
|
||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDefs_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonOkClick
|
||||||
With MyExchangeOptions
|
With MyExchangeOptions
|
||||||
.GetStories = CH_GET_STORIES.Checked
|
.GetStories = CH_GET_STORIES.Checked
|
||||||
.GetTagged = CH_GET_TAGGED.Checked
|
.GetTagged = CH_GET_TAGGED.Checked
|
||||||
End With
|
End With
|
||||||
MyDefs.CloseForm()
|
MyDefs.CloseForm()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -10,7 +10,7 @@ Imports SCrawler.API.Base
|
|||||||
Imports SCrawler.Plugin
|
Imports SCrawler.Plugin
|
||||||
Imports SCrawler.Plugin.Attributes
|
Imports SCrawler.Plugin.Attributes
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Tools
|
Imports PersonalUtilities.Tools.WEB
|
||||||
Imports PersonalUtilities.Functions.XML
|
Imports PersonalUtilities.Functions.XML
|
||||||
Imports PersonalUtilities.Functions.XML.Base
|
Imports PersonalUtilities.Functions.XML.Base
|
||||||
Imports PersonalUtilities.Functions.RegularExpressions
|
Imports PersonalUtilities.Functions.RegularExpressions
|
||||||
@@ -55,7 +55,7 @@ Namespace API.Instagram
|
|||||||
Return Nothing
|
Return Nothing
|
||||||
End Function
|
End Function
|
||||||
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
|
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
|
||||||
Throw New NotImplementedException()
|
Throw New NotImplementedException("[GetFormat] is not available in the context of [TimersChecker]")
|
||||||
End Function
|
End Function
|
||||||
End Class
|
End Class
|
||||||
Private Class TaggedNotifyLimitChecker : Implements IFieldsCheckerProvider
|
Private Class TaggedNotifyLimitChecker : Implements IFieldsCheckerProvider
|
||||||
@@ -73,7 +73,7 @@ Namespace API.Instagram
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
|
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
|
||||||
Throw New NotImplementedException()
|
Throw New NotImplementedException("[GetFormat] is not available in the context of [TaggedNotifyLimitChecker]")
|
||||||
End Function
|
End Function
|
||||||
End Class
|
End Class
|
||||||
#End Region
|
#End Region
|
||||||
@@ -186,13 +186,13 @@ Namespace API.Instagram
|
|||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
Friend Overrides ReadOnly Property Responser As WEB.Response
|
Friend Overrides ReadOnly Property Responser As Response
|
||||||
Private Initialized As Boolean = False
|
Private Initialized As Boolean = False
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Initializer"
|
#Region "Initializer"
|
||||||
Friend Sub New(ByRef _XML As XmlFile, ByVal GlobalPath As SFile)
|
Friend Sub New(ByRef _XML As XmlFile, ByVal GlobalPath As SFile)
|
||||||
MyBase.New(InstagramSite)
|
MyBase.New(InstagramSite)
|
||||||
Responser = New WEB.Response($"{SettingsFolderName}\Responser_{Site}.xml")
|
Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml")
|
||||||
|
|
||||||
Dim app_id$ = String.Empty
|
Dim app_id$ = String.Empty
|
||||||
Dim www_claim$ = String.Empty
|
Dim www_claim$ = String.Empty
|
||||||
@@ -208,6 +208,7 @@ Namespace API.Instagram
|
|||||||
End With
|
End With
|
||||||
Else
|
Else
|
||||||
.CookiesDomain = "instagram.com"
|
.CookiesDomain = "instagram.com"
|
||||||
|
.Cookies = New CookieKeeper(.CookiesDomain)
|
||||||
.SaveSettings()
|
.SaveSettings()
|
||||||
End If
|
End If
|
||||||
End With
|
End With
|
||||||
@@ -234,8 +235,7 @@ Namespace API.Instagram
|
|||||||
TaggedNotifyLimit = New PropertyValue(200)
|
TaggedNotifyLimit = New PropertyValue(200)
|
||||||
TaggedNotifyLimitProvider = New TaggedNotifyLimitChecker
|
TaggedNotifyLimitProvider = New TaggedNotifyLimitChecker
|
||||||
|
|
||||||
DownloadingErrorDate = New XMLValue(Of Date) With {
|
DownloadingErrorDate = New XMLValue(Of Date) With {.Provider = New XMLValueConversionProvider(Function(ss, vv) AConvert(Of String)(vv, AModes.Var, Nothing))}
|
||||||
.Provider = New XMLValueConversionProvider(Function(ss, vv) AConvert(Of String)(vv, AModes.Var, Nothing))}
|
|
||||||
DownloadingErrorDate.SetExtended("InstagramDownloadingErrorDate", Now.AddYears(-10), _XML, n)
|
DownloadingErrorDate.SetExtended("InstagramDownloadingErrorDate", Now.AddYears(-10), _XML, n)
|
||||||
LastDownloadDate = New XMLValue(Of Date)("LastDownloadDate", Now.AddDays(-1), _XML, n)
|
LastDownloadDate = New XMLValue(Of Date)("LastDownloadDate", Now.AddDays(-1), _XML, n)
|
||||||
LastRequestsCount = New XMLValue(Of Integer)("LastRequestsCount", 0, _XML, n)
|
LastRequestsCount = New XMLValue(Of Integer)("LastRequestsCount", 0, _XML, n)
|
||||||
@@ -288,7 +288,7 @@ Namespace API.Instagram
|
|||||||
Return True
|
Return True
|
||||||
ElseIf v = -1 Then
|
ElseIf v = -1 Then
|
||||||
Return MsgBoxE({"You turn off notifications for tagged posts. This is highly undesirable. Do you still want to do it?",
|
Return MsgBoxE({"You turn off notifications for tagged posts. This is highly undesirable. Do you still want to do it?",
|
||||||
"Disabling tagged notification limits "}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes
|
"Disabling tagged notification limits"}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes
|
||||||
Else
|
Else
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -104,11 +104,7 @@ Namespace API.Instagram
|
|||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private _InstaHash As String = String.Empty
|
Private _InstaHash As String = String.Empty
|
||||||
Friend Enum Sections
|
Private Enum Sections : Timeline : Tagged : Stories : End Enum
|
||||||
Timeline
|
|
||||||
Tagged
|
|
||||||
Stories
|
|
||||||
End Enum
|
|
||||||
Private Const StoriesFolder As String = "Stories"
|
Private Const StoriesFolder As String = "Stories"
|
||||||
Private Const TaggedFolder As String = "Tagged"
|
Private Const TaggedFolder As String = "Tagged"
|
||||||
#Region "429 bypass"
|
#Region "429 bypass"
|
||||||
@@ -187,7 +183,7 @@ Namespace API.Instagram
|
|||||||
Dim m As New MMessage("You have not entered a valid posts limit", "Tagged posts download limit", {tryBtt, selectBtt, cancelBtt})
|
Dim m As New MMessage("You have not entered a valid posts limit", "Tagged posts download limit", {tryBtt, selectBtt, cancelBtt})
|
||||||
Dim mh As New MMessage("", "Tagged posts download limit", {"Confirm", tryBtt, selectBtt, cancelBtt}) With {.ButtonsPerRow = 2}
|
Dim mh As New MMessage("", "Tagged posts download limit", {"Confirm", tryBtt, selectBtt, cancelBtt}) With {.ButtonsPerRow = 2}
|
||||||
Do
|
Do
|
||||||
v = AConvert(Of Integer)(InputBoxE(aStr, "Tagged posts download limit", CInt(MySiteSettings.TaggedNotifyLimit.Value)), Nothing)
|
v = AConvert(Of Integer)(InputBoxE(aStr, "Tagged posts download limit", CInt(MySiteSettings.TaggedNotifyLimit.Value)), AModes.Var, Nothing)
|
||||||
If v.HasValue Then
|
If v.HasValue Then
|
||||||
mh.Text = $"You have entered a limit of {v.Value.NumToString(p)} posts"
|
mh.Text = $"You have entered a limit of {v.Value.NumToString(p)} posts"
|
||||||
Select Case MsgBoxE(mh).Index
|
Select Case MsgBoxE(mh).Index
|
||||||
@@ -342,8 +338,7 @@ Namespace API.Instagram
|
|||||||
_TempPostsList.Add(PostID)
|
_TempPostsList.Add(PostID)
|
||||||
ObtainMedia2(nn, PostID, SpecFolder)
|
ObtainMedia2(nn, PostID, SpecFolder)
|
||||||
DownloadedTags += 1
|
DownloadedTags += 1
|
||||||
If DownloadTagsLimit.HasValue AndAlso DownloadedTags >= DownloadTagsLimit.Value Then _
|
If DownloadTagsLimit.HasValue AndAlso DownloadedTags >= DownloadTagsLimit.Value Then Throw New ExitException(_DownloadComplete)
|
||||||
Throw New ExitException(_DownloadComplete)
|
|
||||||
Next
|
Next
|
||||||
If TaggedLimitsNotifications Then
|
If TaggedLimitsNotifications Then
|
||||||
TaggedCount = j.Value("total_count").FromXML(Of Integer)(0)
|
TaggedCount = j.Value("total_count").FromXML(Of Integer)(0)
|
||||||
@@ -444,7 +439,6 @@ Namespace API.Instagram
|
|||||||
End Sub
|
End Sub
|
||||||
Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken)
|
Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Obtain Media"
|
#Region "Obtain Media"
|
||||||
Private Sub ObtainMedia(ByVal node As EContainer, ByVal PostID As String, ByVal PostDate As String, ByVal SpecFolder As String)
|
Private Sub ObtainMedia(ByVal node As EContainer, ByVal PostID As String, ByVal PostDate As String, ByVal SpecFolder As String)
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
Imports PersonalUtilities.Tools
|
Imports PersonalUtilities.Tools
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
Imports PersonalUtilities.Forms.Toolbars
|
||||||
Imports PersonalUtilities.Functions.XML
|
Imports PersonalUtilities.Functions.XML
|
||||||
|
Imports System.Threading
|
||||||
Imports SCrawler.API.Base
|
Imports SCrawler.API.Base
|
||||||
Imports SCrawler.Plugin.Hosts
|
Imports SCrawler.Plugin.Hosts
|
||||||
Imports System.Threading
|
|
||||||
Imports SCrawler.API.Reddit.RedditViewExchange
|
Imports SCrawler.API.Reddit.RedditViewExchange
|
||||||
Imports View = SCrawler.API.Reddit.IRedditView.View
|
Imports View = SCrawler.API.Reddit.IRedditView.View
|
||||||
Imports Period = SCrawler.API.Reddit.IRedditView.Period
|
Imports Period = SCrawler.API.Reddit.IRedditView.Period
|
||||||
@@ -112,7 +112,7 @@ Namespace API.Reddit
|
|||||||
ChannelExistentUserNames.ListAddList((From p As UserPost In PostsAll
|
ChannelExistentUserNames.ListAddList((From p As UserPost In PostsAll
|
||||||
Where Not p.UserID.IsEmptyString AndAlso
|
Where Not p.UserID.IsEmptyString AndAlso
|
||||||
Settings.UsersList.Exists(Function(u) u.Site = Site And u.Name = p.UserID)
|
Settings.UsersList.Exists(Function(u) u.Site = Site And u.Name = p.UserID)
|
||||||
Select p.UserID), LAP.NotContainsOnly)
|
Select p.UserID), LNC)
|
||||||
ChannelExistentUserNames.RemoveAll(Function(u) Not Settings.UsersList.Exists(Function(uu) uu.Site = Site And uu.Name = u))
|
ChannelExistentUserNames.RemoveAll(Function(u) Not Settings.UsersList.Exists(Function(uu) uu.Site = Site And uu.Name = u))
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -165,7 +165,7 @@ Namespace API.Reddit
|
|||||||
If Not ViewMode = View.New And AutoGetLimits Then
|
If Not ViewMode = View.New And AutoGetLimits Then
|
||||||
Return _DownloadLimitPost
|
Return _DownloadLimitPost
|
||||||
Else
|
Else
|
||||||
Dim PID$ = ListAddList(Nothing, Posts, LAP.NotContainsOnly).ListAddList(PostsLatest, LAP.NotContainsOnly).ListSort.FirstOrDefault.ID
|
Dim PID$ = ListAddList(Nothing, Posts, LNC).ListAddList(PostsLatest, LNC).ListSort.FirstOrDefault.ID
|
||||||
If AutoGetLimits And Not PID.IsEmptyString Then
|
If AutoGetLimits And Not PID.IsEmptyString Then
|
||||||
Return PID
|
Return PID
|
||||||
Else
|
Else
|
||||||
@@ -233,11 +233,7 @@ Namespace API.Reddit
|
|||||||
Return New Channel(f)
|
Return New Channel(f)
|
||||||
End Operator
|
End Operator
|
||||||
Public Overrides Function ToString() As String
|
Public Overrides Function ToString() As String
|
||||||
If Not Name.IsEmptyString Then
|
Return If(Name.IsEmptyString, ID, Name)
|
||||||
Return Name
|
|
||||||
Else
|
|
||||||
Return ID
|
|
||||||
End If
|
|
||||||
End Function
|
End Function
|
||||||
Friend Sub Delete()
|
Friend Sub Delete()
|
||||||
File.Delete(, SFODelete.DeleteToRecycleBin)
|
File.Delete(, SFODelete.DeleteToRecycleBin)
|
||||||
@@ -261,7 +257,7 @@ Namespace API.Reddit
|
|||||||
.DownloadData(Token)
|
.DownloadData(Token)
|
||||||
End With
|
End With
|
||||||
Dim b% = Posts.Count
|
Dim b% = Posts.Count
|
||||||
Posts.ListAddList(d.GetNewChannelPosts(), LAP.NotContainsOnly)
|
Posts.ListAddList(d.GetNewChannelPosts(), LNC)
|
||||||
If Posts.Count - b > 0 Then CountOfLoadedPostsPerSession.Add(Posts.Count - b)
|
If Posts.Count - b > 0 Then CountOfLoadedPostsPerSession.Add(Posts.Count - b)
|
||||||
Posts.Sort()
|
Posts.Sort()
|
||||||
LatestParsedDate = If(Posts.FirstOrDefault(Function(pp) pp.Date.HasValue).Date, LatestParsedDate)
|
LatestParsedDate = If(Posts.FirstOrDefault(Function(pp) pp.Date.HasValue).Date, LatestParsedDate)
|
||||||
@@ -364,8 +360,8 @@ Namespace API.Reddit
|
|||||||
UpdateUsersStats()
|
UpdateUsersStats()
|
||||||
If Not ViewMode = View.New Then
|
If Not ViewMode = View.New Then
|
||||||
Dim l As New List(Of String)
|
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), LAP.NotContainsOnly)
|
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, LAP.NotContainsOnly)
|
l.ListAddList(PostsNames, LNC)
|
||||||
If l.Count > 0 Then TextSaver.SaveTextToFile(l.ListToString("|"), FilePosts, True,, EDP.SendInLog)
|
If l.Count > 0 Then TextSaver.SaveTextToFile(l.ListToString("|"), FilePosts, True,, EDP.SendInLog)
|
||||||
End If
|
End If
|
||||||
Using x As New XmlFile With {.AllowSameNames = True, .Name = "Channel"}
|
Using x As New XmlFile With {.AllowSameNames = True, .Name = "Channel"}
|
||||||
|
|||||||
@@ -12,8 +12,16 @@ Imports SCrawler.API.Base
|
|||||||
Imports System.Threading
|
Imports System.Threading
|
||||||
Namespace API.Reddit
|
Namespace API.Reddit
|
||||||
Friend Class ChannelsCollection : Implements ICollection(Of Channel), IMyEnumerator(Of Channel), IChannelLimits, IDisposable
|
Friend Class ChannelsCollection : Implements ICollection(Of Channel), IMyEnumerator(Of Channel), IChannelLimits, IDisposable
|
||||||
Friend Shared ReadOnly Property ChannelsPath As SFile = $"{SettingsFolderName}\Channels\"
|
Friend Shared ReadOnly Property ChannelsPath As SFile
|
||||||
Friend Shared ReadOnly Property ChannelsPathCache As SFile = $"{Settings.GlobalPath.Value.PathWithSeparator}_CachedData\"
|
Get
|
||||||
|
Return $"{SettingsFolderName}\Channels\"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Friend Shared ReadOnly Property ChannelsPathCache As SFile
|
||||||
|
Get
|
||||||
|
Return $"{Settings.GlobalPath.Value.PathWithSeparator}_CachedData\"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
Private ReadOnly Channels As List(Of Channel)
|
Private ReadOnly Channels As List(Of Channel)
|
||||||
Friend Structure ChannelImage : Implements IEquatable(Of ChannelImage)
|
Friend Structure ChannelImage : Implements IEquatable(Of ChannelImage)
|
||||||
Friend File As SFile
|
Friend File As SFile
|
||||||
@@ -42,7 +50,7 @@ Namespace API.Reddit
|
|||||||
Return Nothing
|
Return Nothing
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Return ErrorsDescriber.Execute(EDP.SendInLog + EDP.ReturnValue, ex)
|
Return ErrorsDescriber.Execute(EDP.SendInLog + EDP.ReturnValue, ex, "[API.Reddit.ChannelsCollection.GetUserFiles]")
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
Friend Sub UpdateUsersStats()
|
Friend Sub UpdateUsersStats()
|
||||||
@@ -97,7 +105,7 @@ Namespace API.Reddit
|
|||||||
If Item(i).ID = ChannelID Then Return Item(i)
|
If Item(i).ID = ChannelID Then Return Item(i)
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
Throw New ArgumentException($"Channel ID [{ChannelID}] does not found in channels collection", "ChannelID") With {.HelpLink = 1}
|
Throw New ArgumentException($"Channel ID [{ChannelID}] not found in channel collection", "ChannelID") With {.HelpLink = 1}
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Friend Sub DownloadData(ByVal Token As CancellationToken, Optional ByVal SkipExists As Boolean = True,
|
Friend Sub DownloadData(ByVal Token As CancellationToken, Optional ByVal SkipExists As Boolean = True,
|
||||||
|
|||||||
@@ -17,26 +17,8 @@ Namespace API.Reddit
|
|||||||
New NodeParams("children", True, True, True)}
|
New NodeParams("children", True, True, True)}
|
||||||
Friend ReadOnly UrlBasePattern As RParams = RParams.DM("(?<=/)([^/]+?\.[\w]{3,4})(?=(\?|\Z))", 0)
|
Friend ReadOnly UrlBasePattern As RParams = RParams.DM("(?<=/)([^/]+?\.[\w]{3,4})(?=(\?|\Z))", 0)
|
||||||
Friend ReadOnly VideoRegEx As RParams = RParams.DM("http.{0,1}://[^" & Chr(34) & "]+?mp4", 0)
|
Friend ReadOnly VideoRegEx As RParams = RParams.DM("http.{0,1}://[^" & Chr(34) & "]+?mp4", 0)
|
||||||
Friend ReadOnly DateProvider As New JsonDate
|
|
||||||
Friend ReadOnly DateProviderChannel As New JsonDateChannel
|
|
||||||
Private ReadOnly EUR_PROVIDER As New ANumbers(ANumbers.Cultures.EUR)
|
Private ReadOnly EUR_PROVIDER As New ANumbers(ANumbers.Cultures.EUR)
|
||||||
Friend Class JsonDate : Implements ICustomProvider
|
Friend ReadOnly DateProvider As New CustomProvider(Function(v, d, p, n, e) ADateTime.ParseUnicodeJS(v, n, e))
|
||||||
Friend Function Convert(ByVal Value As Object, ByVal DestinationType As Type, ByVal Provider As IFormatProvider,
|
Friend ReadOnly DateProviderChannel As New CustomProvider(Function(v, d, p, n, e) ADateTime.ParseUnicode(AConvert(Of Integer)(v, EUR_PROVIDER, v), n, e))
|
||||||
Optional ByVal NothingArg As Object = Nothing, Optional ByVal e As ErrorsDescriber = Nothing) As Object Implements ICustomProvider.Convert
|
|
||||||
Return ADateTime.ParseUnicodeJS(Value, NothingArg, e)
|
|
||||||
End Function
|
|
||||||
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
|
|
||||||
Throw New NotImplementedException("GetFormat is not available in this context")
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
Friend Class JsonDateChannel : Implements ICustomProvider
|
|
||||||
Friend Function Convert(ByVal Value As Object, ByVal DestinationType As Type, ByVal Provider As IFormatProvider,
|
|
||||||
Optional ByVal NothingArg As Object = Nothing, Optional ByVal e As ErrorsDescriber = Nothing) As Object Implements ICustomProvider.Convert
|
|
||||||
Return ADateTime.ParseUnicode(AConvert(Of Integer)(Value, EUR_PROVIDER, Value), NothingArg, e)
|
|
||||||
End Function
|
|
||||||
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
|
|
||||||
Throw New NotImplementedException("GetFormat is not available in this context")
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
End Module
|
End Module
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -15,12 +15,10 @@ Namespace API.Reddit
|
|||||||
Friend Module M3U8_Declarations
|
Friend Module M3U8_Declarations
|
||||||
Friend ReadOnly BaseUrlPattern As RParams = RParams.DM("([htps:/]{7,8}.+?/.+?)(?=/)", 0, EDP.ReturnValue)
|
Friend ReadOnly BaseUrlPattern As RParams = RParams.DM("([htps:/]{7,8}.+?/.+?)(?=/)", 0, EDP.ReturnValue)
|
||||||
''' <summary>Video</summary>
|
''' <summary>Video</summary>
|
||||||
Friend ReadOnly PlayListRegEx_1 As RParams = RParams.DM("(#EXT-X-STREAM-INF)(.+)(RESOLUTION=)(\d+)(.+?[\r\n]{1,2})(.+?)([\r\n]{1,2})", 0,
|
Friend ReadOnly PlayListRegEx_1 As RParams = RParams.DM("(#EXT-X-STREAM-INF)(.+)(RESOLUTION=)(\d+)(.+?[\r\n]{1,2})(.+?)([\r\n]{1,2})", 0, RegexReturn.List)
|
||||||
RegexReturn.List, EDP.SendInLog, EDP.ReturnValue)
|
|
||||||
''' <summary>Audio, Video</summary>
|
''' <summary>Audio, Video</summary>
|
||||||
Friend ReadOnly PlayListRegEx_2 As RParams = RParams.DM("(?<=#EXT-X-BYTERANGE.+?[\r\n]{1,2})(.+)(?=[\r\n]{0,2})", 0,
|
Friend ReadOnly PlayListRegEx_2 As RParams = RParams.DM("(?<=#EXT-X-BYTERANGE.+?[\r\n]{1,2})(.+)(?=[\r\n]{0,2})", 0, RegexReturn.List)
|
||||||
RegexReturn.List, EDP.SendInLog, EDP.ReturnValue)
|
Friend ReadOnly PlayListAudioRegEx As RParams = RParams.DM("(HLS_AUDIO_(\d+)[^""]+)", 0, RegexReturn.List)
|
||||||
Friend ReadOnly PlayListAudioRegEx As RParams = RParams.DM("(HLS_AUDIO_(\d+)[^""]+)", 0, RegexReturn.List, EDP.SendInLog, EDP.ReturnValue)
|
|
||||||
Friend ReadOnly DPED As New ErrorsDescriber(EDP.SendInLog + EDP.ReturnValue)
|
Friend ReadOnly DPED As New ErrorsDescriber(EDP.SendInLog + EDP.ReturnValue)
|
||||||
End Module
|
End Module
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -80,11 +78,11 @@ Namespace API.Reddit
|
|||||||
If Not r.IsEmptyString Then
|
If Not r.IsEmptyString Then
|
||||||
Dim l As New List(Of Resolution)
|
Dim l As New List(Of Resolution)
|
||||||
If Type = Types.Video Then
|
If Type = Types.Video Then
|
||||||
l = FNF.RegexFields(Of Resolution)(r, {PlayListRegEx_1}, {6, 4})
|
l = RegexFields(Of Resolution)(r, {PlayListRegEx_1}, {6, 4})
|
||||||
Else
|
Else
|
||||||
Try
|
Try
|
||||||
l = FNF.RegexFields(Of Resolution)(r, {PlayListAudioRegEx}, {1, 2})
|
l = RegexFields(Of Resolution)(r, {PlayListAudioRegEx}, {1, 2})
|
||||||
Catch anull As FNF.RegexFieldsTextBecameNullException
|
Catch anull As RegexFieldsTextBecameNullException
|
||||||
l.Clear()
|
l.Clear()
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -7,17 +7,16 @@
|
|||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
|
||||||
Imports CView = SCrawler.API.Reddit.IRedditView.View
|
Imports CView = SCrawler.API.Reddit.IRedditView.View
|
||||||
Imports CPeriod = SCrawler.API.Reddit.IRedditView.Period
|
Imports CPeriod = SCrawler.API.Reddit.IRedditView.Period
|
||||||
Namespace API.Reddit
|
Namespace API.Reddit
|
||||||
Friend Class RedditViewSettingsForm : Implements IOkCancelToolbar
|
Friend Class RedditViewSettingsForm
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Private ReadOnly Property MyOptions As IRedditView
|
Private ReadOnly Property MyOptions As IRedditView
|
||||||
Friend Sub New(ByRef opt As IRedditView)
|
Friend Sub New(ByRef opt As IRedditView)
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
MyOptions = opt
|
MyOptions = opt
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub ChannelSettingsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub ChannelSettingsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
Try
|
Try
|
||||||
@@ -29,7 +28,7 @@ Namespace API.Reddit
|
|||||||
End If
|
End If
|
||||||
If Not n.IsEmptyString Then Text = n
|
If Not n.IsEmptyString Then Text = n
|
||||||
With MyDefs
|
With MyDefs
|
||||||
.MyViewInitialize(Me, Settings.Design, True)
|
.MyViewInitialize(True)
|
||||||
.AddOkCancelToolbar()
|
.AddOkCancelToolbar()
|
||||||
Select Case MyOptions.ViewMode
|
Select Case MyOptions.ViewMode
|
||||||
Case CView.Hot : OPT_VIEW_MODE_HOT.Checked = True
|
Case CView.Hot : OPT_VIEW_MODE_HOT.Checked = True
|
||||||
@@ -51,7 +50,7 @@ Namespace API.Reddit
|
|||||||
MyDefs.InvokeLoaderError(ex)
|
MyDefs.InvokeLoaderError(ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDefs_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonOkClick
|
||||||
With MyOptions
|
With MyOptions
|
||||||
Select Case True
|
Select Case True
|
||||||
Case OPT_VIEW_MODE_HOT.Checked : .ViewMode = CView.Hot
|
Case OPT_VIEW_MODE_HOT.Checked : .ViewMode = CView.Hot
|
||||||
@@ -69,9 +68,6 @@ Namespace API.Reddit
|
|||||||
End With
|
End With
|
||||||
MyDefs.CloseForm()
|
MyDefs.CloseForm()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
Private Sub OPT_VIEW_MODE_NEW_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_VIEW_MODE_NEW.CheckedChanged
|
Private Sub OPT_VIEW_MODE_NEW_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_VIEW_MODE_NEW.CheckedChanged
|
||||||
ChangePeriodEnabled()
|
ChangePeriodEnabled()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
Imports SCrawler.API.Base
|
Imports SCrawler.API.Base
|
||||||
Imports SCrawler.Plugin
|
Imports SCrawler.Plugin
|
||||||
Imports SCrawler.Plugin.Attributes
|
Imports SCrawler.Plugin.Attributes
|
||||||
Imports PersonalUtilities.Tools
|
Imports PersonalUtilities.Tools.WEB
|
||||||
Imports PersonalUtilities.Functions.RegularExpressions
|
Imports PersonalUtilities.Functions.RegularExpressions
|
||||||
Imports DownDetector = SCrawler.API.Base.DownDetector
|
Imports DownDetector = SCrawler.API.Base.DownDetector
|
||||||
Imports Download = SCrawler.Plugin.ISiteSettings.Download
|
Imports Download = SCrawler.Plugin.ISiteSettings.Download
|
||||||
@@ -30,16 +30,17 @@ Namespace API.Reddit
|
|||||||
Friend ReadOnly Property SavedPostsUserName As PropertyValue
|
Friend ReadOnly Property SavedPostsUserName As PropertyValue
|
||||||
<PropertyOption(ControlText:="Use M3U8", ControlToolTip:="Use M3U8 or mp4 for Reddit videos"), PXML>
|
<PropertyOption(ControlText:="Use M3U8", ControlToolTip:="Use M3U8 or mp4 for Reddit videos"), PXML>
|
||||||
Friend ReadOnly Property UseM3U8 As PropertyValue
|
Friend ReadOnly Property UseM3U8 As PropertyValue
|
||||||
Friend Overrides ReadOnly Property Responser As WEB.Response
|
Friend Overrides ReadOnly Property Responser As Response
|
||||||
Friend Sub New()
|
Friend Sub New()
|
||||||
MyBase.New(RedditSite)
|
MyBase.New(RedditSite)
|
||||||
Responser = New WEB.Response($"{SettingsFolderName}\Responser_{Site}.xml")
|
Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml")
|
||||||
|
|
||||||
With Responser
|
With Responser
|
||||||
If .File.Exists Then
|
If .File.Exists Then
|
||||||
.LoadSettings()
|
.LoadSettings()
|
||||||
Else
|
Else
|
||||||
.CookiesDomain = "reddit.com"
|
.CookiesDomain = "reddit.com"
|
||||||
|
.Cookies = New CookieKeeper(.CookiesDomain)
|
||||||
.Decoders.Add(SymbolsConverter.Converters.Unicode)
|
.Decoders.Add(SymbolsConverter.Converters.Unicode)
|
||||||
.SaveSettings()
|
.SaveSettings()
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ Namespace API.Reddit
|
|||||||
Friend Property AutoGetLimits As Boolean = True Implements IChannelLimits.AutoGetLimits
|
Friend Property AutoGetLimits As Boolean = True Implements IChannelLimits.AutoGetLimits
|
||||||
#End Region
|
#End Region
|
||||||
Friend Property ChannelInfo As Channel
|
Friend Property ChannelInfo As Channel
|
||||||
Private ReadOnly ChannelPostsNames As New List(Of String)
|
Private ReadOnly ChannelPostsNames As List(Of String)
|
||||||
Friend Property SkipExistsUsers As Boolean = True Implements IChannelData.SkipExistsUsers
|
Friend Property SkipExistsUsers As Boolean = True Implements IChannelData.SkipExistsUsers
|
||||||
Private ReadOnly _ExistsUsersNames As List(Of String)
|
Private ReadOnly _ExistsUsersNames As List(Of String)
|
||||||
Friend Property SaveToCache As Boolean = False Implements IChannelData.SaveToCache
|
Friend Property SaveToCache As Boolean = False Implements IChannelData.SaveToCache
|
||||||
|
|||||||
@@ -9,15 +9,6 @@
|
|||||||
Namespace API.RedGifs
|
Namespace API.RedGifs
|
||||||
Friend Module Declarations
|
Friend Module Declarations
|
||||||
Friend Const RedGifsSite As String = "RedGifs"
|
Friend Const RedGifsSite As String = "RedGifs"
|
||||||
Friend ReadOnly DateProvider As New JsonDate
|
Friend ReadOnly DateProvider As New CustomProvider(Function(v, d, p, n, e) ADateTime.ParseUnicode(v, n, e))
|
||||||
Friend Class JsonDate : Implements ICustomProvider
|
|
||||||
Friend Function Convert(ByVal Value As Object, ByVal DestinationType As Type, ByVal Provider As IFormatProvider,
|
|
||||||
Optional ByVal NothingArg As Object = Nothing, Optional ByVal e As ErrorsDescriber = Nothing) As Object Implements ICustomProvider.Convert
|
|
||||||
Return ADateTime.ParseUnicode(Value, NothingArg, e)
|
|
||||||
End Function
|
|
||||||
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
|
|
||||||
Throw New NotImplementedException("GetFormat is not available in this context")
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
End Module
|
End Module
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -9,8 +9,8 @@
|
|||||||
Imports PersonalUtilities.Functions.XML
|
Imports PersonalUtilities.Functions.XML
|
||||||
Imports PersonalUtilities.Functions.RegularExpressions
|
Imports PersonalUtilities.Functions.RegularExpressions
|
||||||
Imports PersonalUtilities.Tools.WebDocuments.JSON
|
Imports PersonalUtilities.Tools.WebDocuments.JSON
|
||||||
Imports System.Threading
|
|
||||||
Imports System.Net
|
Imports System.Net
|
||||||
|
Imports System.Threading
|
||||||
Imports SCrawler.API.Base
|
Imports SCrawler.API.Base
|
||||||
Imports UTypes = SCrawler.API.Base.UserMedia.Types
|
Imports UTypes = SCrawler.API.Base.UserMedia.Types
|
||||||
Namespace API.RedGifs
|
Namespace API.RedGifs
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
Imports SCrawler.API.Base
|
Imports SCrawler.API.Base
|
||||||
Imports SCrawler.Plugin
|
Imports SCrawler.Plugin
|
||||||
Imports SCrawler.Plugin.Attributes
|
Imports SCrawler.Plugin.Attributes
|
||||||
Imports PersonalUtilities.Tools
|
Imports PersonalUtilities.Tools.WEB
|
||||||
Imports PersonalUtilities.Functions.RegularExpressions
|
Imports PersonalUtilities.Functions.RegularExpressions
|
||||||
Namespace API.Twitter
|
Namespace API.Twitter
|
||||||
<Manifest("AndyProgram_Twitter"), SavedPosts, UseClassAsIs>
|
<Manifest("AndyProgram_Twitter"), SavedPosts, UseClassAsIs>
|
||||||
@@ -33,10 +33,10 @@ Namespace API.Twitter
|
|||||||
Private ReadOnly Property Token As PropertyValue
|
Private ReadOnly Property Token As PropertyValue
|
||||||
<PropertyOption(ControlText:="Saved posts user name", ControlToolTip:="Personal profile username", LeftOffset:=120), PXML>
|
<PropertyOption(ControlText:="Saved posts user name", ControlToolTip:="Personal profile username", LeftOffset:=120), PXML>
|
||||||
Friend ReadOnly Property SavedPostsUserName As PropertyValue
|
Friend ReadOnly Property SavedPostsUserName As PropertyValue
|
||||||
Friend Overrides ReadOnly Property Responser As WEB.Response
|
Friend Overrides ReadOnly Property Responser As Response
|
||||||
Friend Sub New()
|
Friend Sub New()
|
||||||
MyBase.New(TwitterSite)
|
MyBase.New(TwitterSite)
|
||||||
Responser = New WEB.Response($"{SettingsFolderName}\Responser_{Site}.xml")
|
Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml")
|
||||||
|
|
||||||
Dim a$ = String.Empty
|
Dim a$ = String.Empty
|
||||||
Dim t$ = String.Empty
|
Dim t$ = String.Empty
|
||||||
@@ -52,11 +52,10 @@ Namespace API.Twitter
|
|||||||
.ContentType = "application/json"
|
.ContentType = "application/json"
|
||||||
.Accept = "*/*"
|
.Accept = "*/*"
|
||||||
.CookiesDomain = "twitter.com"
|
.CookiesDomain = "twitter.com"
|
||||||
|
.Cookies = New CookieKeeper(.CookiesDomain)
|
||||||
.Decoders.Add(SymbolsConverter.Converters.Unicode)
|
.Decoders.Add(SymbolsConverter.Converters.Unicode)
|
||||||
With .Headers
|
With .Headers
|
||||||
.Add("sec-ch-ua", " Not;A Brand" & Chr(34) & ";v=" & Chr(34) & "99" & Chr(34) & ", " & Chr(34) &
|
.Add("sec-ch-ua", " Not;A Brand"";v=""99"", ""Google Chrome"";v=""91"", ""Chromium"";v=""91""")
|
||||||
"Google Chrome" & Chr(34) & ";v=" & Chr(34) & "91" & Chr(34) & ", " & Chr(34) & "Chromium" &
|
|
||||||
Chr(34) & ";v=" & Chr(34) & "91" & Chr(34))
|
|
||||||
.Add("sec-ch-ua-mobile", "?0")
|
.Add("sec-ch-ua-mobile", "?0")
|
||||||
.Add("sec-fetch-dest", "empty")
|
.Add("sec-fetch-dest", "empty")
|
||||||
.Add("sec-fetch-mode", "cors")
|
.Add("sec-fetch-mode", "cors")
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ Namespace API.Twitter
|
|||||||
Dim r$ = Responser.GetResponse(URL,, EDP.ThrowException)
|
Dim r$ = Responser.GetResponse(URL,, EDP.ThrowException)
|
||||||
If Not r.IsEmptyString Then
|
If Not r.IsEmptyString Then
|
||||||
Using w As EContainer = JsonDocument.Parse(r)
|
Using w As EContainer = JsonDocument.Parse(r)
|
||||||
If Not w Is Nothing AndAlso w.Count > 0 Then
|
If w.ListExists Then
|
||||||
For Each nn In If(IsSavedPosts, w({"globalObjects", "tweets"}).XmlIfNothing, w)
|
For Each nn In If(IsSavedPosts, w({"globalObjects", "tweets"}).XmlIfNothing, w)
|
||||||
ThrowAny(Token)
|
ThrowAny(Token)
|
||||||
If nn.Count > 0 Then
|
If nn.Count > 0 Then
|
||||||
@@ -141,8 +141,7 @@ Namespace API.Twitter
|
|||||||
If URL.Contains("twitter") Then
|
If URL.Contains("twitter") Then
|
||||||
Dim PostID$ = RegexReplace(URL, RParams.DM("(?<=/)\d+", 0))
|
Dim PostID$ = RegexReplace(URL, RParams.DM("(?<=/)\d+", 0))
|
||||||
If Not PostID.IsEmptyString Then
|
If Not PostID.IsEmptyString Then
|
||||||
Dim r$ = DirectCast(resp.Copy(), Response).
|
Dim r$ = DirectCast(resp.Copy(), Response).GetResponse($"https://api.twitter.com/1.1/statuses/show.json?id={PostID}",, EDP.ReturnValue)
|
||||||
GetResponse($"https://api.twitter.com/1.1/statuses/show.json?id={PostID}",, EDP.ReturnValue)
|
|
||||||
If Not r.IsEmptyString Then
|
If Not r.IsEmptyString Then
|
||||||
Using j As EContainer = JsonDocument.Parse(r)
|
Using j As EContainer = JsonDocument.Parse(r)
|
||||||
If j.ListExists Then
|
If j.ListExists Then
|
||||||
@@ -163,7 +162,7 @@ Namespace API.Twitter
|
|||||||
Const P4K As String = "4096x4096"
|
Const P4K As String = "4096x4096"
|
||||||
Try
|
Try
|
||||||
Dim ww As EContainer = w("sizes")
|
Dim ww As EContainer = w("sizes")
|
||||||
If Not ww Is Nothing AndAlso ww.Count > 0 Then
|
If ww.ListExists Then
|
||||||
Dim l As New List(Of Sizes)
|
Dim l As New List(Of Sizes)
|
||||||
Dim Orig As Sizes? = New Sizes(w.Value({"original_info"}, "height").FromXML(Of Integer)(-1), P4K)
|
Dim Orig As Sizes? = New Sizes(w.Value({"original_info"}, "height").FromXML(Of Integer)(-1), P4K)
|
||||||
If Orig.Value.Value = -1 Then Orig = Nothing
|
If Orig.Value.Value = -1 Then Orig = Nothing
|
||||||
@@ -177,7 +176,6 @@ Namespace API.Twitter
|
|||||||
Return P4K
|
Return P4K
|
||||||
ElseIf l(0).Data.IsEmptyString Then
|
ElseIf l(0).Data.IsEmptyString Then
|
||||||
Return P4K
|
Return P4K
|
||||||
'If LargeContained Then Return "large" Else Return P4K
|
|
||||||
Else
|
Else
|
||||||
Return l(0).Data
|
Return l(0).Data
|
||||||
End If
|
End If
|
||||||
@@ -222,8 +220,8 @@ Namespace API.Twitter
|
|||||||
Dim url$, ff$
|
Dim url$, ff$
|
||||||
Dim f As SFile
|
Dim f As SFile
|
||||||
Dim m As UserMedia
|
Dim m As UserMedia
|
||||||
With w({"extended_entities", "media"}).XmlIfNothing
|
With w({"extended_entities", "media"})
|
||||||
If .Count > 0 Then
|
If .ListExists Then
|
||||||
For Each n As EContainer In .Self
|
For Each n As EContainer In .Self
|
||||||
If n.Value("type") = "animated_gif" Then
|
If n.Value("type") = "animated_gif" Then
|
||||||
With n({"video_info", "variants"}).XmlIfNothing.ItemF({gifUrl}).XmlIfNothing
|
With n({"video_info", "variants"}).XmlIfNothing.ItemF({gifUrl}).XmlIfNothing
|
||||||
@@ -251,7 +249,7 @@ Namespace API.Twitter
|
|||||||
End Function
|
End Function
|
||||||
Private Shared Function GetVideoNodeURL(ByVal w As EContainer) As String
|
Private Shared Function GetVideoNodeURL(ByVal w As EContainer) As String
|
||||||
Dim v As EContainer = w.GetNode(VideoNode)
|
Dim v As EContainer = w.GetNode(VideoNode)
|
||||||
If Not v Is Nothing AndAlso v.Count > 0 Then
|
If v.ListExists Then
|
||||||
Dim l As New List(Of Sizes)
|
Dim l As New List(Of Sizes)
|
||||||
Dim u$
|
Dim u$
|
||||||
Dim nn As EContainer
|
Dim nn As EContainer
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ Namespace API
|
|||||||
If Count > 0 Then
|
If Count > 0 Then
|
||||||
Return Collections(0).GetPicture
|
Return Collections(0).GetPicture
|
||||||
Else
|
Else
|
||||||
Return GetNullPicture(Settings.MaxLargeImageHeigh)
|
Return GetNullPicture(Settings.MaxLargeImageHeight)
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
@@ -191,10 +191,10 @@ Namespace API
|
|||||||
Friend Overrides Property LastUpdated As Date?
|
Friend Overrides Property LastUpdated As Date?
|
||||||
Get
|
Get
|
||||||
If Count > 0 Then
|
If Count > 0 Then
|
||||||
With If((From c As IUserData In Collections
|
With (From c As IUserData In Collections
|
||||||
Where DirectCast(c, UserDataBase).LastUpdated.HasValue
|
Where DirectCast(c, UserDataBase).LastUpdated.HasValue
|
||||||
Select DirectCast(c, UserDataBase).LastUpdated.Value).ToList, New List(Of Date))
|
Select DirectCast(c, UserDataBase).LastUpdated.Value).ToList
|
||||||
If .Count > 0 Then Return .Max
|
If .ListExists Then Return .Max
|
||||||
End With
|
End With
|
||||||
End If
|
End If
|
||||||
Return Nothing
|
Return Nothing
|
||||||
@@ -328,7 +328,7 @@ Namespace API
|
|||||||
Friend Overrides Sub OpenFolder()
|
Friend Overrides Sub OpenFolder()
|
||||||
Try
|
Try
|
||||||
If Count > 0 Then GlobalOpenPath(Collections(0).File.CutPath(2))
|
If Count > 0 Then GlobalOpenPath(Collections(0).File.CutPath(2))
|
||||||
Catch ex As Exception
|
Catch
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
@@ -406,7 +406,7 @@ Namespace API
|
|||||||
If Count > 1 AndAlso ScriptUse Then Collections.ForEach(Sub(c) c.ScriptUse = True)
|
If Count > 1 AndAlso ScriptUse Then Collections.ForEach(Sub(c) c.ScriptUse = True)
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub AddRange(ByVal _Items As IEnumerable(Of IUserData))
|
Friend Sub AddRange(ByVal _Items As IEnumerable(Of IUserData))
|
||||||
If Not _Items Is Nothing AndAlso _Items.Count > 0 Then
|
If _Items.ListExists Then
|
||||||
For i% = 0 To _Items.Count - 1 : Add(_Items(i)) : Next
|
For i% = 0 To _Items.Count - 1 : Add(_Items(i)) : Next
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -441,7 +441,7 @@ Namespace API
|
|||||||
Collections.ListClearDispose
|
Collections.ListClearDispose
|
||||||
End Sub
|
End Sub
|
||||||
Friend Function Contains(ByVal _Item As IUserData) As Boolean Implements ICollection(Of IUserData).Contains
|
Friend Function Contains(ByVal _Item As IUserData) As Boolean Implements ICollection(Of IUserData).Contains
|
||||||
Return Collections.Contains(_Item)
|
Return Count > 0 AndAlso Collections.Contains(_Item)
|
||||||
End Function
|
End Function
|
||||||
Private Sub CopyTo(ByVal _Array() As IUserData, ByVal _ArrayIndex As Integer) Implements ICollection(Of IUserData).CopyTo
|
Private Sub CopyTo(ByVal _Array() As IUserData, ByVal _ArrayIndex As Integer) Implements ICollection(Of IUserData).CopyTo
|
||||||
Throw New NotImplementedException("[CopyTo] method does not supported in collections context")
|
Throw New NotImplementedException("[CopyTo] method does not supported in collections context")
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
RefillChannels(Settings.LatestSelectedChannel.Value)
|
RefillChannels(Settings.LatestSelectedChannel.Value)
|
||||||
ChangeComboIndex(0)
|
ChangeComboIndex(0)
|
||||||
MyRange.LabelText = String.Empty
|
MyRange.LabelText = String.Empty
|
||||||
CMB_CHANNELS_ActionOnCheckedChange(CMB_CHANNELS.Checked)
|
CMB_CHANNELS_ActionOnCheckedChange(Nothing, Nothing, CMB_CHANNELS.Checked)
|
||||||
With LIST_POSTS
|
With LIST_POSTS
|
||||||
Dim s As Size = GetImageSize()
|
Dim s As Size = GetImageSize()
|
||||||
.LargeImageList = New ImageList With {.ColorDepth = ColorDepth.Depth32Bit, .ImageSize = s}
|
.LargeImageList = New ImageList With {.ColorDepth = ColorDepth.Depth32Bit, .ImageSize = s}
|
||||||
@@ -296,8 +296,8 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
Const mhw% = 256
|
Const mhw% = 256
|
||||||
Dim s As Size = LIST_POSTS.Size
|
Dim s As Size = LIST_POSTS.Size
|
||||||
With LIST_POSTS
|
With LIST_POSTS
|
||||||
s.Width -= (.Margin.Left + .Margin.Right)
|
s.Width -= .Margin.Horizontal
|
||||||
s.Height -= (.Margin.Top + .Margin.Bottom)
|
s.Height -= .Margin.Vertical
|
||||||
s.Width = s.Width / ImagesInRow - .Padding.Left * ImagesInRow - .Padding.Right * ImagesInRow
|
s.Width = s.Width / ImagesInRow - .Padding.Left * ImagesInRow - .Padding.Right * ImagesInRow
|
||||||
s.Height = s.Height / ImagesRows - .Padding.Top * ImagesRows - .Padding.Bottom * ImagesRows
|
s.Height = s.Height / ImagesRows - .Padding.Top * ImagesRows - .Padding.Bottom * ImagesRows
|
||||||
If s.Width = 0 Then s.Width = 50
|
If s.Width = 0 Then s.Width = 50
|
||||||
@@ -400,7 +400,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
CH_HIDE_EXISTS_USERS.Enabled = True
|
CH_HIDE_EXISTS_USERS.Enabled = True
|
||||||
CMB_CHANNELS.Enabled(True) = True
|
CMB_CHANNELS.Enabled(True) = True
|
||||||
BTT_SHOW_STATS.Enabled = True
|
BTT_SHOW_STATS.Enabled = True
|
||||||
CMB_CHANNELS_ActionOnCheckedChange(CMB_CHANNELS.Checked)
|
CMB_CHANNELS_ActionOnCheckedChange(Nothing, Nothing, CMB_CHANNELS.Checked)
|
||||||
MyRange.Enabled = True
|
MyRange.Enabled = True
|
||||||
MyRange.UpdateControls()
|
MyRange.UpdateControls()
|
||||||
End If
|
End If
|
||||||
@@ -549,7 +549,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
If d.HasValue Then
|
If d.HasValue Then
|
||||||
LBL_LIMIT_TEXT.Text = $"to date {AConvert(Of String)(d, ADateTime.Formats.BaseDateTime, String.Empty)}"
|
LBL_LIMIT_TEXT.Text = $"to date {AConvert(Of String)(d, ADateTime.Formats.BaseDateTime, String.Empty)}"
|
||||||
Else
|
Else
|
||||||
LBL_LIMIT_TEXT.Text = $"to post [{c.First(Function(p) Not p.ID.IsEmptyString).ID}]"
|
LBL_LIMIT_TEXT.Text = $"to post [{c.FirstOrDefault(Function(p) Not p.ID.IsEmptyString).ID}]"
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
OPT_LIMITS_COUNT.Checked = True
|
OPT_LIMITS_COUNT.Checked = True
|
||||||
@@ -571,7 +571,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
Dim c As Channel = GetCurrentChannel()
|
Dim c As Channel = GetCurrentChannel()
|
||||||
If Not c Is Nothing Then MyRange.Source = c
|
If Not c Is Nothing Then MyRange.Source = c
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CMB_CHANNELS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles CMB_CHANNELS.ActionOnButtonClick
|
Private Sub CMB_CHANNELS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles CMB_CHANNELS.ActionOnButtonClick
|
||||||
Dim c As Channel
|
Dim c As Channel
|
||||||
Select Case Sender.DefaultButton
|
Select Case Sender.DefaultButton
|
||||||
Case ADB.Refresh : RefillChannels()
|
Case ADB.Refresh : RefillChannels()
|
||||||
@@ -579,12 +579,12 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
Case ADB.Delete
|
Case ADB.Delete
|
||||||
Try
|
Try
|
||||||
c = GetCurrentChannel()
|
c = GetCurrentChannel()
|
||||||
If Not c Is Nothing AndAlso MsgBoxE($"Do you really want to delete channel [{c}]?", MsgBoxStyle.Exclamation + MsgBoxStyle.YesNo) = 0 Then
|
If Not c Is Nothing AndAlso MsgBoxE($"Are you sure you want to delete the channel [{c}]?", vbExclamation + vbYesNo) = vbYes Then
|
||||||
Settings.Channels.Remove(c)
|
Settings.Channels.Remove(c)
|
||||||
RefillChannels()
|
RefillChannels()
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch del_ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Error on trying to delete channel")
|
ErrorsDescriber.Execute(EDP.LogMessageValue, del_ex, "An error occurred while trying to delete a channel")
|
||||||
End Try
|
End Try
|
||||||
Case ADB.Up : ChangeComboIndex(-1)
|
Case ADB.Up : ChangeComboIndex(-1)
|
||||||
Case ADB.Down : ChangeComboIndex(1)
|
Case ADB.Down : ChangeComboIndex(1)
|
||||||
@@ -597,19 +597,19 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
If f.DialogResult = DialogResult.OK Then c.Save()
|
If f.DialogResult = DialogResult.OK Then c.Save()
|
||||||
End Using
|
End Using
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch edit_ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Error on trying to edit channel")
|
ErrorsDescriber.Execute(EDP.LogMessageValue, edit_ex, "An error occurred while trying to edit a channel")
|
||||||
End Try
|
End Try
|
||||||
Case ADB.Info
|
Case ADB.Info
|
||||||
Try
|
Try
|
||||||
c = GetCurrentChannel()
|
c = GetCurrentChannel()
|
||||||
If Not c Is Nothing Then MsgBoxE({c.GetChannelStats(True), "Channel statistics"})
|
If Not c Is Nothing Then MsgBoxE({c.GetChannelStats(True), "Channel statistics"})
|
||||||
Catch info_ex As Exception
|
Catch info_ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, info_ex, "Error on trying to show channel info")
|
ErrorsDescriber.Execute(EDP.LogMessageValue, info_ex, "An error occurred while trying to display channel information")
|
||||||
End Try
|
End Try
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CMB_CHANNELS_ActionOnCheckedChange(ByVal Mode As Boolean) Handles CMB_CHANNELS.ActionOnCheckedChange
|
Private Sub CMB_CHANNELS_ActionOnCheckedChange(ByVal Sender As Object, ByVal e As EventArgs, ByVal Checked As Boolean) Handles CMB_CHANNELS.ActionOnCheckedChange
|
||||||
Dim OneChannel As Boolean = Not CMB_CHANNELS.Checked
|
Dim OneChannel As Boolean = Not CMB_CHANNELS.Checked
|
||||||
CMB_CHANNELS.Enabled(False) = OneChannel
|
CMB_CHANNELS.Enabled(False) = OneChannel
|
||||||
If OneChannel Then
|
If OneChannel Then
|
||||||
@@ -683,7 +683,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
Try
|
Try
|
||||||
If Not p.UserID.IsEmptyString Then Process.Start($"https://www.reddit.com/user/{p.UserID}")
|
If Not p.UserID.IsEmptyString Then Process.Start($"https://www.reddit.com/user/{p.UserID}")
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, $"Error on opening user by [https://www.reddit.com/user/{p.UserID}]")
|
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, $"Error opening user by [https://www.reddit.com/user/{p.UserID}]")
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub BTT_C_OPEN_POST_Click(sender As Object, e As EventArgs) Handles BTT_C_OPEN_POST.Click
|
Private Sub BTT_C_OPEN_POST_Click(sender As Object, e As EventArgs) Handles BTT_C_OPEN_POST.Click
|
||||||
@@ -693,7 +693,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
URL = $"https://www.reddit.com/r/{CMB_CHANNELS.Value}/comments/{p.ID.Split("_").Last}"
|
URL = $"https://www.reddit.com/r/{CMB_CHANNELS.Value}/comments/{p.ID.Split("_").Last}"
|
||||||
If Not p.ID.IsEmptyString Then Process.Start(URL)
|
If Not p.ID.IsEmptyString Then Process.Start(URL)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, $"Error on opening post by [{URL}]")
|
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, $"Error opening post by [{URL}]")
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub BTT_C_OPEN_PICTURE_Click(sender As Object, e As EventArgs) Handles BTT_C_OPEN_PICTURE.Click
|
Private Sub BTT_C_OPEN_PICTURE_Click(sender As Object, e As EventArgs) Handles BTT_C_OPEN_PICTURE.Click
|
||||||
@@ -734,14 +734,14 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
MsgBoxE("User does not selected", MsgBoxStyle.Exclamation)
|
MsgBoxE("User does not selected", MsgBoxStyle.Exclamation)
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Error on removing user from selected")
|
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Error removing user from selected")
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub BTT_C_ADD_TO_BLACKLIST_Click(sender As Object, e As EventArgs) Handles BTT_C_ADD_TO_BLACKLIST.Click
|
Private Sub BTT_C_ADD_TO_BLACKLIST_Click(sender As Object, e As EventArgs) Handles BTT_C_ADD_TO_BLACKLIST.Click
|
||||||
Try
|
Try
|
||||||
Dim u$ = GetPostBySelected().UserID
|
Dim u$ = GetPostBySelected().UserID
|
||||||
If Not u.IsEmptyString Then
|
If Not u.IsEmptyString Then
|
||||||
Dim result% = MsgBoxE(New MMessage($"Do you really want to add user [{u}] to the BlackList?",
|
Dim result% = MsgBoxE(New MMessage($"Are you sure you want to add user [{u}] to the BlackList?",
|
||||||
"Adding user to the BlackList",
|
"Adding user to the BlackList",
|
||||||
{"Add", "Add and update ranges",
|
{"Add", "Add and update ranges",
|
||||||
"Add with the reason", "Add with the reason and update ranges",
|
"Add with the reason", "Add with the reason and update ranges",
|
||||||
@@ -771,7 +771,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
#End Region
|
#End Region
|
||||||
Private Sub OpenPostPicture()
|
Private Sub OpenPostPicture()
|
||||||
Dim f As SFile = GetPostBySelected().CachedFile
|
Dim f As SFile = GetPostBySelected().CachedFile
|
||||||
If f.Exists Then f.Open() Else MsgBoxE($"Picture file [{f}] does not found", MsgBoxStyle.Critical)
|
If f.Exists Then f.Open() Else MsgBoxE($"Picture file [{f}] not found", MsgBoxStyle.Critical)
|
||||||
End Sub
|
End Sub
|
||||||
Private Function GetPostBySelected(Optional ByVal SpecificTag As String = Nothing) As UserPost
|
Private Function GetPostBySelected(Optional ByVal SpecificTag As String = Nothing) As UserPost
|
||||||
Dim p As UserPost = Nothing
|
Dim p As UserPost = Nothing
|
||||||
@@ -798,7 +798,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
MyRange.Limit = ImagesInRow * ImagesRows
|
MyRange.Limit = ImagesInRow * ImagesRows
|
||||||
MyRange.GoTo(0)
|
MyRange.GoTo(0)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub MyRange_IndexChanged(ByVal Sender As IRangeSwitcherProvider, ByVal Index As Integer) Handles MyRange.IndexChanged
|
Private Sub MyRange_IndexChanged(ByVal Sender As Object, ByVal e As EventArgs) Handles MyRange.IndexChanged
|
||||||
Try
|
Try
|
||||||
If MyDefs.Initializing Then Exit Sub
|
If MyDefs.Initializing Then Exit Sub
|
||||||
AppendPendingUsers()
|
AppendPendingUsers()
|
||||||
@@ -828,8 +828,8 @@ Friend Class ChannelViewForm : Implements IChannelLimits
|
|||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, ex)
|
ErrorsDescriber.Execute(EDP.LogMessageValue, ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub MyRange_RangesChanged(ByVal Sender As IRangeSwitcherProvider, ByVal Index As Integer) Handles MyRange.RangesChanged
|
Private Sub MyRange_RangesChanged(ByVal Sender As IRangeSwitcherProvider, ByVal e As EventArgs) Handles MyRange.RangesChanged
|
||||||
If Sender.Count > 0 Then MyRange_IndexChanged(Nothing, 0)
|
If Sender.Count > 0 Then Sender.CurrentIndex = 0
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
@@ -6,36 +6,22 @@
|
|||||||
'
|
'
|
||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports System.ComponentModel
|
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Controls.Base
|
Imports PersonalUtilities.Forms.Controls.Base
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
Friend Class ChannelsStatsForm
|
||||||
Friend Class ChannelsStatsForm : Implements IOkCancelDeleteToolbar
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
|
||||||
Friend Property DeletedChannels As Integer = 0
|
Friend Property DeletedChannels As Integer = 0
|
||||||
Friend Sub New()
|
Friend Sub New()
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub ChannelsStatsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub ChannelsStatsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
Try
|
With MyDefs
|
||||||
With MyDefs
|
.MyViewInitialize()
|
||||||
.MyViewInitialize(Me, Settings.Design)
|
.AddOkCancelToolbar()
|
||||||
.AddOkCancelToolbar()
|
If Settings.Channels.Count > 0 Then RefillList() Else MsgBoxE("Channels not found", vbExclamation)
|
||||||
.MyOkCancel.EnableDelete = False
|
.EndLoaderOperations()
|
||||||
If Settings.Channels.Count > 0 Then
|
End With
|
||||||
RefillList()
|
|
||||||
Else
|
|
||||||
MsgBoxE("Channels not found", vbExclamation)
|
|
||||||
End If
|
|
||||||
.EndLoaderOperations()
|
|
||||||
End With
|
|
||||||
Catch ex As Exception
|
|
||||||
MyDefs.InvokeLoaderError(ex)
|
|
||||||
End Try
|
|
||||||
End Sub
|
|
||||||
Private Sub ChannelsStatsForm_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
|
||||||
MyDefs.Dispose()
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub RefillList()
|
Private Sub RefillList()
|
||||||
CMB_CHANNELS.Items.Clear()
|
CMB_CHANNELS.Items.Clear()
|
||||||
@@ -45,13 +31,7 @@ Friend Class ChannelsStatsForm : Implements IOkCancelDeleteToolbar
|
|||||||
CMB_CHANNELS.EndUpdate()
|
CMB_CHANNELS.EndUpdate()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDefs_ButtonDeleteClickOC(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonDeleteClickOC
|
||||||
MyDefs.CloseForm()
|
|
||||||
End Sub
|
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
Private Sub Delete() Implements IOkCancelDeleteToolbar.Delete
|
|
||||||
Try
|
Try
|
||||||
Dim c As List(Of String) = CMB_CHANNELS.Items.CheckedItems.Select(Function(cc) CStr(cc.Value(1))).ListIfNothing
|
Dim c As List(Of String) = CMB_CHANNELS.Items.CheckedItems.Select(Function(cc) CStr(cc.Value(1))).ListIfNothing
|
||||||
If c.ListExists Then
|
If c.ListExists Then
|
||||||
@@ -76,7 +56,7 @@ Friend Class ChannelsStatsForm : Implements IOkCancelDeleteToolbar
|
|||||||
Private Sub CMB_CHANNELS_ActionOnChangeDetected(ByVal c As Boolean) Handles CMB_CHANNELS.ActionOnChangeDetected
|
Private Sub CMB_CHANNELS_ActionOnChangeDetected(ByVal c As Boolean) Handles CMB_CHANNELS.ActionOnChangeDetected
|
||||||
If Not MyDefs.Initializing Then MyDefs.MyOkCancel.EnableDelete = CMB_CHANNELS.ListCheckedIndexes.Count > 0
|
If Not MyDefs.Initializing Then MyDefs.MyOkCancel.EnableDelete = CMB_CHANNELS.ListCheckedIndexes.Count > 0
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CMB_CHANNELS_ActionOnButtonClearClick() Handles CMB_CHANNELS.ActionOnButtonClearClick
|
Private Sub CMB_CHANNELS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles CMB_CHANNELS.ActionOnButtonClick
|
||||||
CMB_CHANNELS.ListCheckedIndexes = Nothing
|
If Sender.DefaultButton = ActionButton.DefaultButtons.Clear Then CMB_CHANNELS.ListCheckedIndexes = Nothing
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
@@ -44,7 +44,6 @@ Namespace DownloadObjects
|
|||||||
If .Controls.Count > 0 Then
|
If .Controls.Count > 0 Then
|
||||||
For Each c As Control In .Controls
|
For Each c As Control In .Controls
|
||||||
If Not c Is Nothing Then c.Dispose()
|
If Not c Is Nothing Then c.Dispose()
|
||||||
|
|
||||||
Next
|
Next
|
||||||
.Controls.Clear()
|
.Controls.Clear()
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
Imports System.Threading
|
Imports System.Threading
|
||||||
Imports PersonalUtilities.Functions.XML
|
Imports PersonalUtilities.Functions.XML
|
||||||
Imports PersonalUtilities.Functions.XML.Base
|
Imports PersonalUtilities.Functions.XML.Base
|
||||||
|
Imports PersonalUtilities.Tools
|
||||||
Imports PersonalUtilities.Tools.Notifications
|
Imports PersonalUtilities.Tools.Notifications
|
||||||
Imports SCrawler.DownloadObjects.Groups
|
Imports SCrawler.DownloadObjects.Groups
|
||||||
Imports SCrawler.API
|
Imports SCrawler.API
|
||||||
@@ -16,6 +17,11 @@ Imports SCrawler.API.Base
|
|||||||
Namespace DownloadObjects
|
Namespace DownloadObjects
|
||||||
Friend Class AutoDownloader : Inherits GroupParameters : Implements IEContainerProvider
|
Friend Class AutoDownloader : Inherits GroupParameters : Implements IEContainerProvider
|
||||||
Friend Event UserFind(ByVal Key As String, ByVal Activate As Boolean)
|
Friend Event UserFind(ByVal Key As String, ByVal Activate As Boolean)
|
||||||
|
Friend Shared ReadOnly Property CachePath As SFile
|
||||||
|
Get
|
||||||
|
Return "_Cache\"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
Friend Enum Modes As Integer
|
Friend Enum Modes As Integer
|
||||||
None = 0
|
None = 0
|
||||||
[Default] = 1
|
[Default] = 1
|
||||||
@@ -38,56 +44,78 @@ Namespace DownloadObjects
|
|||||||
Private ReadOnly Property KeySite As String
|
Private ReadOnly Property KeySite As String
|
||||||
Private ReadOnly Property KeyDismiss As String
|
Private ReadOnly Property KeyDismiss As String
|
||||||
Private ReadOnly Property Images As Dictionary(Of String, SFile)
|
Private ReadOnly Property Images As Dictionary(Of String, SFile)
|
||||||
|
Private ReadOnly Property AutoDownloaderSource As AutoDownloader
|
||||||
Private Sub New()
|
Private Sub New()
|
||||||
Images = New Dictionary(Of String, SFile)
|
Images = New Dictionary(Of String, SFile)
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub New(ByVal _Key As String)
|
Private Sub New(ByVal _Key As String)
|
||||||
Me.New
|
Me.New
|
||||||
Key = _Key
|
Key = _Key
|
||||||
KeyFolder = $"{Key}{KeyOpenFolder}"
|
KeyFolder = $"{Key}{KeyOpenFolder}"
|
||||||
KeySite = $"{Key}{KeyOpenSite}"
|
KeySite = $"{Key}{KeyOpenSite}"
|
||||||
KeyDismiss = $"{Key}{KeyBttDismiss}"
|
KeyDismiss = $"{Key}{KeyBttDismiss}"
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub New(ByVal _Key As String, ByRef _User As IUserData)
|
Friend Sub New(ByVal _Key As String, ByRef _User As IUserData, ByRef Source As AutoDownloader)
|
||||||
Me.New(_Key)
|
Me.New(_Key)
|
||||||
User = _User
|
User = _User
|
||||||
IUserDataKey = _User.Key
|
IUserDataKey = _User.Key
|
||||||
|
AutoDownloaderSource = Source
|
||||||
|
If _User.IncludedInCollection Then
|
||||||
|
Dim cn$ = _User.CollectionName
|
||||||
|
Dim i% = Settings.Users.FindIndex(Function(u) u.IsCollection And u.Name = cn)
|
||||||
|
If i >= 0 Then IUserDataKey = Settings.Users(i).Key
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Public Shared Widening Operator CType(ByVal Key As String) As NotifiedUser
|
Public Shared Widening Operator CType(ByVal Key As String) As NotifiedUser
|
||||||
Return New NotifiedUser(Key)
|
Return New NotifiedUser(Key)
|
||||||
End Operator
|
End Operator
|
||||||
Friend Sub ShowNotification()
|
Friend Sub ShowNotification()
|
||||||
Try
|
Try
|
||||||
If Not User Is Nothing Then
|
If Not AutoDownloaderSource Is Nothing Then
|
||||||
Dim Text$ = $"{User.Site} - {User.Name}{vbNewLine}" &
|
If AutoDownloaderSource.ShowNotifications Then
|
||||||
$"Downloaded: {User.DownloadedPictures(False)} images, {User.DownloadedVideos(False)} videos"
|
If Not User Is Nothing Then
|
||||||
Dim Title$
|
Dim Text$ = $"{User.Site} - {User.Name}{vbNewLine}" &
|
||||||
If Not User.CollectionName.IsEmptyString Then
|
$"Downloaded: {User.DownloadedPictures(False)} images, {User.DownloadedVideos(False)} videos"
|
||||||
Title = User.CollectionName
|
Dim Title$
|
||||||
Else
|
If Not User.CollectionName.IsEmptyString Then
|
||||||
Title = User.ToString
|
Title = User.CollectionName
|
||||||
End If
|
Else
|
||||||
Using Notify As New Notification(Text, Title) With {.Key = Key}
|
Title = User.ToString
|
||||||
Dim uPic As SFile = DirectCast(User, UserDataBase).GetUserPictureAddress
|
|
||||||
Dim uif As SFile = Nothing
|
|
||||||
Dim uifKey$ = String.Empty
|
|
||||||
If uPic.Exists Then Notify.Images = {New ToastImage(uPic)}
|
|
||||||
If User.DownloadedPictures(False) > 0 Then
|
|
||||||
uif = DirectCast(User, UserDataBase).GetLastImageAddress
|
|
||||||
If uif.Exists Then
|
|
||||||
Notify.Images = {New ToastImage(uif, IImage.Modes.Inline)}
|
|
||||||
uifKey = $"{Key}_{Images.Keys.Count + 1}_{KeyBttPhoto}"
|
|
||||||
If Not Images.ContainsKey(uifKey) Then Images.Add(uifKey, uif)
|
|
||||||
End If
|
End If
|
||||||
|
Using Notify As New Notification(Text, Title) With {.Key = Key}
|
||||||
|
Dim uPic As SFile = Nothing
|
||||||
|
Dim uif As SFile = Nothing
|
||||||
|
Dim uif_compressed As SFile = Nothing
|
||||||
|
Dim uifKey$ = String.Empty
|
||||||
|
If AutoDownloaderSource.ShowPictureUser Then uPic = DirectCast(User, UserDataBase).GetUserPictureToastAddress
|
||||||
|
If AutoDownloaderSource.ShowPictureUser AndAlso uPic.Exists Then Notify.Images = {New ToastImage(uPic)}
|
||||||
|
If AutoDownloaderSource.ShowPictureDownloaded And User.DownloadedPictures(False) > 0 Then
|
||||||
|
uif = DirectCast(User, UserDataBase).GetLastImageAddress
|
||||||
|
If uif.Exists Then
|
||||||
|
uif_compressed = uif
|
||||||
|
uif_compressed.Path = CachePath.Path
|
||||||
|
uif_compressed.Name = $"360_{uif.Name}"
|
||||||
|
Using imgR As New ImageRenderer(uif, EDP.SendInLog)
|
||||||
|
Try : imgR.FitToWidth(360).Save(uif_compressed) : Catch : End Try
|
||||||
|
End Using
|
||||||
|
If uif_compressed.Exists Then uif = uif_compressed
|
||||||
|
If uif.Exists Then
|
||||||
|
Notify.Images = {New ToastImage(uif, IImage.Modes.Inline)}
|
||||||
|
uifKey = $"{Key}_{Images.Keys.Count + 1}_{KeyBttPhoto}"
|
||||||
|
If Not Images.ContainsKey(uifKey) Then Images.Add(uifKey, uif)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Notify.Buttons = {
|
||||||
|
New ToastButton(KeyFolder, "Folder"),
|
||||||
|
New ToastButton(KeySite, "Site")
|
||||||
|
}
|
||||||
|
If Not uifKey.IsEmptyString Then Notify.Buttons = {New ToastButton(uifKey, "Photo")}
|
||||||
|
Notify.Buttons = {New ToastButton(KeyDismiss, "Dismiss")}
|
||||||
|
Notify.Show()
|
||||||
|
End Using
|
||||||
End If
|
End If
|
||||||
Notify.Buttons = {
|
End If
|
||||||
New ToastButton(KeyFolder, "Folder"),
|
|
||||||
New ToastButton(KeySite, "Site")
|
|
||||||
}
|
|
||||||
If Not uifKey.IsEmptyString Then Notify.Buttons = {New ToastButton(uifKey, "Photo")}
|
|
||||||
Notify.Buttons = {New ToastButton(KeyDismiss, "Dismiss")}
|
|
||||||
Notify.Show()
|
|
||||||
End Using
|
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.SendInLog, ex, "[AutoDownloader.NotifiedUser.ShowNotification]")
|
ErrorsDescriber.Execute(EDP.SendInLog, ex, "[AutoDownloader.NotifiedUser.ShowNotification]")
|
||||||
@@ -144,6 +172,8 @@ Namespace DownloadObjects
|
|||||||
Private Const Name_StartupDelay As String = "StartupDelay"
|
Private Const Name_StartupDelay As String = "StartupDelay"
|
||||||
Private Const Name_LastDownloadDate As String = "LastDownloadDate"
|
Private Const Name_LastDownloadDate As String = "LastDownloadDate"
|
||||||
Private Const Name_ShowNotifications As String = "Notify"
|
Private Const Name_ShowNotifications As String = "Notify"
|
||||||
|
Private Const Name_ShowPictureDown As String = "ShowDownloadedPicture"
|
||||||
|
Private Const Name_ShowPictureUser As String = "ShowUserPicture"
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Declarations"
|
#Region "Declarations"
|
||||||
Friend Property Source As Scheduler
|
Friend Property Source As Scheduler
|
||||||
@@ -161,6 +191,8 @@ Namespace DownloadObjects
|
|||||||
Friend Property Timer As Integer = DefaultTimer
|
Friend Property Timer As Integer = DefaultTimer
|
||||||
Friend Property StartupDelay As Integer = 0
|
Friend Property StartupDelay As Integer = 0
|
||||||
Friend Property ShowNotifications As Boolean = True
|
Friend Property ShowNotifications As Boolean = True
|
||||||
|
Friend Property ShowPictureDownloaded As Boolean = True
|
||||||
|
Friend Property ShowPictureUser As Boolean = True
|
||||||
#Region "Date"
|
#Region "Date"
|
||||||
Private ReadOnly LastDownloadDateXML As Date? = Nothing
|
Private ReadOnly LastDownloadDateXML As Date? = Nothing
|
||||||
Private _LastDownloadDate As Date = Now.AddYears(-1)
|
Private _LastDownloadDate As Date = Now.AddYears(-1)
|
||||||
@@ -190,6 +222,7 @@ Namespace DownloadObjects
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
#Region "Information"
|
||||||
Friend ReadOnly Property Information As String
|
Friend ReadOnly Property Information As String
|
||||||
Get
|
Get
|
||||||
Return $"Last download date: {GetLastDateString()} ({GetWorkingState()})"
|
Return $"Last download date: {GetLastDateString()} ({GetWorkingState()})"
|
||||||
@@ -214,8 +247,7 @@ Namespace DownloadObjects
|
|||||||
Public Overrides Function ToString() As String
|
Public Overrides Function ToString() As String
|
||||||
Return $"{Name} ({GetWorkingState()}): last download date: {GetLastDateString()}; next run: {GetNextDateString()}"
|
Return $"{Name} ({GetWorkingState()}): last download date: {GetLastDateString()}; next run: {GetNextDateString()}"
|
||||||
End Function
|
End Function
|
||||||
Private File As SFile = $"Settings\AutoDownload.xml"
|
#End Region
|
||||||
Private AThread As Thread
|
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Initializer"
|
#Region "Initializer"
|
||||||
Private ReadOnly Initialization As Boolean = True
|
Private ReadOnly Initialization As Boolean = True
|
||||||
@@ -245,6 +277,8 @@ Namespace DownloadObjects
|
|||||||
StartupDelay = x.Value(Name_StartupDelay).FromXML(Of Integer)(0)
|
StartupDelay = x.Value(Name_StartupDelay).FromXML(Of Integer)(0)
|
||||||
If StartupDelay < 0 Then StartupDelay = 0
|
If StartupDelay < 0 Then StartupDelay = 0
|
||||||
ShowNotifications = x.Value(Name_ShowNotifications).FromXML(Of Boolean)(True)
|
ShowNotifications = x.Value(Name_ShowNotifications).FromXML(Of Boolean)(True)
|
||||||
|
ShowPictureDownloaded = x.Value(Name_ShowPictureDown).FromXML(Of Boolean)(True)
|
||||||
|
ShowPictureUser = x.Value(Name_ShowPictureUser).FromXML(Of Boolean)(True)
|
||||||
LastDownloadDateXML = AConvert(Of Date)(x.Value(Name_LastDownloadDate), DateProvider, Nothing)
|
LastDownloadDateXML = AConvert(Of Date)(x.Value(Name_LastDownloadDate), DateProvider, Nothing)
|
||||||
If LastDownloadDateXML.HasValue Then
|
If LastDownloadDateXML.HasValue Then
|
||||||
LastDownloadDate = LastDownloadDateXML.Value
|
LastDownloadDate = LastDownloadDateXML.Value
|
||||||
@@ -285,12 +319,15 @@ Namespace DownloadObjects
|
|||||||
New EContainer(Name_Timer, Timer),
|
New EContainer(Name_Timer, Timer),
|
||||||
New EContainer(Name_StartupDelay, StartupDelay),
|
New EContainer(Name_StartupDelay, StartupDelay),
|
||||||
New EContainer(Name_ShowNotifications, ShowNotifications.BoolToInteger),
|
New EContainer(Name_ShowNotifications, ShowNotifications.BoolToInteger),
|
||||||
|
New EContainer(Name_ShowPictureDown, ShowPictureDownloaded.BoolToInteger),
|
||||||
|
New EContainer(Name_ShowPictureUser, ShowPictureUser.BoolToInteger),
|
||||||
New EContainer(Name_LastDownloadDate, CStr(AConvert(Of String)(If(LastDownloadDateXML.HasValue Or _LastDownloadDateChanged,
|
New EContainer(Name_LastDownloadDate, CStr(AConvert(Of String)(If(LastDownloadDateXML.HasValue Or _LastDownloadDateChanged,
|
||||||
CObj(LastDownloadDate), Nothing), DateProvider, String.Empty)))
|
CObj(LastDownloadDate), Nothing), DateProvider, String.Empty)))
|
||||||
}
|
}
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Execution"
|
#Region "Execution"
|
||||||
|
Private AThread As Thread
|
||||||
Friend ReadOnly Property Working As Boolean
|
Friend ReadOnly Property Working As Boolean
|
||||||
Get
|
Get
|
||||||
Return If(AThread?.IsAlive, False)
|
Return If(AThread?.IsAlive, False)
|
||||||
@@ -406,7 +443,7 @@ Namespace DownloadObjects
|
|||||||
If i >= 0 Then
|
If i >= 0 Then
|
||||||
UserKeys(i).ShowNotification()
|
UserKeys(i).ShowNotification()
|
||||||
Else
|
Else
|
||||||
UserKeys.Add(New NotifiedUser(k, TDownloader.GetUserFromMainCollection(u)))
|
UserKeys.Add(New NotifiedUser(k, TDownloader.GetUserFromMainCollection(u), Me))
|
||||||
UserKeys.Last.ShowNotification()
|
UserKeys.Last.ShowNotification()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ Namespace DownloadObjects
|
|||||||
Dim TP_MODE As System.Windows.Forms.TableLayoutPanel
|
Dim TP_MODE As System.Windows.Forms.TableLayoutPanel
|
||||||
Dim ActionButton3 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton3 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
Dim ActionButton4 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton4 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
|
Dim TP_NOTIFY As System.Windows.Forms.TableLayoutPanel
|
||||||
Dim TT_MAIN As System.Windows.Forms.ToolTip
|
Dim TT_MAIN As System.Windows.Forms.ToolTip
|
||||||
Me.DEF_GROUP = New SCrawler.DownloadObjects.Groups.GroupDefaults()
|
Me.DEF_GROUP = New SCrawler.DownloadObjects.Groups.GroupDefaults()
|
||||||
Me.TXT_GROUPS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.TXT_GROUPS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
@@ -38,12 +39,15 @@ Namespace DownloadObjects
|
|||||||
Me.OPT_SPEC = New System.Windows.Forms.RadioButton()
|
Me.OPT_SPEC = New System.Windows.Forms.RadioButton()
|
||||||
Me.OPT_DISABLED = New System.Windows.Forms.RadioButton()
|
Me.OPT_DISABLED = New System.Windows.Forms.RadioButton()
|
||||||
Me.OPT_GROUP = New System.Windows.Forms.RadioButton()
|
Me.OPT_GROUP = New System.Windows.Forms.RadioButton()
|
||||||
Me.CH_NOTIFY = New System.Windows.Forms.CheckBox()
|
|
||||||
Me.TXT_TIMER = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.TXT_TIMER = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
Me.LBL_LAST_TIME_UP = New System.Windows.Forms.Label()
|
Me.LBL_LAST_TIME_UP = New System.Windows.Forms.Label()
|
||||||
Me.NUM_DELAY = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.NUM_DELAY = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
|
Me.CH_NOTIFY = New System.Windows.Forms.CheckBox()
|
||||||
|
Me.CH_SHOW_PIC = New System.Windows.Forms.CheckBox()
|
||||||
|
Me.CH_SHOW_PIC_USER = New System.Windows.Forms.CheckBox()
|
||||||
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
||||||
TP_MODE = New System.Windows.Forms.TableLayoutPanel()
|
TP_MODE = New System.Windows.Forms.TableLayoutPanel()
|
||||||
|
TP_NOTIFY = New System.Windows.Forms.TableLayoutPanel()
|
||||||
TT_MAIN = New System.Windows.Forms.ToolTip(Me.components)
|
TT_MAIN = New System.Windows.Forms.ToolTip(Me.components)
|
||||||
CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
||||||
CONTAINER_MAIN.SuspendLayout()
|
CONTAINER_MAIN.SuspendLayout()
|
||||||
@@ -52,6 +56,7 @@ Namespace DownloadObjects
|
|||||||
TP_MODE.SuspendLayout()
|
TP_MODE.SuspendLayout()
|
||||||
CType(Me.TXT_TIMER, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.TXT_TIMER, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(Me.NUM_DELAY, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.NUM_DELAY, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
TP_NOTIFY.SuspendLayout()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
'CONTAINER_MAIN
|
'CONTAINER_MAIN
|
||||||
@@ -77,10 +82,10 @@ Namespace DownloadObjects
|
|||||||
Me.DEF_GROUP.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
Me.DEF_GROUP.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
||||||
Me.DEF_GROUP.Controls.Add(Me.TXT_GROUPS, 0, 5)
|
Me.DEF_GROUP.Controls.Add(Me.TXT_GROUPS, 0, 5)
|
||||||
Me.DEF_GROUP.Controls.Add(TP_MODE, 0, 0)
|
Me.DEF_GROUP.Controls.Add(TP_MODE, 0, 0)
|
||||||
Me.DEF_GROUP.Controls.Add(Me.CH_NOTIFY, 0, 6)
|
|
||||||
Me.DEF_GROUP.Controls.Add(Me.TXT_TIMER, 0, 7)
|
Me.DEF_GROUP.Controls.Add(Me.TXT_TIMER, 0, 7)
|
||||||
Me.DEF_GROUP.Controls.Add(Me.LBL_LAST_TIME_UP, 0, 9)
|
Me.DEF_GROUP.Controls.Add(Me.LBL_LAST_TIME_UP, 0, 9)
|
||||||
Me.DEF_GROUP.Controls.Add(Me.NUM_DELAY, 0, 8)
|
Me.DEF_GROUP.Controls.Add(Me.NUM_DELAY, 0, 8)
|
||||||
|
Me.DEF_GROUP.Controls.Add(TP_NOTIFY, 0, 6)
|
||||||
Me.DEF_GROUP.Dock = System.Windows.Forms.DockStyle.Fill
|
Me.DEF_GROUP.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.DEF_GROUP.Location = New System.Drawing.Point(0, 0)
|
Me.DEF_GROUP.Location = New System.Drawing.Point(0, 0)
|
||||||
Me.DEF_GROUP.Name = "DEF_GROUP"
|
Me.DEF_GROUP.Name = "DEF_GROUP"
|
||||||
@@ -96,6 +101,7 @@ Namespace DownloadObjects
|
|||||||
Me.DEF_GROUP.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
|
Me.DEF_GROUP.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
|
||||||
Me.DEF_GROUP.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
Me.DEF_GROUP.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
||||||
Me.DEF_GROUP.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
Me.DEF_GROUP.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
||||||
|
Me.DEF_GROUP.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20.0!))
|
||||||
Me.DEF_GROUP.Size = New System.Drawing.Size(476, 301)
|
Me.DEF_GROUP.Size = New System.Drawing.Size(476, 301)
|
||||||
Me.DEF_GROUP.TabIndex = 0
|
Me.DEF_GROUP.TabIndex = 0
|
||||||
'
|
'
|
||||||
@@ -136,7 +142,7 @@ Namespace DownloadObjects
|
|||||||
TP_MODE.RowCount = 1
|
TP_MODE.RowCount = 1
|
||||||
TP_MODE.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
TP_MODE.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
||||||
TP_MODE.Size = New System.Drawing.Size(474, 25)
|
TP_MODE.Size = New System.Drawing.Size(474, 25)
|
||||||
TP_MODE.TabIndex = 1
|
TP_MODE.TabIndex = 0
|
||||||
'
|
'
|
||||||
'OPT_ALL
|
'OPT_ALL
|
||||||
'
|
'
|
||||||
@@ -203,17 +209,6 @@ Namespace DownloadObjects
|
|||||||
TT_MAIN.SetToolTip(Me.OPT_GROUP, "Download groups")
|
TT_MAIN.SetToolTip(Me.OPT_GROUP, "Download groups")
|
||||||
Me.OPT_GROUP.UseVisualStyleBackColor = True
|
Me.OPT_GROUP.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
'CH_NOTIFY
|
|
||||||
'
|
|
||||||
Me.CH_NOTIFY.AutoSize = True
|
|
||||||
Me.CH_NOTIFY.Dock = System.Windows.Forms.DockStyle.Fill
|
|
||||||
Me.CH_NOTIFY.Location = New System.Drawing.Point(4, 169)
|
|
||||||
Me.CH_NOTIFY.Name = "CH_NOTIFY"
|
|
||||||
Me.CH_NOTIFY.Size = New System.Drawing.Size(468, 19)
|
|
||||||
Me.CH_NOTIFY.TabIndex = 3
|
|
||||||
Me.CH_NOTIFY.Text = "Show notifications"
|
|
||||||
Me.CH_NOTIFY.UseVisualStyleBackColor = True
|
|
||||||
'
|
|
||||||
'TXT_TIMER
|
'TXT_TIMER
|
||||||
'
|
'
|
||||||
ActionButton3.BackgroundImage = CType(resources.GetObject("ActionButton3.BackgroundImage"), System.Drawing.Image)
|
ActionButton3.BackgroundImage = CType(resources.GetObject("ActionButton3.BackgroundImage"), System.Drawing.Image)
|
||||||
@@ -225,7 +220,7 @@ Namespace DownloadObjects
|
|||||||
Me.TXT_TIMER.Location = New System.Drawing.Point(4, 195)
|
Me.TXT_TIMER.Location = New System.Drawing.Point(4, 195)
|
||||||
Me.TXT_TIMER.Name = "TXT_TIMER"
|
Me.TXT_TIMER.Name = "TXT_TIMER"
|
||||||
Me.TXT_TIMER.Size = New System.Drawing.Size(468, 22)
|
Me.TXT_TIMER.Size = New System.Drawing.Size(468, 22)
|
||||||
Me.TXT_TIMER.TabIndex = 4
|
Me.TXT_TIMER.TabIndex = 2
|
||||||
'
|
'
|
||||||
'LBL_LAST_TIME_UP
|
'LBL_LAST_TIME_UP
|
||||||
'
|
'
|
||||||
@@ -235,7 +230,7 @@ Namespace DownloadObjects
|
|||||||
Me.LBL_LAST_TIME_UP.Location = New System.Drawing.Point(4, 250)
|
Me.LBL_LAST_TIME_UP.Location = New System.Drawing.Point(4, 250)
|
||||||
Me.LBL_LAST_TIME_UP.Name = "LBL_LAST_TIME_UP"
|
Me.LBL_LAST_TIME_UP.Name = "LBL_LAST_TIME_UP"
|
||||||
Me.LBL_LAST_TIME_UP.Size = New System.Drawing.Size(468, 25)
|
Me.LBL_LAST_TIME_UP.Size = New System.Drawing.Size(468, 25)
|
||||||
Me.LBL_LAST_TIME_UP.TabIndex = 6
|
Me.LBL_LAST_TIME_UP.TabIndex = 4
|
||||||
Me.LBL_LAST_TIME_UP.Text = "Last download date: "
|
Me.LBL_LAST_TIME_UP.Text = "Last download date: "
|
||||||
Me.LBL_LAST_TIME_UP.TextAlign = System.Drawing.ContentAlignment.TopCenter
|
Me.LBL_LAST_TIME_UP.TextAlign = System.Drawing.ContentAlignment.TopCenter
|
||||||
'
|
'
|
||||||
@@ -256,9 +251,64 @@ Namespace DownloadObjects
|
|||||||
Me.NUM_DELAY.NumberMaximum = New Decimal(New Integer() {1440, 0, 0, 0})
|
Me.NUM_DELAY.NumberMaximum = New Decimal(New Integer() {1440, 0, 0, 0})
|
||||||
Me.NUM_DELAY.NumberUpDownAlign = System.Windows.Forms.LeftRightAlignment.Left
|
Me.NUM_DELAY.NumberUpDownAlign = System.Windows.Forms.LeftRightAlignment.Left
|
||||||
Me.NUM_DELAY.Size = New System.Drawing.Size(468, 22)
|
Me.NUM_DELAY.Size = New System.Drawing.Size(468, 22)
|
||||||
Me.NUM_DELAY.TabIndex = 5
|
Me.NUM_DELAY.TabIndex = 3
|
||||||
Me.NUM_DELAY.Text = "0"
|
Me.NUM_DELAY.Text = "0"
|
||||||
'
|
'
|
||||||
|
'TP_NOTIFY
|
||||||
|
'
|
||||||
|
TP_NOTIFY.ColumnCount = 3
|
||||||
|
TP_NOTIFY.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
|
||||||
|
TP_NOTIFY.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
|
||||||
|
TP_NOTIFY.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
|
||||||
|
TP_NOTIFY.Controls.Add(Me.CH_NOTIFY, 0, 0)
|
||||||
|
TP_NOTIFY.Controls.Add(Me.CH_SHOW_PIC, 1, 0)
|
||||||
|
TP_NOTIFY.Controls.Add(Me.CH_SHOW_PIC_USER, 2, 0)
|
||||||
|
TP_NOTIFY.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
|
TP_NOTIFY.Location = New System.Drawing.Point(1, 166)
|
||||||
|
TP_NOTIFY.Margin = New System.Windows.Forms.Padding(0)
|
||||||
|
TP_NOTIFY.Name = "TP_NOTIFY"
|
||||||
|
TP_NOTIFY.RowCount = 1
|
||||||
|
TP_NOTIFY.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
||||||
|
TP_NOTIFY.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
||||||
|
TP_NOTIFY.Size = New System.Drawing.Size(474, 25)
|
||||||
|
TP_NOTIFY.TabIndex = 1
|
||||||
|
'
|
||||||
|
'CH_NOTIFY
|
||||||
|
'
|
||||||
|
Me.CH_NOTIFY.AutoSize = True
|
||||||
|
Me.CH_NOTIFY.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
|
Me.CH_NOTIFY.Location = New System.Drawing.Point(3, 3)
|
||||||
|
Me.CH_NOTIFY.Name = "CH_NOTIFY"
|
||||||
|
Me.CH_NOTIFY.Size = New System.Drawing.Size(152, 19)
|
||||||
|
Me.CH_NOTIFY.TabIndex = 0
|
||||||
|
Me.CH_NOTIFY.Text = "Show notifications"
|
||||||
|
TT_MAIN.SetToolTip(Me.CH_NOTIFY, "Show notification when some data has been downloaded")
|
||||||
|
Me.CH_NOTIFY.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
|
'CH_SHOW_PIC
|
||||||
|
'
|
||||||
|
Me.CH_SHOW_PIC.AutoSize = True
|
||||||
|
Me.CH_SHOW_PIC.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
|
Me.CH_SHOW_PIC.Location = New System.Drawing.Point(161, 3)
|
||||||
|
Me.CH_SHOW_PIC.Name = "CH_SHOW_PIC"
|
||||||
|
Me.CH_SHOW_PIC.Size = New System.Drawing.Size(152, 19)
|
||||||
|
Me.CH_SHOW_PIC.TabIndex = 1
|
||||||
|
Me.CH_SHOW_PIC.Text = "Show download picture"
|
||||||
|
TT_MAIN.SetToolTip(Me.CH_SHOW_PIC, "Show downloaded image in notification")
|
||||||
|
Me.CH_SHOW_PIC.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
|
'CH_SHOW_PIC_USER
|
||||||
|
'
|
||||||
|
Me.CH_SHOW_PIC_USER.AutoSize = True
|
||||||
|
Me.CH_SHOW_PIC_USER.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
|
Me.CH_SHOW_PIC_USER.Location = New System.Drawing.Point(319, 3)
|
||||||
|
Me.CH_SHOW_PIC_USER.Name = "CH_SHOW_PIC_USER"
|
||||||
|
Me.CH_SHOW_PIC_USER.Size = New System.Drawing.Size(152, 19)
|
||||||
|
Me.CH_SHOW_PIC_USER.TabIndex = 2
|
||||||
|
Me.CH_SHOW_PIC_USER.Text = "Show user picture"
|
||||||
|
TT_MAIN.SetToolTip(Me.CH_SHOW_PIC_USER, "Show user image in notification")
|
||||||
|
Me.CH_SHOW_PIC_USER.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
'AutoDownloaderEditorForm
|
'AutoDownloaderEditorForm
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
@@ -285,6 +335,8 @@ Namespace DownloadObjects
|
|||||||
TP_MODE.PerformLayout()
|
TP_MODE.PerformLayout()
|
||||||
CType(Me.TXT_TIMER, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.TXT_TIMER, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
CType(Me.NUM_DELAY, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.NUM_DELAY, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
TP_NOTIFY.ResumeLayout(False)
|
||||||
|
TP_NOTIFY.PerformLayout()
|
||||||
Me.ResumeLayout(False)
|
Me.ResumeLayout(False)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
@@ -299,5 +351,7 @@ Namespace DownloadObjects
|
|||||||
Private WithEvents OPT_GROUP As RadioButton
|
Private WithEvents OPT_GROUP As RadioButton
|
||||||
Private WithEvents LBL_LAST_TIME_UP As Label
|
Private WithEvents LBL_LAST_TIME_UP As Label
|
||||||
Private WithEvents NUM_DELAY As PersonalUtilities.Forms.Controls.TextBoxExtended
|
Private WithEvents NUM_DELAY As PersonalUtilities.Forms.Controls.TextBoxExtended
|
||||||
|
Private WithEvents CH_SHOW_PIC As CheckBox
|
||||||
|
Private WithEvents CH_SHOW_PIC_USER As CheckBox
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -228,6 +228,9 @@
|
|||||||
VnR1MIwhwMTCyqEQ37qEmZVDFF0OE/9nAACtFF4Ey6OP+wAAAABJRU5ErkJggg==
|
VnR1MIwhwMTCyqEQ37qEmZVDFF0OE/9nAACtFF4Ey6OP+wAAAABJRU5ErkJggg==
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
|
<metadata name="TP_NOTIFY.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</value>
|
||||||
|
</metadata>
|
||||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
AAABAAwAMDAQAAEABABoBgAAxgAAACAgEAABAAQA6AIAAC4HAAAYGBAAAQAEAOgBAAAWCgAAEBAQAAEA
|
AAABAAwAMDAQAAEABABoBgAAxgAAACAgEAABAAQA6AIAAC4HAAAYGBAAAQAEAOgBAAAWCgAAEBAQAAEA
|
||||||
|
|||||||
@@ -8,17 +8,16 @@
|
|||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Controls.Base
|
Imports PersonalUtilities.Forms.Controls.Base
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
|
||||||
Imports DModes = SCrawler.DownloadObjects.AutoDownloader.Modes
|
Imports DModes = SCrawler.DownloadObjects.AutoDownloader.Modes
|
||||||
Namespace DownloadObjects
|
Namespace DownloadObjects
|
||||||
Friend Class AutoDownloaderEditorForm : Implements IOkCancelToolbar
|
Friend Class AutoDownloaderEditorForm
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Private ReadOnly MyGroups As List(Of String)
|
Private ReadOnly MyGroups As List(Of String)
|
||||||
Private ReadOnly Property Plan As AutoDownloader
|
Private ReadOnly Property Plan As AutoDownloader
|
||||||
Friend Sub New(ByRef _Plan As AutoDownloader)
|
Friend Sub New(ByRef _Plan As AutoDownloader)
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
Plan = _Plan
|
Plan = _Plan
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
MyGroups.ListAddList(Plan.Groups, LAP.NotContainsOnly)
|
MyGroups.ListAddList(Plan.Groups, LAP.NotContainsOnly)
|
||||||
End Sub
|
End Sub
|
||||||
Private Class AutomationTimerChecker : Implements IFieldsCheckerProvider
|
Private Class AutomationTimerChecker : Implements IFieldsCheckerProvider
|
||||||
@@ -39,7 +38,7 @@ Namespace DownloadObjects
|
|||||||
End Class
|
End Class
|
||||||
Private Sub AutoDownloaderEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub AutoDownloaderEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
With MyDefs
|
With MyDefs
|
||||||
.MyViewInitialize(Me, Settings.Design, True)
|
.MyViewInitialize(True)
|
||||||
.AddOkCancelToolbar()
|
.AddOkCancelToolbar()
|
||||||
With Plan
|
With Plan
|
||||||
Select Case .Mode
|
Select Case .Mode
|
||||||
@@ -49,14 +48,16 @@ Namespace DownloadObjects
|
|||||||
Case DModes.Specified : OPT_SPEC.Checked = True
|
Case DModes.Specified : OPT_SPEC.Checked = True
|
||||||
Case DModes.Groups : OPT_GROUP.Checked = True
|
Case DModes.Groups : OPT_GROUP.Checked = True
|
||||||
End Select
|
End Select
|
||||||
ChangeEnabled()
|
|
||||||
DEF_GROUP.Set(Plan)
|
DEF_GROUP.Set(Plan)
|
||||||
If MyGroups.Count > 0 Then TXT_GROUPS.Text = MyGroups.ListToString
|
If MyGroups.Count > 0 Then TXT_GROUPS.Text = MyGroups.ListToString
|
||||||
If Settings.Groups.Count = 0 Then TXT_GROUPS.Clear() : TXT_GROUPS.Enabled = False
|
If Settings.Groups.Count = 0 Then TXT_GROUPS.Clear() : TXT_GROUPS.Enabled = False
|
||||||
CH_NOTIFY.Checked = .ShowNotifications
|
CH_NOTIFY.Checked = .ShowNotifications
|
||||||
|
CH_SHOW_PIC.Checked = .ShowPictureDownloaded
|
||||||
|
CH_SHOW_PIC_USER.Checked = .ShowPictureUser
|
||||||
TXT_TIMER.Text = .Timer
|
TXT_TIMER.Text = .Timer
|
||||||
NUM_DELAY.Value = .StartupDelay
|
NUM_DELAY.Value = .StartupDelay
|
||||||
LBL_LAST_TIME_UP.Text = .Information
|
LBL_LAST_TIME_UP.Text = .Information
|
||||||
|
ChangeEnabled()
|
||||||
End With
|
End With
|
||||||
.MyFieldsChecker = New FieldsChecker
|
.MyFieldsChecker = New FieldsChecker
|
||||||
With .MyFieldsCheckerE
|
With .MyFieldsCheckerE
|
||||||
@@ -71,8 +72,8 @@ Namespace DownloadObjects
|
|||||||
Private Sub AutoDownloaderEditorForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
Private Sub AutoDownloaderEditorForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
||||||
MyGroups.Clear()
|
MyGroups.Clear()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDefs_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonOkClick
|
||||||
If If(MyDefs.MyFieldsChecker?.AllParamsOK, True) Then
|
If MyDefs.MyFieldsChecker.AllParamsOK Then
|
||||||
With Plan
|
With Plan
|
||||||
Select Case True
|
Select Case True
|
||||||
Case OPT_DISABLED.Checked : .Mode = DModes.None
|
Case OPT_DISABLED.Checked : .Mode = DModes.None
|
||||||
@@ -84,6 +85,9 @@ Namespace DownloadObjects
|
|||||||
DEF_GROUP.Get(Plan)
|
DEF_GROUP.Get(Plan)
|
||||||
.Groups.Clear()
|
.Groups.Clear()
|
||||||
.Groups.ListAddList(MyGroups)
|
.Groups.ListAddList(MyGroups)
|
||||||
|
.ShowNotifications = CH_NOTIFY.Checked
|
||||||
|
.ShowPictureDownloaded = CH_SHOW_PIC.Checked
|
||||||
|
.ShowPictureUser = CH_SHOW_PIC_USER.Checked
|
||||||
.Timer = AConvert(Of Integer)(TXT_TIMER.Text, AutoDownloader.DefaultTimer)
|
.Timer = AConvert(Of Integer)(TXT_TIMER.Text, AutoDownloader.DefaultTimer)
|
||||||
.StartupDelay = NUM_DELAY.Value
|
.StartupDelay = NUM_DELAY.Value
|
||||||
.Update()
|
.Update()
|
||||||
@@ -91,10 +95,7 @@ Namespace DownloadObjects
|
|||||||
MyDefs.CloseForm()
|
MyDefs.CloseForm()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
Private Sub TXT_GROUPS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_GROUPS.ActionOnButtonClick
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
Private Sub TXT_GROUPS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_GROUPS.ActionOnButtonClick
|
|
||||||
Select Case Sender.DefaultButton
|
Select Case Sender.DefaultButton
|
||||||
Case ActionButton.DefaultButtons.Edit
|
Case ActionButton.DefaultButtons.Edit
|
||||||
Using f As New LabelsForm(MyGroups, Settings.Groups.Select(Function(g) g.Name)) With {.Text = "Groups"}
|
Using f As New LabelsForm(MyGroups, Settings.Groups.Select(Function(g) g.Name)) With {.Text = "Groups"}
|
||||||
@@ -119,14 +120,19 @@ Namespace DownloadObjects
|
|||||||
Private Sub OPT_GROUP_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_GROUP.CheckedChanged
|
Private Sub OPT_GROUP_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_GROUP.CheckedChanged
|
||||||
ChangeEnabled()
|
ChangeEnabled()
|
||||||
End Sub
|
End Sub
|
||||||
|
Private Sub CH_NOTIFY_CheckedChanged(sender As Object, e As EventArgs) Handles CH_NOTIFY.CheckedChanged
|
||||||
|
ChangeEnabled()
|
||||||
|
End Sub
|
||||||
Private Sub ChangeEnabled()
|
Private Sub ChangeEnabled()
|
||||||
DEF_GROUP.Enabled = OPT_SPEC.Checked
|
DEF_GROUP.Enabled = OPT_SPEC.Checked
|
||||||
TXT_GROUPS.Enabled = OPT_GROUP.Checked
|
TXT_GROUPS.Enabled = OPT_GROUP.Checked
|
||||||
TXT_TIMER.Enabled = Not OPT_DISABLED.Checked
|
TXT_TIMER.Enabled = Not OPT_DISABLED.Checked
|
||||||
NUM_DELAY.Enabled = Not OPT_DISABLED.Checked
|
NUM_DELAY.Enabled = Not OPT_DISABLED.Checked
|
||||||
CH_NOTIFY.Enabled = Not OPT_DISABLED.Checked
|
CH_NOTIFY.Enabled = Not OPT_DISABLED.Checked
|
||||||
|
CH_SHOW_PIC.Enabled = CH_NOTIFY.Checked And Not OPT_DISABLED.Checked
|
||||||
|
CH_SHOW_PIC_USER.Enabled = CH_NOTIFY.Checked And Not OPT_DISABLED.Checked
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub NUM_DELAY_ActionOnButtonClick(ByVal Sender As ActionButton) Handles NUM_DELAY.ActionOnButtonClick
|
Private Sub NUM_DELAY_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles NUM_DELAY.ActionOnButtonClick
|
||||||
If Sender.DefaultButton = ActionButton.DefaultButtons.Clear Then NUM_DELAY.Value = 0
|
If Sender.DefaultButton = ActionButton.DefaultButtons.Clear Then NUM_DELAY.Value = 0
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ Namespace DownloadObjects
|
|||||||
End If
|
End If
|
||||||
BTT_CLEAR.Visible = ViewMode = ViewModes.Session
|
BTT_CLEAR.Visible = ViewMode = ViewModes.Session
|
||||||
RefillList()
|
RefillList()
|
||||||
Catch ex As Exception
|
Catch
|
||||||
Finally
|
Finally
|
||||||
Opened = True
|
Opened = True
|
||||||
End Try
|
End Try
|
||||||
@@ -96,7 +96,7 @@ Namespace DownloadObjects
|
|||||||
_TempUsersList.ListAddList(Downloader.Downloaded, LParams)
|
_TempUsersList.ListAddList(Downloader.Downloaded, LParams)
|
||||||
Else
|
Else
|
||||||
_TempUsersList.ListAddList(Settings.Users.SelectMany(Of IUserData) _
|
_TempUsersList.ListAddList(Settings.Users.SelectMany(Of IUserData) _
|
||||||
(Function(u) If(u.IsCollection, DirectCast(u, API.UserDataBind).Collections, {u})), LParams)
|
(Function(u) If(u.IsCollection, DirectCast(u, API.UserDataBind).Collections, {u})), LParams)
|
||||||
End If
|
End If
|
||||||
If _TempUsersList.Count > 0 Then
|
If _TempUsersList.Count > 0 Then
|
||||||
_TempUsersList.Sort(New UsersDateOrder)
|
_TempUsersList.Sort(New UsersDateOrder)
|
||||||
@@ -163,7 +163,7 @@ Namespace DownloadObjects
|
|||||||
Try
|
Try
|
||||||
If _LatestSelected.ValueBetween(0, _TempUsersList.Count - 1) AndAlso
|
If _LatestSelected.ValueBetween(0, _TempUsersList.Count - 1) AndAlso
|
||||||
Not DirectCast(_TempUsersList(_LatestSelected), UserDataBase).Disposed Then _TempUsersList(_LatestSelected).OpenFolder()
|
Not DirectCast(_TempUsersList(_LatestSelected), UserDataBase).Disposed Then _TempUsersList(_LatestSelected).OpenFolder()
|
||||||
Catch ex As Exception
|
Catch
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub Downloader_OnDownloadCountChange()
|
Friend Sub Downloader_OnDownloadCountChange()
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ Namespace DownloadObjects.Groups
|
|||||||
If Not e.Value.IsEmptyString Then Labels.ListAddList(e.Value.Split("|"), LAP.NotContainsOnly)
|
If Not e.Value.IsEmptyString Then Labels.ListAddList(e.Value.Split("|"), LAP.NotContainsOnly)
|
||||||
End Sub
|
End Sub
|
||||||
Public Overrides Function ToString() As String
|
Public Overrides Function ToString() As String
|
||||||
Return $"{IIf(Index >= 0 And Index <= 8, $"#{Index + 1}: ", String.Empty)}{Name}"
|
Return $"{IIf(Index.ValueBetween(0, 8), $"#{Index + 1}: ", String.Empty)}{Name}"
|
||||||
End Function
|
End Function
|
||||||
Private _ControlSent As Boolean = False
|
Private _ControlSent As Boolean = False
|
||||||
Friend Function GetControl() As ToolStripMenuItem
|
Friend Function GetControl() As ToolStripMenuItem
|
||||||
|
|||||||
@@ -44,10 +44,7 @@ Namespace DownloadObjects.Groups
|
|||||||
End Property
|
End Property
|
||||||
Friend Sub Update()
|
Friend Sub Update()
|
||||||
If Count > 0 Then
|
If Count > 0 Then
|
||||||
Using x As New XmlFile With {.Name = "Groups", .AllowSameNames = True}
|
Using x As New XmlFile With {.Name = "Groups", .AllowSameNames = True} : x.AddRange(GroupsList) : x.Save(GroupFile) : End Using
|
||||||
x.AddRange(GroupsList)
|
|
||||||
x.Save(GroupFile)
|
|
||||||
End Using
|
|
||||||
Else
|
Else
|
||||||
GroupFile.Delete()
|
GroupFile.Delete()
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ Namespace DownloadObjects.Groups
|
|||||||
Controls.Add(TP_2, 0, 3)
|
Controls.Add(TP_2, 0, 3)
|
||||||
Controls.Add(TXT_LABELS, 0, 4)
|
Controls.Add(TXT_LABELS, 0, 4)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub TXT_LABELS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_LABELS.ActionOnButtonClick
|
Private Sub TXT_LABELS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_LABELS.ActionOnButtonClick
|
||||||
Select Case Sender.DefaultButton
|
Select Case Sender.DefaultButton
|
||||||
Case ADB.Edit
|
Case ADB.Edit
|
||||||
Using f As New LabelsForm(Labels)
|
Using f As New LabelsForm(Labels)
|
||||||
|
|||||||
@@ -7,15 +7,14 @@
|
|||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
|
||||||
Namespace DownloadObjects.Groups
|
Namespace DownloadObjects.Groups
|
||||||
Friend Class GroupEditorForm : Implements IOkCancelToolbar
|
Friend Class GroupEditorForm
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Friend Property MyGroup As DownloadGroup
|
Friend Property MyGroup As DownloadGroup
|
||||||
Friend Sub New(ByRef g As DownloadGroup)
|
Friend Sub New(ByRef g As DownloadGroup)
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
MyGroup = g
|
MyGroup = g
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
End Sub
|
End Sub
|
||||||
Friend Class NameChecker : Implements IFieldsCheckerProvider
|
Friend Class NameChecker : Implements IFieldsCheckerProvider
|
||||||
Private Property ErrorMessage As String Implements IFieldsCheckerProvider.ErrorMessage
|
Private Property ErrorMessage As String Implements IFieldsCheckerProvider.ErrorMessage
|
||||||
@@ -48,7 +47,7 @@ Namespace DownloadObjects.Groups
|
|||||||
End Class
|
End Class
|
||||||
Private Sub GroupEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub GroupEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
With MyDefs
|
With MyDefs
|
||||||
.MyViewInitialize(Me, Settings.Design, True)
|
.MyViewInitialize(True)
|
||||||
.AddOkCancelToolbar()
|
.AddOkCancelToolbar()
|
||||||
If Not MyGroup Is Nothing Then
|
If Not MyGroup Is Nothing Then
|
||||||
With MyGroup
|
With MyGroup
|
||||||
@@ -59,13 +58,13 @@ Namespace DownloadObjects.Groups
|
|||||||
Text = "New Group"
|
Text = "New Group"
|
||||||
End If
|
End If
|
||||||
.MyFieldsChecker = New FieldsChecker
|
.MyFieldsChecker = New FieldsChecker
|
||||||
DirectCast(.MyFieldsChecker, FieldsChecker).AddControl(Of String)(DEFS_GROUP.TXT_NAME, DEFS_GROUP.TXT_NAME.CaptionText,,
|
.MyFieldsCheckerE.AddControl(Of String)(DEFS_GROUP.TXT_NAME, DEFS_GROUP.TXT_NAME.CaptionText,,
|
||||||
New NameChecker(If(MyGroup?.Name, String.Empty), Settings.Groups, "Group"))
|
New NameChecker(If(MyGroup?.Name, String.Empty), Settings.Groups, "Group"))
|
||||||
.MyFieldsChecker.EndLoaderOperations()
|
.MyFieldsChecker.EndLoaderOperations()
|
||||||
.EndLoaderOperations()
|
.EndLoaderOperations()
|
||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDefs_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonOkClick
|
||||||
If MyDefs.MyFieldsChecker.AllParamsOK Then
|
If MyDefs.MyFieldsChecker.AllParamsOK Then
|
||||||
If MyGroup Is Nothing Then MyGroup = New DownloadGroup
|
If MyGroup Is Nothing Then MyGroup = New DownloadGroup
|
||||||
With MyGroup
|
With MyGroup
|
||||||
@@ -75,8 +74,5 @@ Namespace DownloadObjects.Groups
|
|||||||
MyDefs.CloseForm()
|
MyDefs.CloseForm()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
37
SCrawler/Download/SchedulerEditorForm.Designer.vb
generated
37
SCrawler/Download/SchedulerEditorForm.Designer.vb
generated
@@ -22,27 +22,28 @@ Namespace DownloadObjects
|
|||||||
Private components As System.ComponentModel.IContainer
|
Private components As System.ComponentModel.IContainer
|
||||||
<System.Diagnostics.DebuggerStepThrough()>
|
<System.Diagnostics.DebuggerStepThrough()>
|
||||||
Private Sub InitializeComponent()
|
Private Sub InitializeComponent()
|
||||||
Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
|
||||||
Me.LIST_PLANS = New System.Windows.Forms.ListBox()
|
Me.LIST_PLANS = New System.Windows.Forms.ListBox()
|
||||||
Me.CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
||||||
Me.CONTAINER_MAIN.SuspendLayout()
|
CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
||||||
|
CONTAINER_MAIN.SuspendLayout()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
'CONTAINER_MAIN
|
'CONTAINER_MAIN
|
||||||
'
|
'
|
||||||
Me.CONTAINER_MAIN.BottomToolStripPanelVisible = False
|
CONTAINER_MAIN.BottomToolStripPanelVisible = False
|
||||||
'
|
'
|
||||||
'CONTAINER_MAIN.ContentPanel
|
'CONTAINER_MAIN.ContentPanel
|
||||||
'
|
'
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Controls.Add(Me.LIST_PLANS)
|
CONTAINER_MAIN.ContentPanel.Controls.Add(Me.LIST_PLANS)
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(414, 316)
|
CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(414, 316)
|
||||||
Me.CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
|
CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.CONTAINER_MAIN.LeftToolStripPanelVisible = False
|
CONTAINER_MAIN.LeftToolStripPanelVisible = False
|
||||||
Me.CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
|
CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
|
||||||
Me.CONTAINER_MAIN.Name = "CONTAINER_MAIN"
|
CONTAINER_MAIN.Name = "CONTAINER_MAIN"
|
||||||
Me.CONTAINER_MAIN.RightToolStripPanelVisible = False
|
CONTAINER_MAIN.RightToolStripPanelVisible = False
|
||||||
Me.CONTAINER_MAIN.Size = New System.Drawing.Size(414, 341)
|
CONTAINER_MAIN.Size = New System.Drawing.Size(414, 341)
|
||||||
Me.CONTAINER_MAIN.TabIndex = 0
|
CONTAINER_MAIN.TabIndex = 0
|
||||||
'
|
'
|
||||||
'LIST_PLANS
|
'LIST_PLANS
|
||||||
'
|
'
|
||||||
@@ -58,20 +59,18 @@ Namespace DownloadObjects
|
|||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||||
Me.ClientSize = New System.Drawing.Size(414, 341)
|
Me.ClientSize = New System.Drawing.Size(414, 341)
|
||||||
Me.Controls.Add(Me.CONTAINER_MAIN)
|
Me.Controls.Add(CONTAINER_MAIN)
|
||||||
Me.KeyPreview = True
|
Me.KeyPreview = True
|
||||||
Me.MinimumSize = New System.Drawing.Size(430, 380)
|
Me.MinimumSize = New System.Drawing.Size(430, 380)
|
||||||
Me.Name = "SchedulerEditorForm"
|
Me.Name = "SchedulerEditorForm"
|
||||||
Me.ShowIcon = False
|
Me.ShowIcon = False
|
||||||
Me.Text = "Scheduler"
|
Me.Text = "Scheduler"
|
||||||
Me.CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
|
CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
|
||||||
Me.CONTAINER_MAIN.ResumeLayout(False)
|
CONTAINER_MAIN.ResumeLayout(False)
|
||||||
Me.CONTAINER_MAIN.PerformLayout()
|
CONTAINER_MAIN.PerformLayout()
|
||||||
Me.ResumeLayout(False)
|
Me.ResumeLayout(False)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private WithEvents CONTAINER_MAIN As ToolStripContainer
|
|
||||||
Private WithEvents LIST_PLANS As ListBox
|
Private WithEvents LIST_PLANS As ListBox
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -117,4 +117,7 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</value>
|
||||||
|
</metadata>
|
||||||
</root>
|
</root>
|
||||||
@@ -9,42 +9,38 @@
|
|||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
Imports PersonalUtilities.Forms.Toolbars
|
||||||
Namespace DownloadObjects
|
Namespace DownloadObjects
|
||||||
Friend Class SchedulerEditorForm : Implements IEditToolbar
|
Friend Class SchedulerEditorForm
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Private WithEvents BTT_SKIP As ToolStripButton
|
Private WithEvents BTT_SKIP As ToolStripButton
|
||||||
Private WithEvents BTT_START As ToolStripButton
|
Private WithEvents BTT_START As ToolStripButton
|
||||||
Friend Sub New()
|
Friend Sub New()
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
|
BTT_SKIP = New ToolStripButton With {
|
||||||
|
.Text = "Skip",
|
||||||
|
.ToolTipText = "Skip next run",
|
||||||
|
.AutoToolTip = True,
|
||||||
|
.DisplayStyle = ToolStripItemDisplayStyle.Text
|
||||||
|
}
|
||||||
|
BTT_START = New ToolStripButton With {
|
||||||
|
.Text = "Start",
|
||||||
|
.Image = My.Resources.StartPic_01_Green_16,
|
||||||
|
.ToolTipText = "Run selected plan",
|
||||||
|
.AutoToolTip = True
|
||||||
|
}
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub SchedulerEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub SchedulerEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
With MyDefs
|
With MyDefs
|
||||||
.MyViewInitialize(Me, Settings.Design)
|
.MyViewInitialize()
|
||||||
.AddEditToolbar()
|
.AddEditToolbarPlus({BTT_START, BTT_SKIP})
|
||||||
BTT_SKIP = New ToolStripButton With {
|
|
||||||
.Text = "Skip",
|
|
||||||
.ToolTipText = "Skip next run",
|
|
||||||
.AutoToolTip = True,
|
|
||||||
.DisplayStyle = ToolStripItemDisplayStyle.Text
|
|
||||||
}
|
|
||||||
BTT_START = New ToolStripButton With {
|
|
||||||
.Text = "Start",
|
|
||||||
.Image = My.Resources.StartPic_01_Green_16,
|
|
||||||
.ToolTipText = "Run selected plan",
|
|
||||||
.AutoToolTip = True
|
|
||||||
}
|
|
||||||
.MyEditToolbar.ToolStrip.Items.AddRange({BTT_START, BTT_SKIP})
|
|
||||||
Refill()
|
Refill()
|
||||||
.EndLoaderOperations(False)
|
.EndLoaderOperations(False)
|
||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub SchedulerEditorForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
|
||||||
BTT_SKIP.Dispose()
|
|
||||||
End Sub
|
|
||||||
Private Sub SchedulerEditorForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
Private Sub SchedulerEditorForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
||||||
If e.KeyCode = Keys.Escape Then Close()
|
If e.KeyCode = Keys.Escape Then Close()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Refill() Implements IEditToolbar.Update
|
Private Sub Refill() Handles MyDefs.ButtonUpdateClick
|
||||||
Try
|
Try
|
||||||
LIST_PLANS.Items.Clear()
|
LIST_PLANS.Items.Clear()
|
||||||
If Settings.Automation.Count > 0 Then
|
If Settings.Automation.Count > 0 Then
|
||||||
@@ -57,7 +53,7 @@ Namespace DownloadObjects
|
|||||||
ErrorsDescriber.Execute(EDP.SendInLog, ex)
|
ErrorsDescriber.Execute(EDP.SendInLog, ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Add() Implements IEditToolbar.Add
|
Private Sub MyDefs_ButtonAddClick(ByVal Sender As Object, ByVal e As EditToolbar.EditToolbarEventArgs) Handles MyDefs.ButtonAddClick
|
||||||
Dim a As New AutoDownloader(True)
|
Dim a As New AutoDownloader(True)
|
||||||
Using f As New AutoDownloaderEditorForm(a)
|
Using f As New AutoDownloaderEditorForm(a)
|
||||||
f.ShowDialog()
|
f.ShowDialog()
|
||||||
@@ -69,7 +65,7 @@ Namespace DownloadObjects
|
|||||||
End If
|
End If
|
||||||
End Using
|
End Using
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Edit() Implements IEditToolbar.Edit
|
Private Sub Edit() Handles MyDefs.ButtonEditClick
|
||||||
If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then
|
If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then
|
||||||
Using f As New AutoDownloaderEditorForm(Settings.Automation(_LatestSelected)) : f.ShowDialog() : End Using
|
Using f As New AutoDownloaderEditorForm(Settings.Automation(_LatestSelected)) : f.ShowDialog() : End Using
|
||||||
Refill()
|
Refill()
|
||||||
@@ -78,14 +74,16 @@ Namespace DownloadObjects
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private _DeleteInProgress As Boolean = False
|
Private _DeleteInProgress As Boolean = False
|
||||||
Private Async Sub Delete() Implements IEditToolbar.Delete
|
Private Async Sub MyDefs_ButtonDeleteClickE(ByVal Sender As Object, ByVal e As EditToolbar.EditToolbarEventArgs) Handles MyDefs.ButtonDeleteClickE
|
||||||
If Not _DeleteInProgress Then
|
If Not _DeleteInProgress Then
|
||||||
If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then
|
If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then
|
||||||
_DeleteInProgress = True
|
_DeleteInProgress = True
|
||||||
Dim n$ = Settings.Automation(_LatestSelected).Name
|
Dim n$ = Settings.Automation(_LatestSelected).Name
|
||||||
Await Settings.Automation.RemoveAt(_LatestSelected)
|
If MsgBoxE({$"Are you sure you want to delete the [{n}] plan?", "Deleting a plan..."}, vbExclamation + vbYesNo) = vbYes Then
|
||||||
Refill()
|
Await Settings.Automation.RemoveAt(_LatestSelected)
|
||||||
MsgBoxE($"Plan [{n}] deleted")
|
Refill()
|
||||||
|
MsgBoxE($"Plan [{n}] deleted")
|
||||||
|
End If
|
||||||
_DeleteInProgress = False
|
_DeleteInProgress = False
|
||||||
Else
|
Else
|
||||||
MsgBoxE("You have not selected a plan to delete.", vbExclamation)
|
MsgBoxE("You have not selected a plan to delete.", vbExclamation)
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports System.Threading
|
Imports System.Threading
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
Imports PersonalUtilities.Tools
|
||||||
Imports EOptions = PersonalUtilities.Forms.Toolbars.IMyProgress.EnableOptions
|
|
||||||
Imports SCrawler.API
|
Imports SCrawler.API
|
||||||
Imports SCrawler.API.Base
|
Imports SCrawler.API.Base
|
||||||
Imports SCrawler.Plugin.Hosts
|
Imports SCrawler.Plugin.Hosts
|
||||||
Imports Download = SCrawler.Plugin.ISiteSettings.Download
|
Imports Download = SCrawler.Plugin.ISiteSettings.Download
|
||||||
|
Imports EOptions = PersonalUtilities.Forms.Toolbars.IMyProgress.EnableOptions
|
||||||
Namespace DownloadObjects
|
Namespace DownloadObjects
|
||||||
Friend Class TDownloader : Implements IDisposable
|
Friend Class TDownloader : Implements IDisposable
|
||||||
#Region "Events"
|
#Region "Events"
|
||||||
@@ -34,7 +34,7 @@ Namespace DownloadObjects
|
|||||||
End Property
|
End Property
|
||||||
Friend ReadOnly Property Count As Integer
|
Friend ReadOnly Property Count As Integer
|
||||||
Get
|
Get
|
||||||
If Pool.Count = 0 Then Return 0 Else Return Pool.Sum(Function(j) j.Count)
|
Return If(Pool.Count = 0, 0, Pool.Sum(Function(j) j.Count))
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
@@ -53,30 +53,11 @@ Namespace DownloadObjects
|
|||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Jobs"
|
#Region "Jobs"
|
||||||
Friend Class Job : Implements IDisposable
|
Friend Class Job : Inherits JobThread(Of IUserData)
|
||||||
Friend Event OnItemsCountChange(ByVal Sender As Job, ByVal Count As Integer)
|
|
||||||
Private ReadOnly Hosts As List(Of SettingsHost)
|
Private ReadOnly Hosts As List(Of SettingsHost)
|
||||||
Private ReadOnly Keys As List(Of String)
|
Private ReadOnly Keys As List(Of String)
|
||||||
Private ReadOnly RemovingKeys As List(Of String)
|
Private ReadOnly RemovingKeys As List(Of String)
|
||||||
Private TokenSource As CancellationTokenSource
|
|
||||||
Friend Token As CancellationToken
|
|
||||||
Private [Thread] As Thread
|
|
||||||
Private _Working As Boolean
|
|
||||||
Friend ReadOnly Property Items As List(Of IUserData)
|
|
||||||
Friend ReadOnly Property [Type] As Download
|
Friend ReadOnly Property [Type] As Download
|
||||||
Friend ReadOnly Property Count As Integer
|
|
||||||
Get
|
|
||||||
Return Items.Count
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Friend Sub Clear()
|
|
||||||
Items.Clear()
|
|
||||||
End Sub
|
|
||||||
Friend ReadOnly Property Working As Boolean
|
|
||||||
Get
|
|
||||||
Return _Working OrElse If(Thread?.IsAlive, False)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Friend ReadOnly Property IsSeparated As Boolean
|
Friend ReadOnly Property IsSeparated As Boolean
|
||||||
Get
|
Get
|
||||||
Return Hosts.Count = 1 AndAlso Hosts(0).IsSeparatedTasks
|
Return Hosts.Count = 1 AndAlso Hosts(0).IsSeparatedTasks
|
||||||
@@ -102,21 +83,19 @@ Namespace DownloadObjects
|
|||||||
Return Nothing
|
Return Nothing
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
Friend Property Progress As MyProgress
|
|
||||||
Friend Sub New(ByVal JobType As Download)
|
Friend Sub New(ByVal JobType As Download)
|
||||||
Hosts = New List(Of SettingsHost)
|
Hosts = New List(Of SettingsHost)
|
||||||
RemovingKeys = New List(Of String)
|
RemovingKeys = New List(Of String)
|
||||||
Keys = New List(Of String)
|
Keys = New List(Of String)
|
||||||
Items = New List(Of IUserData)
|
|
||||||
[Type] = JobType
|
[Type] = JobType
|
||||||
End Sub
|
End Sub
|
||||||
Friend Function Add(ByVal User As IUserData) As Boolean
|
Public Overrides Function Add(ByVal User As IUserData) As Boolean
|
||||||
With DirectCast(User, UserDataBase)
|
With DirectCast(User, UserDataBase)
|
||||||
If Keys.Count > 0 Then
|
If Keys.Count > 0 Then
|
||||||
Dim i% = Keys.IndexOf(.User.Plugin)
|
Dim i% = Keys.IndexOf(.User.Plugin)
|
||||||
If i >= 0 Then
|
If i >= 0 Then
|
||||||
Items.Add(User)
|
Items.Add(User)
|
||||||
RaiseEvent OnItemsCountChange(Me, Count)
|
OnItemsCountChange(Me, Count)
|
||||||
Return True
|
Return True
|
||||||
Else
|
Else
|
||||||
If RemovingKeys.Count > 0 Then Return RemovingKeys.IndexOf(.User.Plugin) >= 0
|
If RemovingKeys.Count > 0 Then Return RemovingKeys.IndexOf(.User.Plugin) >= 0
|
||||||
@@ -151,29 +130,13 @@ Namespace DownloadObjects
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
Friend Sub ThrowIfCancellationRequested()
|
Public Overrides Sub Start()
|
||||||
Token.ThrowIfCancellationRequested()
|
|
||||||
End Sub
|
|
||||||
Friend ReadOnly Property IsCancellationRequested As Boolean
|
|
||||||
Get
|
|
||||||
Return Token.IsCancellationRequested
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Friend Sub [Start](ByVal [ThreadStart] As ThreadStart)
|
|
||||||
Thread = New Thread(ThreadStart) With {.IsBackground = True}
|
|
||||||
Thread.SetApartmentState(ApartmentState.MTA)
|
|
||||||
Thread.Start()
|
|
||||||
End Sub
|
|
||||||
Friend Sub [Start]()
|
|
||||||
If Hosts.Count > 0 Then Hosts.ForEach(Sub(h) h.DownloadStarted([Type]))
|
If Hosts.Count > 0 Then Hosts.ForEach(Sub(h) h.DownloadStarted([Type]))
|
||||||
TokenSource = New CancellationTokenSource
|
TokenSource = New CancellationTokenSource
|
||||||
Token = TokenSource.Token
|
Token = TokenSource.Token
|
||||||
_Working = True
|
_Working = True
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub [Stop]()
|
Public Overrides Sub Stopped()
|
||||||
If Not TokenSource Is Nothing Then TokenSource.Cancel()
|
|
||||||
End Sub
|
|
||||||
Friend Sub Stopped()
|
|
||||||
_Working = False
|
_Working = False
|
||||||
TokenSource = Nothing
|
TokenSource = Nothing
|
||||||
Try
|
Try
|
||||||
@@ -186,25 +149,13 @@ Namespace DownloadObjects
|
|||||||
If Hosts.Count > 0 Then Hosts.ForEach(Sub(h) h.DownloadDone([Type]))
|
If Hosts.Count > 0 Then Hosts.ForEach(Sub(h) h.DownloadDone([Type]))
|
||||||
End Sub
|
End Sub
|
||||||
#Region "IDisposable Support"
|
#Region "IDisposable Support"
|
||||||
Private disposedValue As Boolean = False
|
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||||
Protected Overridable Overloads Sub Dispose(ByVal disposing As Boolean)
|
If Not disposedValue And disposing Then
|
||||||
If Not disposedValue Then
|
Hosts.Clear()
|
||||||
If disposing Then
|
Keys.Clear()
|
||||||
Hosts.Clear()
|
RemovingKeys.Clear()
|
||||||
Keys.Clear()
|
|
||||||
RemovingKeys.Clear()
|
|
||||||
Items.Clear()
|
|
||||||
End If
|
|
||||||
disposedValue = True
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
MyBase.Dispose(disposing)
|
||||||
Protected Overrides Sub Finalize()
|
|
||||||
Dispose(False)
|
|
||||||
MyBase.Finalize()
|
|
||||||
End Sub
|
|
||||||
Friend Overloads Sub Dispose() Implements IDisposable.Dispose
|
|
||||||
Dispose(True)
|
|
||||||
GC.SuppressFinalize(Me)
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
15
SCrawler/Download/VideosDownloaderForm.Designer.vb
generated
15
SCrawler/Download/VideosDownloaderForm.Designer.vb
generated
@@ -16,11 +16,13 @@
|
|||||||
Private Sub InitializeComponent()
|
Private Sub InitializeComponent()
|
||||||
Dim SEP_1 As System.Windows.Forms.ToolStripSeparator
|
Dim SEP_1 As System.Windows.Forms.ToolStripSeparator
|
||||||
Dim SEP_2 As System.Windows.Forms.ToolStripSeparator
|
Dim SEP_2 As System.Windows.Forms.ToolStripSeparator
|
||||||
|
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(VideosDownloaderForm))
|
||||||
Me.ToolbarTOP = New System.Windows.Forms.ToolStrip()
|
Me.ToolbarTOP = New System.Windows.Forms.ToolStrip()
|
||||||
Me.BTT_ADD = New System.Windows.Forms.ToolStripButton()
|
Me.BTT_ADD = New System.Windows.Forms.ToolStripButton()
|
||||||
Me.BTT_ADD_LIST = New System.Windows.Forms.ToolStripButton()
|
Me.BTT_ADD_LIST = New System.Windows.Forms.ToolStripButton()
|
||||||
Me.BTT_DELETE = New System.Windows.Forms.ToolStripButton()
|
Me.BTT_DELETE = New System.Windows.Forms.ToolStripButton()
|
||||||
Me.BTT_DOWN = New System.Windows.Forms.ToolStripButton()
|
Me.BTT_DOWN = New System.Windows.Forms.ToolStripButton()
|
||||||
|
Me.BTT_STOP = New System.Windows.Forms.ToolStripButton()
|
||||||
Me.BTT_OPEN_PATH = New System.Windows.Forms.ToolStripButton()
|
Me.BTT_OPEN_PATH = New System.Windows.Forms.ToolStripButton()
|
||||||
Me.ToolbarBOTTOM = New System.Windows.Forms.StatusStrip()
|
Me.ToolbarBOTTOM = New System.Windows.Forms.StatusStrip()
|
||||||
Me.PR_V = New System.Windows.Forms.ToolStripProgressBar()
|
Me.PR_V = New System.Windows.Forms.ToolStripProgressBar()
|
||||||
@@ -45,7 +47,7 @@
|
|||||||
'ToolbarTOP
|
'ToolbarTOP
|
||||||
'
|
'
|
||||||
Me.ToolbarTOP.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden
|
Me.ToolbarTOP.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden
|
||||||
Me.ToolbarTOP.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_ADD, Me.BTT_ADD_LIST, Me.BTT_DELETE, SEP_1, Me.BTT_DOWN, SEP_2, Me.BTT_OPEN_PATH})
|
Me.ToolbarTOP.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_ADD, Me.BTT_ADD_LIST, Me.BTT_DELETE, SEP_1, Me.BTT_DOWN, Me.BTT_STOP, SEP_2, Me.BTT_OPEN_PATH})
|
||||||
Me.ToolbarTOP.Location = New System.Drawing.Point(0, 0)
|
Me.ToolbarTOP.Location = New System.Drawing.Point(0, 0)
|
||||||
Me.ToolbarTOP.Name = "ToolbarTOP"
|
Me.ToolbarTOP.Name = "ToolbarTOP"
|
||||||
Me.ToolbarTOP.Size = New System.Drawing.Size(524, 25)
|
Me.ToolbarTOP.Size = New System.Drawing.Size(524, 25)
|
||||||
@@ -87,6 +89,16 @@
|
|||||||
Me.BTT_DOWN.Size = New System.Drawing.Size(104, 22)
|
Me.BTT_DOWN.Size = New System.Drawing.Size(104, 22)
|
||||||
Me.BTT_DOWN.Text = "Download (F5)"
|
Me.BTT_DOWN.Text = "Download (F5)"
|
||||||
'
|
'
|
||||||
|
'BTT_STOP
|
||||||
|
'
|
||||||
|
Me.BTT_STOP.AutoToolTip = False
|
||||||
|
Me.BTT_STOP.Enabled = False
|
||||||
|
Me.BTT_STOP.Image = CType(resources.GetObject("BTT_STOP.Image"), System.Drawing.Image)
|
||||||
|
Me.BTT_STOP.ImageTransparentColor = System.Drawing.Color.Magenta
|
||||||
|
Me.BTT_STOP.Name = "BTT_STOP"
|
||||||
|
Me.BTT_STOP.Size = New System.Drawing.Size(51, 22)
|
||||||
|
Me.BTT_STOP.Text = "Stop"
|
||||||
|
'
|
||||||
'BTT_OPEN_PATH
|
'BTT_OPEN_PATH
|
||||||
'
|
'
|
||||||
Me.BTT_OPEN_PATH.AutoToolTip = False
|
Me.BTT_OPEN_PATH.AutoToolTip = False
|
||||||
@@ -156,5 +168,6 @@
|
|||||||
Private WithEvents LIST_VIDEOS As ListBox
|
Private WithEvents LIST_VIDEOS As ListBox
|
||||||
Private WithEvents BTT_DOWN As ToolStripButton
|
Private WithEvents BTT_DOWN As ToolStripButton
|
||||||
Private WithEvents BTT_OPEN_PATH As ToolStripButton
|
Private WithEvents BTT_OPEN_PATH As ToolStripButton
|
||||||
|
Private WithEvents BTT_STOP As ToolStripButton
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -126,6 +126,36 @@
|
|||||||
<metadata name="ToolbarTOP.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="ToolbarTOP.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
|
<data name="BTT_STOP.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||||
|
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAVCSURBVEhLjZVtTFNXGMcLQmdHO6CdhGSlc4gDBAr2Qrmo
|
||||||
|
GJygFFuBtoLKiJpRcUXFF5QoRmM00SgmS/Zh+7B92DKTmblEl2VzgEDmBBJgoBPDm4qlLX0vXOaWLNCz
|
||||||
|
/ynFl1g2nuSX9p7zP//nyXPOPZdHo7+gIKItPv6L9tjYkSaZ7PMtUuk7GA7zT/5PDCuV7BOZ7M5obGzf
|
||||||
|
jYQEPYYiQIh/ksYDo1HYXVBwfbi+noxduUIe1dX5mli2NVskWonp8DlV8BhkmHXWHTuecpcukenGRvKk
|
||||||
|
rMz9aVJSjSwyMhrTc0laV6z4bOjIEfL47FkyduYMMUNsOn6c3GLZO3KR6H1IgiYZzcn5AOYm7vJlwmEt
|
||||||
|
19BApk+fJsMajecHqfQTSMQgjNcukZip+eO6OvL05ElihmjiwgUyXl/va1Iqf0sTiRIhfCUJ2rLJWl5u
|
||||||
|
ppVT82mYc8eOkWkU5q2sJG0xMQOQsUDEa4mLuzpSVUXGkMAEzCdOECsW2M+fJxa0q4VlO1OFwiSI/UmG
|
||||||
|
FYpNE2Vl5qmLFwmHYqZRFId104cPk8l9+8htpdK5SyL5DtIiIOZply9/91Zm5p3RPXt84xBZwASqsWNP
|
||||||
|
XGiZ4+hR0o4kq4XC5N8ZpsCi11unzp3zt4RDxRzay9XWkimYt2dluRMFgq9hbAByQDecF85IJElI0mna
|
||||||
|
tYtYDxwgtv37if3QIeJEMg+M8Ozrysm5N1ZcbOZOnfJXzGGOg5arqZkzZxh3skBwFX5VICVgHgr8wV8t
|
||||||
|
Fif/olB0mCoqfLbqauIALqORuGHgRTLvwYNkCtVOUWM8c3j2m6O9HSzrkQuF1JxWvgosBS+OaiD4SrF4
|
||||||
|
VUt6eqd12zbi2L2buIDHYCBeVDiJhJPYwMniYuLdsIF4c3KIG3RkZ3szRKJrWL8X0MoF4DXz+eBnRUen
|
||||||
|
3JbLO81q9Yx7+3biUqmIi2GIUyolTpGIOMPDiXPJEmITCn0t8fEeNiqKbmg1SAVvggXN58Pfrm65vH8C
|
||||||
|
hjaY2YEDUGM/YWHkoULxtz4p6SfoPwZpYFHm/rBWVhqta9eabALB6+aAjo0nJMy0aTSPkuPiirEkEizO
|
||||||
|
3GswHHVu3Oi0ofqFzC3gKTClpJA+rXZg55o1GVj6n9eKP1wGQ4Nj82aXLSLiNXMHek/bRc3HwEhoKHkA
|
||||||
|
BjMyfP063UM9y9I2LZzEs3fvSUdhoTtY5Q6JhIwXFv5jSUz0UfPhgHkv6AD3GWYWSQZ2LpQER7EB5h6c
|
||||||
|
DL/xK22JiSGDRUV/nlu/vqtXrZ4wJSeTP2DaA+6CX0Eb6MvKmu3W6+9tlMvpBfniqndXVdU7VCqPPZj5
|
||||||
|
smVkqKjoWQ3DtEC6vzA19cOBkpJHg+j9vHkraAa3QLdSOdul0/V+pdHQjeeDEJ67tNRsj4oKWjk1r1Yo
|
||||||
|
miE0ArqR4kN5eWv7tdrRe2lpz81/Bj+Cm6A/N3emR6sdgnY54PPsOt2gWyYLWrmRYW5DVBMwn/9S8Q/n
|
||||||
|
57N9Ot1oT1qa72Xz70NCSM+6dTPtarUFugIQzeuqqNgxoVa7XDB9qfK/DgQ3nw9+bV5eNjZ2pDs9ndwI
|
||||||
|
mN/Nzp79VqUaL1q58kto5hIgljaXlZ0yb93qsbOsb0ilelabmdmK8YXM54NvyM1V0HZ0Yx1u29nrKpXl
|
||||||
|
LYGgEXOlYK5FiBAmPj6yV6v95nFJieNafj5OX2gtxhkgpPNUtEDwb5aXf3S/tNRyV6NxFiYm0m+BFkgB
|
||||||
|
Pa7P19I/USATbAn8Lvb1fwPQo0lPjhq8B4K+cEsArZh+rOkvfV5M0CLo/f92AJowUBiP9y9PzdvIaubv
|
||||||
|
/QAAAABJRU5ErkJggg==
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
<metadata name="ToolbarBOTTOM.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="ToolbarBOTTOM.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>124, 17</value>
|
<value>124, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|||||||
@@ -8,27 +8,26 @@
|
|||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports System.ComponentModel
|
Imports System.ComponentModel
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
|
Imports PersonalUtilities.Tools
|
||||||
Namespace DownloadObjects
|
Namespace DownloadObjects
|
||||||
Friend Class VideosDownloaderForm
|
Friend Class VideosDownloaderForm
|
||||||
|
#Region "Declarations"
|
||||||
Private MyView As FormsView
|
Private MyView As FormsView
|
||||||
Private ReadOnly MyPR As Toolbars.MyProgress
|
|
||||||
Private ReadOnly UrlList As List(Of String)
|
|
||||||
Private ReadOnly DownloadingUrlsFile As SFile = $"{SettingsFolderName}\VideosUrls.txt"
|
Private ReadOnly DownloadingUrlsFile As SFile = $"{SettingsFolderName}\VideosUrls.txt"
|
||||||
|
Private ReadOnly MyJob As JobThread(Of String)
|
||||||
|
#End Region
|
||||||
|
#Region "Initializer"
|
||||||
Friend Sub New()
|
Friend Sub New()
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
UrlList = New List(Of String)
|
MyJob = New JobThread(Of String) With {.Progress = New Toolbars.MyProgress(ToolbarBOTTOM, PR_V, LBL_STATUS, "Downloading video")}
|
||||||
MyPR = New Toolbars.MyProgress(ToolbarBOTTOM, PR_V, LBL_STATUS, "Downloading video")
|
|
||||||
If DownloadingUrlsFile.Exists Then _
|
If DownloadingUrlsFile.Exists Then _
|
||||||
UrlList.ListAddList(DownloadingUrlsFile.GetText.StringToList(Of String, List(Of String))(Environment.NewLine), LAP.NotContainsOnly)
|
MyJob.Items.ListAddList(DownloadingUrlsFile.GetText.StringToList(Of String, List(Of String))(Environment.NewLine), LAP.NotContainsOnly)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub VideosDownloaderForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub VideosDownloaderForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
Try
|
MyView = New FormsView(Me)
|
||||||
MyView = New FormsView(Me)
|
MyView.ImportFromXML(Settings.Design)
|
||||||
MyView.ImportFromXML(Settings.Design)
|
MyView.SetMeSize()
|
||||||
MyView.SetMeSize()
|
RefillList(False)
|
||||||
RefillList(False)
|
|
||||||
Catch ex As Exception
|
|
||||||
End Try
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub VideosDownloaderForm_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
Private Sub VideosDownloaderForm_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
||||||
e.Cancel = True
|
e.Cancel = True
|
||||||
@@ -36,95 +35,120 @@ Namespace DownloadObjects
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub VideosDownloaderForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
Private Sub VideosDownloaderForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
||||||
If Not MyView Is Nothing Then MyView.Dispose(Settings.Design)
|
If Not MyView Is Nothing Then MyView.Dispose(Settings.Design)
|
||||||
If UrlList.Count > 0 Then UpdateUrlsFile()
|
If MyJob.Count > 0 Then UpdateUrlsFile()
|
||||||
UrlList.Clear()
|
MyJob.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub VideosDownloaderForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
Private Sub VideosDownloaderForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
||||||
Dim b As Boolean = True
|
Dim b As Boolean = True
|
||||||
Select Case e.KeyCode
|
Select Case e.KeyCode
|
||||||
Case Keys.Insert : AddVideo()
|
Case Keys.Insert : AddItem()
|
||||||
Case Keys.F5 : DownloadVideos()
|
Case Keys.F5 : StartDownloading()
|
||||||
Case Keys.F8 : BTT_DELETE_Click(Nothing, EventArgs.Empty)
|
Case Keys.F8 : DeleteItem()
|
||||||
Case Else : b = False
|
Case Else : b = False
|
||||||
End Select
|
End Select
|
||||||
If b Then e.Handled = True
|
If b Then e.Handled = True
|
||||||
End Sub
|
End Sub
|
||||||
|
#End Region
|
||||||
|
#Region "Refill, Update file"
|
||||||
Private Sub RefillList(Optional ByVal Update As Boolean = True)
|
Private Sub RefillList(Optional ByVal Update As Boolean = True)
|
||||||
Try
|
Try
|
||||||
With LIST_VIDEOS
|
Dim a As Action = Sub()
|
||||||
.Items.Clear()
|
With LIST_VIDEOS
|
||||||
If UrlList.Count > 0 Then UrlList.ForEach(Sub(u) .Items.Add(u))
|
.Items.Clear()
|
||||||
If .Items.Count > 0 And _LatestSelected >= 0 And _LatestSelected <= .Items.Count - 1 Then .SelectedIndex = _LatestSelected
|
If MyJob.Count > 0 Then MyJob.Items.ForEach(Sub(u) .Items.Add(u))
|
||||||
If Update Then UpdateUrlsFile()
|
If _LatestSelected.ValueBetween(0, .Items.Count - 1) Then .SelectedIndex = _LatestSelected
|
||||||
End With
|
If Update Then UpdateUrlsFile()
|
||||||
|
End With
|
||||||
|
End Sub
|
||||||
|
If LIST_VIDEOS.InvokeRequired Then LIST_VIDEOS.Invoke(a) Else a.Invoke
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Error on list refill")
|
ErrorsDescriber.Execute(EDP.SendInLog, ex, "Error on list refill")
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub UpdateUrlsFile()
|
Private Sub UpdateUrlsFile()
|
||||||
If UrlList.Count > 0 Then
|
If MyJob.Count > 0 Then
|
||||||
TextSaver.SaveTextToFile(UrlList.ListToString(Environment.NewLine), DownloadingUrlsFile, True,, EDP.SendInLog)
|
TextSaver.SaveTextToFile(MyJob.ListToString(Environment.NewLine), DownloadingUrlsFile, True,, EDP.SendInLog)
|
||||||
Else
|
Else
|
||||||
DownloadingUrlsFile.Delete(, Settings.DeleteMode, EDP.SendInLog)
|
DownloadingUrlsFile.Delete(, Settings.DeleteMode, EDP.SendInLog)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub BTT_ADD_Click(sender As Object, e As EventArgs) Handles BTT_ADD.Click
|
#End Region
|
||||||
AddVideo()
|
#Region "Add, Delete"
|
||||||
End Sub
|
Private Sub AddItem() Handles BTT_ADD.Click
|
||||||
Private Sub AddVideo()
|
|
||||||
Dim URL$ = GetNewVideoURL()
|
Dim URL$ = GetNewVideoURL()
|
||||||
If Not URL.IsEmptyString Then
|
If Not URL.IsEmptyString Then
|
||||||
If Not UrlList.Contains(URL) Then
|
If Not MyJob.Contains(URL) Then
|
||||||
UrlList.Add(URL)
|
MyJob.Add(URL)
|
||||||
RefillList()
|
RefillList()
|
||||||
Else
|
Else
|
||||||
MsgBoxE("This URL already added to list")
|
MsgBoxE("This URL has already been added to the list")
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub BTT_ADD_LIST_Click(sender As Object, e As EventArgs) Handles BTT_ADD_LIST.Click
|
Private Sub AddItemsRange() Handles BTT_ADD_LIST.Click
|
||||||
Dim l$ = InputBoxE("Enter URLs (new line as delimiter):", "URLs list", GetCurrentBuffer(),,,,,, True)
|
Dim l$ = InputBoxE("Enter URLs (new line as delimiter):", "URLs list", GetCurrentBuffer(),,,,,, True)
|
||||||
If Not l.IsEmptyString Then
|
If Not l.IsEmptyString Then
|
||||||
Dim ub% = UrlList.Count
|
Dim ub% = MyJob.Count
|
||||||
UrlList.ListAddList(l.StringFormatLines.StringToList(Of String, List(Of String))(vbCrLf).ListForEach(Function(u, i) u.Trim,, False))
|
MyJob.Items.ListAddList(l.StringFormatLines.StringToList(Of String, List(Of String))(vbCrLf).ListForEach(Function(u, i) u.Trim,, False))
|
||||||
If Not UrlList.Count = ub Then RefillList()
|
If Not MyJob.Count = ub Then RefillList()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub BTT_DELETE_Click(sender As Object, e As EventArgs) Handles BTT_DELETE.Click
|
Private Sub DeleteItem() Handles BTT_DELETE.Click
|
||||||
If _LatestSelected >= 0 And _LatestSelected <= UrlList.Count - 1 Then
|
If _LatestSelected.ValueBetween(0, MyJob.Count - 1) Then
|
||||||
If MsgBoxE({$"Do you really want to delete video URL:{vbCr}{UrlList(_LatestSelected)}", "Deleting URL..."},
|
If MsgBoxE({$"Are you sure you want to delete the video URL:{vbCr}{MyJob(_LatestSelected)}", "Deleting URL..."}, vbExclamation + vbYesNo) = vbYes Then
|
||||||
MsgBoxStyle.Exclamation + MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
MyJob.Items.RemoveAt(_LatestSelected)
|
||||||
UrlList.RemoveAt(_LatestSelected)
|
|
||||||
RefillList()
|
RefillList()
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
MsgBoxE("URL does not selected", MsgBoxStyle.Exclamation)
|
MsgBoxE("URL not selected", MsgBoxStyle.Exclamation)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
#End Region
|
||||||
|
#Region "Start, Stop"
|
||||||
Private Sub BTT_DOWN_Click(sender As Object, e As EventArgs) Handles BTT_DOWN.Click
|
Private Sub BTT_DOWN_Click(sender As Object, e As EventArgs) Handles BTT_DOWN.Click
|
||||||
DownloadVideos()
|
StartDownloading()
|
||||||
|
End Sub
|
||||||
|
Private Sub BTT_STOP_Click(sender As Object, e As EventArgs) Handles BTT_STOP.Click
|
||||||
|
SetControlValueInvoke(ToolbarTOP, BTT_STOP, Sub() BTT_STOP.Enabled = False)
|
||||||
|
MyJob.Stop()
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
|
#Region "Downloading"
|
||||||
|
Private Sub StartDownloading()
|
||||||
|
If Not MyJob.Working And MyJob.Count > 0 Then
|
||||||
|
SetControlValueInvoke(ToolbarTOP, BTT_DOWN, Sub() BTT_DOWN.Enabled = False)
|
||||||
|
SetControlValueInvoke(ToolbarTOP, BTT_STOP, Sub() BTT_STOP.Enabled = True)
|
||||||
|
MyJob.Start(AddressOf DownloadVideos, Threading.ApartmentState.STA)
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub DownloadVideos()
|
Private Sub DownloadVideos()
|
||||||
If UrlList.Count > 0 Then
|
MyJob.Start()
|
||||||
MyPR.TotalCount = UrlList.Count
|
If MyJob.Count > 0 Then
|
||||||
MyPR.Enabled = True
|
MyJob.Progress.TotalCount = MyJob.Count
|
||||||
|
MyJob.Progress.Enabled = True
|
||||||
Dim IsFirst As Boolean = True
|
Dim IsFirst As Boolean = True
|
||||||
For i% = UrlList.Count - 1 To 0 Step -1
|
For i% = MyJob.Count - 1 To 0 Step -1
|
||||||
If DownloadVideoByURL(UrlList(i), IsFirst, True) Then UrlList.RemoveAt(i)
|
If MyJob.IsCancellationRequested Then Exit For
|
||||||
MyPR.Perform()
|
If DownloadVideoByURL(MyJob(i), IsFirst, True) Then MyJob.Items.RemoveAt(i)
|
||||||
|
MyJob.Progress.Perform()
|
||||||
IsFirst = False
|
IsFirst = False
|
||||||
Next
|
Next
|
||||||
MyPR.Done()
|
MyJob.Progress.Done()
|
||||||
RefillList()
|
RefillList()
|
||||||
MyPR.Enabled = False
|
MyJob.Progress.Enabled = False
|
||||||
Else
|
|
||||||
MsgBoxE("No one video added", MsgBoxStyle.Exclamation)
|
|
||||||
End If
|
End If
|
||||||
|
SetControlValueInvoke(ToolbarTOP, BTT_DOWN, Sub() BTT_DOWN.Enabled = True)
|
||||||
|
SetControlValueInvoke(ToolbarTOP, BTT_STOP, Sub() BTT_STOP.Enabled = False)
|
||||||
|
MyJob.Stopped()
|
||||||
End Sub
|
End Sub
|
||||||
|
#End Region
|
||||||
|
#Region "List handlers"
|
||||||
Private _LatestSelected As Integer = -1
|
Private _LatestSelected As Integer = -1
|
||||||
Private Sub LIST_VIDEOS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LIST_VIDEOS.SelectedIndexChanged
|
Private Sub LIST_VIDEOS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LIST_VIDEOS.SelectedIndexChanged
|
||||||
_LatestSelected = LIST_VIDEOS.SelectedIndex
|
_LatestSelected = LIST_VIDEOS.SelectedIndex
|
||||||
End Sub
|
End Sub
|
||||||
|
#End Region
|
||||||
|
#Region "Open path"
|
||||||
Private Sub BTT_OPEN_PATH_Click(sender As Object, e As EventArgs) Handles BTT_OPEN_PATH.Click
|
Private Sub BTT_OPEN_PATH_Click(sender As Object, e As EventArgs) Handles BTT_OPEN_PATH.Click
|
||||||
With Settings.LatestSavingPath
|
With Settings.LatestSavingPath
|
||||||
If Not .Value.IsEmptyString Then
|
If Not .Value.IsEmptyString Then
|
||||||
@@ -134,9 +158,10 @@ Namespace DownloadObjects
|
|||||||
MsgBoxE($"Path [{ .Value}] does not exists!", MsgBoxStyle.Exclamation)
|
MsgBoxE($"Path [{ .Value}] does not exists!", MsgBoxStyle.Exclamation)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
MsgBoxE("Saving path does not set!", MsgBoxStyle.Exclamation)
|
MsgBoxE("Save path not specified!", MsgBoxStyle.Exclamation)
|
||||||
End If
|
End If
|
||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
59
SCrawler/Editors/CollectionEditorForm.Designer.vb
generated
59
SCrawler/Editors/CollectionEditorForm.Designer.vb
generated
@@ -14,13 +14,14 @@
|
|||||||
Private components As System.ComponentModel.IContainer
|
Private components As System.ComponentModel.IContainer
|
||||||
<System.Diagnostics.DebuggerStepThrough()>
|
<System.Diagnostics.DebuggerStepThrough()>
|
||||||
Private Sub InitializeComponent()
|
Private Sub InitializeComponent()
|
||||||
Dim ActionButton1 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
|
||||||
|
Dim ActionButton3 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(CollectionEditorForm))
|
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(CollectionEditorForm))
|
||||||
Dim ActionButton2 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton4 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
|
||||||
Me.CMB_COLLECTIONS = New PersonalUtilities.Forms.Controls.ComboBoxExtended()
|
Me.CMB_COLLECTIONS = New PersonalUtilities.Forms.Controls.ComboBoxExtended()
|
||||||
Me.CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
||||||
Me.CONTAINER_MAIN.SuspendLayout()
|
CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
||||||
|
CONTAINER_MAIN.SuspendLayout()
|
||||||
CType(Me.CMB_COLLECTIONS, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.CMB_COLLECTIONS, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
@@ -29,28 +30,28 @@
|
|||||||
'
|
'
|
||||||
'CONTAINER_MAIN.ContentPanel
|
'CONTAINER_MAIN.ContentPanel
|
||||||
'
|
'
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Controls.Add(Me.CMB_COLLECTIONS)
|
CONTAINER_MAIN.ContentPanel.Controls.Add(Me.CMB_COLLECTIONS)
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Padding = New System.Windows.Forms.Padding(2, 0, 2, 0)
|
CONTAINER_MAIN.ContentPanel.Padding = New System.Windows.Forms.Padding(2, 0, 2, 0)
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(454, 251)
|
CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(454, 251)
|
||||||
Me.CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
|
CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.CONTAINER_MAIN.LeftToolStripPanelVisible = False
|
CONTAINER_MAIN.LeftToolStripPanelVisible = False
|
||||||
Me.CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
|
CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
|
||||||
Me.CONTAINER_MAIN.Name = "CONTAINER_MAIN"
|
CONTAINER_MAIN.Name = "CONTAINER_MAIN"
|
||||||
Me.CONTAINER_MAIN.RightToolStripPanelVisible = False
|
CONTAINER_MAIN.RightToolStripPanelVisible = False
|
||||||
Me.CONTAINER_MAIN.Size = New System.Drawing.Size(454, 251)
|
CONTAINER_MAIN.Size = New System.Drawing.Size(454, 251)
|
||||||
Me.CONTAINER_MAIN.TabIndex = 0
|
CONTAINER_MAIN.TabIndex = 0
|
||||||
Me.CONTAINER_MAIN.TopToolStripPanelVisible = False
|
CONTAINER_MAIN.TopToolStripPanelVisible = False
|
||||||
'
|
'
|
||||||
'CMB_COLLECTIONS
|
'CMB_COLLECTIONS
|
||||||
'
|
'
|
||||||
ActionButton1.BackgroundImage = CType(resources.GetObject("ActionButton1.BackgroundImage"), System.Drawing.Image)
|
ActionButton3.BackgroundImage = CType(resources.GetObject("ActionButton3.BackgroundImage"), System.Drawing.Image)
|
||||||
ActionButton1.Name = "Add"
|
ActionButton3.Name = "Add"
|
||||||
ActionButton1.ToolTipText = "Add new collection"
|
ActionButton3.ToolTipText = "Add new collection"
|
||||||
ActionButton2.BackgroundImage = CType(resources.GetObject("ActionButton2.BackgroundImage"), System.Drawing.Image)
|
ActionButton4.BackgroundImage = CType(resources.GetObject("ActionButton4.BackgroundImage"), System.Drawing.Image)
|
||||||
ActionButton2.Name = "ArrowDown"
|
ActionButton4.Name = "ArrowDown"
|
||||||
ActionButton2.Visible = False
|
ActionButton4.Visible = False
|
||||||
Me.CMB_COLLECTIONS.Buttons.Add(ActionButton1)
|
Me.CMB_COLLECTIONS.Buttons.Add(ActionButton3)
|
||||||
Me.CMB_COLLECTIONS.Buttons.Add(ActionButton2)
|
Me.CMB_COLLECTIONS.Buttons.Add(ActionButton4)
|
||||||
Me.CMB_COLLECTIONS.Dock = System.Windows.Forms.DockStyle.Fill
|
Me.CMB_COLLECTIONS.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.CMB_COLLECTIONS.ListDropDownStyle = PersonalUtilities.Forms.Controls.ComboBoxExtended.ListMode.Simple
|
Me.CMB_COLLECTIONS.ListDropDownStyle = PersonalUtilities.Forms.Controls.ComboBoxExtended.ListMode.Simple
|
||||||
Me.CMB_COLLECTIONS.Location = New System.Drawing.Point(2, 0)
|
Me.CMB_COLLECTIONS.Location = New System.Drawing.Point(2, 0)
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||||
Me.ClientSize = New System.Drawing.Size(454, 251)
|
Me.ClientSize = New System.Drawing.Size(454, 251)
|
||||||
Me.Controls.Add(Me.CONTAINER_MAIN)
|
Me.Controls.Add(CONTAINER_MAIN)
|
||||||
Me.KeyPreview = True
|
Me.KeyPreview = True
|
||||||
Me.MinimizeBox = False
|
Me.MinimizeBox = False
|
||||||
Me.MinimumSize = New System.Drawing.Size(470, 290)
|
Me.MinimumSize = New System.Drawing.Size(470, 290)
|
||||||
@@ -71,15 +72,13 @@
|
|||||||
Me.ShowIcon = False
|
Me.ShowIcon = False
|
||||||
Me.ShowInTaskbar = False
|
Me.ShowInTaskbar = False
|
||||||
Me.Text = "Collection"
|
Me.Text = "Collection"
|
||||||
Me.CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
|
CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
|
||||||
Me.CONTAINER_MAIN.ResumeLayout(False)
|
CONTAINER_MAIN.ResumeLayout(False)
|
||||||
Me.CONTAINER_MAIN.PerformLayout()
|
CONTAINER_MAIN.PerformLayout()
|
||||||
CType(Me.CMB_COLLECTIONS, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.CMB_COLLECTIONS, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
Me.ResumeLayout(False)
|
Me.ResumeLayout(False)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private WithEvents CONTAINER_MAIN As ToolStripContainer
|
|
||||||
Private WithEvents CMB_COLLECTIONS As PersonalUtilities.Forms.Controls.ComboBoxExtended
|
Private WithEvents CMB_COLLECTIONS As PersonalUtilities.Forms.Controls.ComboBoxExtended
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -117,8 +117,11 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</value>
|
||||||
|
</metadata>
|
||||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
<data name="ActionButton1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="ActionButton3.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsTAAALEwEAmpwYAAADmUlE
|
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsTAAALEwEAmpwYAAADmUlE
|
||||||
@@ -140,7 +143,7 @@
|
|||||||
0AUyNxOP1DOwcaG/8I+/LRB+At7psBnyDBG0AAAAAElFTkSuQmCC
|
0AUyNxOP1DOwcaG/8I+/LRB+At7psBnyDBG0AAAAAElFTkSuQmCC
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ActionButton2.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="ActionButton4.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAE65JREFUeF7t
|
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAE65JREFUeF7t
|
||||||
3X2sJWddB/DdLi2lQG2hdOHuvfM887J7Cxca4ELTQMDWKigIFpBAEAgi9g+CJpJo9Q8NJhgBiYZIYspL
|
3X2sJWddB/DdLi2lQG2hdOHuvfM887J7Cxca4ELTQMDWKigIFpBAEAgi9g+CJpJo9Q8NJhgBiYZIYspL
|
||||||
|
|||||||
@@ -8,15 +8,14 @@
|
|||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Controls.Base
|
Imports PersonalUtilities.Forms.Controls.Base
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
|
||||||
Namespace Editors
|
Namespace Editors
|
||||||
Friend Class CollectionEditorForm : Implements IOkCancelToolbar
|
Friend Class CollectionEditorForm
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Private ReadOnly Collections As List(Of String)
|
Private ReadOnly Collections As List(Of String)
|
||||||
Friend Property [Collection] As String = String.Empty
|
Friend Property [Collection] As String = String.Empty
|
||||||
Friend Sub New()
|
Friend Sub New()
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
Collections = New List(Of String)
|
Collections = New List(Of String)
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub New(ByVal CollectionName As String)
|
Friend Sub New(ByVal CollectionName As String)
|
||||||
@@ -26,7 +25,7 @@ Namespace Editors
|
|||||||
Private Sub CollectionEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub CollectionEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
Try
|
Try
|
||||||
With MyDefs
|
With MyDefs
|
||||||
.MyViewInitialize(Me, Settings.Design)
|
.MyViewInitialize()
|
||||||
.AddOkCancelToolbar()
|
.AddOkCancelToolbar()
|
||||||
Collections.ListAddList((From c In Settings.Users Where c.IsCollection Select c.CollectionName), LAP.NotContainsOnly, EDP.ThrowException)
|
Collections.ListAddList((From c In Settings.Users Where c.IsCollection Select c.CollectionName), LAP.NotContainsOnly, EDP.ThrowException)
|
||||||
If Collections.ListExists Then Collections.Sort() : CMB_COLLECTIONS.Items.AddRange(From c In Collections Select New ListItem(c))
|
If Collections.ListExists Then Collections.Sort() : CMB_COLLECTIONS.Items.AddRange(From c In Collections Select New ListItem(c))
|
||||||
@@ -44,7 +43,7 @@ Namespace Editors
|
|||||||
Private Sub CollectionEditorForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
Private Sub CollectionEditorForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
||||||
If e.KeyCode = Keys.Insert Then AddNewCollection() : e.Handled = True Else e.Handled = False
|
If e.KeyCode = Keys.Insert Then AddNewCollection() : e.Handled = True Else e.Handled = False
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDefs_ButtonOkClick() Handles MyDefs.ButtonOkClick
|
||||||
If CMB_COLLECTIONS.SelectedIndex >= 0 Then
|
If CMB_COLLECTIONS.SelectedIndex >= 0 Then
|
||||||
Collection = CMB_COLLECTIONS.Value.ToString
|
Collection = CMB_COLLECTIONS.Value.ToString
|
||||||
MyDefs.CloseForm()
|
MyDefs.CloseForm()
|
||||||
@@ -52,15 +51,12 @@ Namespace Editors
|
|||||||
MsgBoxE("Collection not selected", MsgBoxStyle.Exclamation)
|
MsgBoxE("Collection not selected", MsgBoxStyle.Exclamation)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
Private Sub CMB_COLLECTIONS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles CMB_COLLECTIONS.ActionOnButtonClick
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
Private Sub CMB_COLLECTIONS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles CMB_COLLECTIONS.ActionOnButtonClick
|
|
||||||
If Sender.DefaultButton = ActionButton.DefaultButtons.Add Then AddNewCollection()
|
If Sender.DefaultButton = ActionButton.DefaultButtons.Add Then AddNewCollection()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CMB_COLLECTIONS_ActionOnListDoubleClick(ByVal _Item As ListViewItem) Handles CMB_COLLECTIONS.ActionOnListDoubleClick
|
Private Sub CMB_COLLECTIONS_ActionOnListDoubleClick(ByVal _Item As ListViewItem) Handles CMB_COLLECTIONS.ActionOnListDoubleClick
|
||||||
_Item.Selected = True
|
_Item.Selected = True
|
||||||
OK()
|
MyDefs_ButtonOkClick()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub AddNewCollection()
|
Private Sub AddNewCollection()
|
||||||
Dim c$ = InputBoxE("Enter new collection name:", "Collection name")
|
Dim c$ = InputBoxE("Enter new collection name:", "Collection name")
|
||||||
|
|||||||
4
SCrawler/Editors/GlobalSettingsForm.Designer.vb
generated
4
SCrawler/Editors/GlobalSettingsForm.Designer.vb
generated
@@ -215,7 +215,7 @@
|
|||||||
Me.TXT_IMAGE_LARGE.Dock = System.Windows.Forms.DockStyle.Fill
|
Me.TXT_IMAGE_LARGE.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.TXT_IMAGE_LARGE.Location = New System.Drawing.Point(3, 3)
|
Me.TXT_IMAGE_LARGE.Location = New System.Drawing.Point(3, 3)
|
||||||
Me.TXT_IMAGE_LARGE.Name = "TXT_IMAGE_LARGE"
|
Me.TXT_IMAGE_LARGE.Name = "TXT_IMAGE_LARGE"
|
||||||
Me.TXT_IMAGE_LARGE.NumberMaximum = New Decimal(New Integer() {1000, 0, 0, 0})
|
Me.TXT_IMAGE_LARGE.NumberMaximum = New Decimal(New Integer() {256, 0, 0, 0})
|
||||||
Me.TXT_IMAGE_LARGE.NumberMinimum = New Decimal(New Integer() {50, 0, 0, 0})
|
Me.TXT_IMAGE_LARGE.NumberMinimum = New Decimal(New Integer() {50, 0, 0, 0})
|
||||||
Me.TXT_IMAGE_LARGE.Size = New System.Drawing.Size(278, 22)
|
Me.TXT_IMAGE_LARGE.Size = New System.Drawing.Size(278, 22)
|
||||||
Me.TXT_IMAGE_LARGE.TabIndex = 0
|
Me.TXT_IMAGE_LARGE.TabIndex = 0
|
||||||
@@ -231,7 +231,7 @@
|
|||||||
Me.TXT_IMAGE_SMALL.Dock = System.Windows.Forms.DockStyle.Fill
|
Me.TXT_IMAGE_SMALL.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.TXT_IMAGE_SMALL.Location = New System.Drawing.Point(287, 3)
|
Me.TXT_IMAGE_SMALL.Location = New System.Drawing.Point(287, 3)
|
||||||
Me.TXT_IMAGE_SMALL.Name = "TXT_IMAGE_SMALL"
|
Me.TXT_IMAGE_SMALL.Name = "TXT_IMAGE_SMALL"
|
||||||
Me.TXT_IMAGE_SMALL.NumberMaximum = New Decimal(New Integer() {500, 0, 0, 0})
|
Me.TXT_IMAGE_SMALL.NumberMaximum = New Decimal(New Integer() {256, 0, 0, 0})
|
||||||
Me.TXT_IMAGE_SMALL.NumberMinimum = New Decimal(New Integer() {10, 0, 0, 0})
|
Me.TXT_IMAGE_SMALL.NumberMinimum = New Decimal(New Integer() {10, 0, 0, 0})
|
||||||
Me.TXT_IMAGE_SMALL.Size = New System.Drawing.Size(278, 22)
|
Me.TXT_IMAGE_SMALL.Size = New System.Drawing.Size(278, 22)
|
||||||
Me.TXT_IMAGE_SMALL.TabIndex = 1
|
Me.TXT_IMAGE_SMALL.TabIndex = 1
|
||||||
|
|||||||
@@ -8,24 +8,23 @@
|
|||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Controls.Base
|
Imports PersonalUtilities.Forms.Controls.Base
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
|
||||||
Namespace Editors
|
Namespace Editors
|
||||||
Friend Class GlobalSettingsForm : Implements IOkCancelToolbar
|
Friend Class GlobalSettingsForm
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Friend Sub New()
|
Friend Sub New()
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub GlobalSettingsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub GlobalSettingsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
Try
|
Try
|
||||||
With MyDefs
|
With MyDefs
|
||||||
.MyViewInitialize(Me, Settings.Design, True)
|
.MyViewInitialize(True)
|
||||||
.AddOkCancelToolbar()
|
.AddOkCancelToolbar()
|
||||||
With Settings
|
With Settings
|
||||||
'Basis
|
'Basis
|
||||||
TXT_GLOBAL_PATH.Text = .GlobalPath.Value
|
TXT_GLOBAL_PATH.Text = .GlobalPath.Value
|
||||||
TXT_IMAGE_LARGE.Value = .MaxLargeImageHeigh.Value
|
TXT_IMAGE_LARGE.Value = .MaxLargeImageHeight.Value
|
||||||
TXT_IMAGE_SMALL.Value = .MaxSmallImageHeigh.Value
|
TXT_IMAGE_SMALL.Value = .MaxSmallImageHeight.Value
|
||||||
TXT_COLLECTIONS_PATH.Text = .CollectionsPath
|
TXT_COLLECTIONS_PATH.Text = .CollectionsPath
|
||||||
TXT_MAX_JOBS_USERS.Value = .MaxUsersJobsCount.Value
|
TXT_MAX_JOBS_USERS.Value = .MaxUsersJobsCount.Value
|
||||||
TXT_MAX_JOBS_CHANNELS.Value = .ChannelsMaxJobsCount.Value
|
TXT_MAX_JOBS_CHANNELS.Value = .ChannelsMaxJobsCount.Value
|
||||||
@@ -60,9 +59,9 @@ Namespace Editors
|
|||||||
TXT_DOWN_COMPLETE_SCRIPT.Text = .DownloadsCompleteCommand
|
TXT_DOWN_COMPLETE_SCRIPT.Text = .DownloadsCompleteCommand
|
||||||
TXT_DOWN_COMPLETE_SCRIPT.Checked = .DownloadsCompleteCommand.Attribute
|
TXT_DOWN_COMPLETE_SCRIPT.Checked = .DownloadsCompleteCommand.Attribute
|
||||||
'Downloading: file names
|
'Downloading: file names
|
||||||
CH_FILE_NAME_CHANGE.Checked = .FileReplaceNameByDate Or .FileAddDateToFileName Or .FileAddTimeToFileName
|
CH_FILE_NAME_CHANGE.Checked = Not .FileReplaceNameByDate.Value = FileNameReplaceMode.None
|
||||||
OPT_FILE_NAME_REPLACE.Checked = .FileReplaceNameByDate
|
OPT_FILE_NAME_REPLACE.Checked = .FileReplaceNameByDate.Value = FileNameReplaceMode.Replace
|
||||||
OPT_FILE_NAME_ADD_DATE.Checked = Not .FileReplaceNameByDate
|
OPT_FILE_NAME_ADD_DATE.Checked = .FileReplaceNameByDate.Value = FileNameReplaceMode.Add
|
||||||
CH_FILE_DATE.Checked = .FileAddDateToFileName
|
CH_FILE_DATE.Checked = .FileAddDateToFileName
|
||||||
CH_FILE_TIME.Checked = .FileAddTimeToFileName
|
CH_FILE_TIME.Checked = .FileAddTimeToFileName
|
||||||
OPT_FILE_DATE_START.Checked = Not .FileDateTimePositionEnd
|
OPT_FILE_DATE_START.Checked = Not .FileDateTimePositionEnd
|
||||||
@@ -78,19 +77,19 @@ Namespace Editors
|
|||||||
CH_CHANNELS_USERS_TEMP.Checked = .ChannelsDefaultTemporary
|
CH_CHANNELS_USERS_TEMP.Checked = .ChannelsDefaultTemporary
|
||||||
End With
|
End With
|
||||||
.MyFieldsChecker = New FieldsChecker
|
.MyFieldsChecker = New FieldsChecker
|
||||||
With DirectCast(.MyFieldsChecker, FieldsChecker)
|
With .MyFieldsCheckerE
|
||||||
.AddControl(Of String)(TXT_GLOBAL_PATH, TXT_GLOBAL_PATH.CaptionText)
|
.AddControl(Of String)(TXT_GLOBAL_PATH, TXT_GLOBAL_PATH.CaptionText)
|
||||||
.AddControl(Of String)(TXT_COLLECTIONS_PATH, TXT_COLLECTIONS_PATH.CaptionText)
|
.AddControl(Of String)(TXT_COLLECTIONS_PATH, TXT_COLLECTIONS_PATH.CaptionText)
|
||||||
.EndLoaderOperations()
|
.EndLoaderOperations()
|
||||||
End With
|
End With
|
||||||
.EndLoaderOperations()
|
|
||||||
ChangeFileNameChangersEnabling()
|
ChangeFileNameChangersEnabling()
|
||||||
|
.EndLoaderOperations()
|
||||||
End With
|
End With
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MyDefs.InvokeLoaderError(ex)
|
MyDefs.InvokeLoaderError(ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDefs_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonOkClick
|
||||||
If MyDefs.MyFieldsChecker.AllParamsOK Then
|
If MyDefs.MyFieldsChecker.AllParamsOK Then
|
||||||
With Settings
|
With Settings
|
||||||
Dim a As Func(Of String, Object, Integer) =
|
Dim a As Func(Of String, Object, Integer) =
|
||||||
@@ -124,8 +123,8 @@ Namespace Editors
|
|||||||
|
|
||||||
'Basis
|
'Basis
|
||||||
.GlobalPath.Value = TXT_GLOBAL_PATH.Text
|
.GlobalPath.Value = TXT_GLOBAL_PATH.Text
|
||||||
.MaxLargeImageHeigh.Value = CInt(TXT_IMAGE_LARGE.Value)
|
.MaxLargeImageHeight.Value = CInt(TXT_IMAGE_LARGE.Value)
|
||||||
.MaxSmallImageHeigh.Value = CInt(TXT_IMAGE_SMALL.Value)
|
.MaxSmallImageHeight.Value = CInt(TXT_IMAGE_SMALL.Value)
|
||||||
.CollectionsPath.Value = TXT_COLLECTIONS_PATH.Text
|
.CollectionsPath.Value = TXT_COLLECTIONS_PATH.Text
|
||||||
.MaxUsersJobsCount.Value = CInt(TXT_MAX_JOBS_USERS.Value)
|
.MaxUsersJobsCount.Value = CInt(TXT_MAX_JOBS_USERS.Value)
|
||||||
.ChannelsMaxJobsCount.Value = TXT_MAX_JOBS_CHANNELS.Value
|
.ChannelsMaxJobsCount.Value = TXT_MAX_JOBS_CHANNELS.Value
|
||||||
@@ -161,14 +160,14 @@ Namespace Editors
|
|||||||
.DownloadsCompleteCommand.Attribute.Value = TXT_DOWN_COMPLETE_SCRIPT.Checked
|
.DownloadsCompleteCommand.Attribute.Value = TXT_DOWN_COMPLETE_SCRIPT.Checked
|
||||||
'Downloading: file names
|
'Downloading: file names
|
||||||
If CH_FILE_NAME_CHANGE.Checked Then
|
If CH_FILE_NAME_CHANGE.Checked Then
|
||||||
.FileReplaceNameByDate.Value = OPT_FILE_NAME_REPLACE.Checked
|
.FileReplaceNameByDate.Value = If(OPT_FILE_NAME_REPLACE.Checked, FileNameReplaceMode.Replace, FileNameReplaceMode.Add)
|
||||||
.FileAddDateToFileName.Value = CH_FILE_DATE.Checked
|
.FileAddDateToFileName.Value = CH_FILE_DATE.Checked
|
||||||
.FileAddTimeToFileName.Value = CH_FILE_TIME.Checked
|
.FileAddTimeToFileName.Value = CH_FILE_TIME.Checked
|
||||||
.FileDateTimePositionEnd.Value = OPT_FILE_DATE_END.Checked
|
.FileDateTimePositionEnd.Value = OPT_FILE_DATE_END.Checked
|
||||||
Else
|
Else
|
||||||
.FileAddDateToFileName.Value = False
|
.FileAddDateToFileName.Value = False
|
||||||
.FileAddTimeToFileName.Value = False
|
.FileAddTimeToFileName.Value = False
|
||||||
.FileReplaceNameByDate.Value = False
|
.FileReplaceNameByDate.Value = FileNameReplaceMode.None
|
||||||
End If
|
End If
|
||||||
'Channels
|
'Channels
|
||||||
.ChannelsImagesRows.Value = CInt(TXT_CHANNELS_ROWS.Value)
|
.ChannelsImagesRows.Value = CInt(TXT_CHANNELS_ROWS.Value)
|
||||||
@@ -184,19 +183,16 @@ Namespace Editors
|
|||||||
MyDefs.CloseForm()
|
MyDefs.CloseForm()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
Private Sub TXT_GLOBAL_PATH_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_GLOBAL_PATH.ActionOnButtonClick
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
Private Sub TXT_GLOBAL_PATH_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_GLOBAL_PATH.ActionOnButtonClick
|
|
||||||
If Sender.DefaultButton = ActionButton.DefaultButtons.Open Then
|
If Sender.DefaultButton = ActionButton.DefaultButtons.Open Then
|
||||||
Dim f As SFile = SFile.SelectPath(Settings.GlobalPath.Value)
|
Dim f As SFile = SFile.SelectPath(Settings.GlobalPath.Value)
|
||||||
If Not f.IsEmptyString Then TXT_GLOBAL_PATH.Text = f
|
If Not f.IsEmptyString Then TXT_GLOBAL_PATH.Text = f
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub TXT_MAX_JOBS_USERS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_MAX_JOBS_USERS.ActionOnButtonClick
|
Private Sub TXT_MAX_JOBS_USERS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_MAX_JOBS_USERS.ActionOnButtonClick
|
||||||
If Sender.DefaultButton = ActionButton.DefaultButtons.Refresh Then TXT_MAX_JOBS_USERS.Value = SettingsCLS.DefaultMaxDownloadingTasks
|
If Sender.DefaultButton = ActionButton.DefaultButtons.Refresh Then TXT_MAX_JOBS_USERS.Value = SettingsCLS.DefaultMaxDownloadingTasks
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub TXT_MAX_JOBS_CHANNELS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_MAX_JOBS_CHANNELS.ActionOnButtonClick
|
Private Sub TXT_MAX_JOBS_CHANNELS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_MAX_JOBS_CHANNELS.ActionOnButtonClick
|
||||||
If Sender.DefaultButton = ActionButton.DefaultButtons.Refresh Then TXT_MAX_JOBS_CHANNELS.Value = SettingsCLS.DefaultMaxDownloadingTasks
|
If Sender.DefaultButton = ActionButton.DefaultButtons.Refresh Then TXT_MAX_JOBS_CHANNELS.Value = SettingsCLS.DefaultMaxDownloadingTasks
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CH_FILE_NAME_CHANGE_CheckedChanged(sender As Object, e As EventArgs) Handles CH_FILE_NAME_CHANGE.CheckedChanged
|
Private Sub CH_FILE_NAME_CHANGE_CheckedChanged(sender As Object, e As EventArgs) Handles CH_FILE_NAME_CHANGE.CheckedChanged
|
||||||
@@ -217,11 +213,12 @@ Namespace Editors
|
|||||||
Dim b As Boolean = CH_FILE_NAME_CHANGE.Checked
|
Dim b As Boolean = CH_FILE_NAME_CHANGE.Checked
|
||||||
OPT_FILE_NAME_REPLACE.Enabled = b
|
OPT_FILE_NAME_REPLACE.Enabled = b
|
||||||
OPT_FILE_NAME_ADD_DATE.Enabled = b
|
OPT_FILE_NAME_ADD_DATE.Enabled = b
|
||||||
|
If Not OPT_FILE_NAME_REPLACE.Checked And Not OPT_FILE_NAME_ADD_DATE.Checked Then OPT_FILE_NAME_REPLACE.Checked = True
|
||||||
CH_FILE_DATE.Enabled = b
|
CH_FILE_DATE.Enabled = b
|
||||||
CH_FILE_TIME.Enabled = b
|
CH_FILE_TIME.Enabled = b
|
||||||
ChangePositionControlsEnabling()
|
ChangePositionControlsEnabling()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub TXT_SCRIPT_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_SCRIPT.ActionOnButtonClick
|
Private Sub TXT_SCRIPT_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_SCRIPT.ActionOnButtonClick
|
||||||
SettingsCLS.ScriptTextBoxButtonClick(TXT_SCRIPT, Sender)
|
SettingsCLS.ScriptTextBoxButtonClick(TXT_SCRIPT, Sender)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CH_COPY_CHANNEL_USER_IMAGE_CheckedChanged(sender As Object, e As EventArgs) Handles CH_COPY_CHANNEL_USER_IMAGE.CheckedChanged
|
Private Sub CH_COPY_CHANNEL_USER_IMAGE_CheckedChanged(sender As Object, e As EventArgs) Handles CH_COPY_CHANNEL_USER_IMAGE.CheckedChanged
|
||||||
|
|||||||
37
SCrawler/Editors/LabelsForm.Designer.vb
generated
37
SCrawler/Editors/LabelsForm.Designer.vb
generated
@@ -13,14 +13,15 @@ Partial Friend Class LabelsForm : Inherits System.Windows.Forms.Form
|
|||||||
Private components As System.ComponentModel.IContainer
|
Private components As System.ComponentModel.IContainer
|
||||||
<System.Diagnostics.DebuggerStepThrough()>
|
<System.Diagnostics.DebuggerStepThrough()>
|
||||||
Private Sub InitializeComponent()
|
Private Sub InitializeComponent()
|
||||||
|
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
|
||||||
Dim ActionButton1 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton1 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(LabelsForm))
|
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(LabelsForm))
|
||||||
Dim ActionButton2 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton2 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
Dim ActionButton3 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton3 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
|
||||||
Me.CMB_LABELS = New PersonalUtilities.Forms.Controls.ComboBoxExtended()
|
Me.CMB_LABELS = New PersonalUtilities.Forms.Controls.ComboBoxExtended()
|
||||||
Me.CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
||||||
Me.CONTAINER_MAIN.SuspendLayout()
|
CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
||||||
|
CONTAINER_MAIN.SuspendLayout()
|
||||||
CType(Me.CMB_LABELS, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.CMB_LABELS, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
@@ -29,16 +30,16 @@ Partial Friend Class LabelsForm : Inherits System.Windows.Forms.Form
|
|||||||
'
|
'
|
||||||
'CONTAINER_MAIN.ContentPanel
|
'CONTAINER_MAIN.ContentPanel
|
||||||
'
|
'
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Controls.Add(Me.CMB_LABELS)
|
CONTAINER_MAIN.ContentPanel.Controls.Add(Me.CMB_LABELS)
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(374, 421)
|
CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(374, 421)
|
||||||
Me.CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
|
CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.CONTAINER_MAIN.LeftToolStripPanelVisible = False
|
CONTAINER_MAIN.LeftToolStripPanelVisible = False
|
||||||
Me.CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
|
CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
|
||||||
Me.CONTAINER_MAIN.Name = "CONTAINER_MAIN"
|
CONTAINER_MAIN.Name = "CONTAINER_MAIN"
|
||||||
Me.CONTAINER_MAIN.RightToolStripPanelVisible = False
|
CONTAINER_MAIN.RightToolStripPanelVisible = False
|
||||||
Me.CONTAINER_MAIN.Size = New System.Drawing.Size(374, 421)
|
CONTAINER_MAIN.Size = New System.Drawing.Size(374, 421)
|
||||||
Me.CONTAINER_MAIN.TabIndex = 0
|
CONTAINER_MAIN.TabIndex = 0
|
||||||
Me.CONTAINER_MAIN.TopToolStripPanelVisible = False
|
CONTAINER_MAIN.TopToolStripPanelVisible = False
|
||||||
'
|
'
|
||||||
'CMB_LABELS
|
'CMB_LABELS
|
||||||
'
|
'
|
||||||
@@ -69,7 +70,7 @@ Partial Friend Class LabelsForm : Inherits System.Windows.Forms.Form
|
|||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||||
Me.ClientSize = New System.Drawing.Size(374, 421)
|
Me.ClientSize = New System.Drawing.Size(374, 421)
|
||||||
Me.Controls.Add(Me.CONTAINER_MAIN)
|
Me.Controls.Add(CONTAINER_MAIN)
|
||||||
Me.KeyPreview = True
|
Me.KeyPreview = True
|
||||||
Me.MinimizeBox = False
|
Me.MinimizeBox = False
|
||||||
Me.MinimumSize = New System.Drawing.Size(390, 460)
|
Me.MinimumSize = New System.Drawing.Size(390, 460)
|
||||||
@@ -77,14 +78,12 @@ Partial Friend Class LabelsForm : Inherits System.Windows.Forms.Form
|
|||||||
Me.ShowIcon = False
|
Me.ShowIcon = False
|
||||||
Me.ShowInTaskbar = False
|
Me.ShowInTaskbar = False
|
||||||
Me.Text = "Labels"
|
Me.Text = "Labels"
|
||||||
Me.CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
|
CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
|
||||||
Me.CONTAINER_MAIN.ResumeLayout(False)
|
CONTAINER_MAIN.ResumeLayout(False)
|
||||||
Me.CONTAINER_MAIN.PerformLayout()
|
CONTAINER_MAIN.PerformLayout()
|
||||||
CType(Me.CMB_LABELS, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.CMB_LABELS, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
Me.ResumeLayout(False)
|
Me.ResumeLayout(False)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private WithEvents CONTAINER_MAIN As ToolStripContainer
|
|
||||||
Private WithEvents CMB_LABELS As PersonalUtilities.Forms.Controls.ComboBoxExtended
|
Private WithEvents CMB_LABELS As PersonalUtilities.Forms.Controls.ComboBoxExtended
|
||||||
End Class
|
End Class
|
||||||
@@ -117,6 +117,9 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</value>
|
||||||
|
</metadata>
|
||||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
<data name="ActionButton1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="ActionButton1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
|
|||||||
@@ -7,12 +7,11 @@
|
|||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
|
||||||
Imports PersonalUtilities.Forms.Controls
|
Imports PersonalUtilities.Forms.Controls
|
||||||
Imports PersonalUtilities.Forms.Controls.Base
|
Imports PersonalUtilities.Forms.Controls.Base
|
||||||
Imports PersonalUtilities.Functions.Messaging
|
Imports PersonalUtilities.Functions.Messaging
|
||||||
Friend Class LabelsForm : Implements IOkCancelDeleteToolbar
|
Friend Class LabelsForm
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Friend ReadOnly Property LabelsList As List(Of String)
|
Friend ReadOnly Property LabelsList As List(Of String)
|
||||||
Private ReadOnly _Source As IEnumerable(Of String) = Nothing
|
Private ReadOnly _Source As IEnumerable(Of String) = Nothing
|
||||||
Private ReadOnly Property Source As IEnumerable(Of String)
|
Private ReadOnly Property Source As IEnumerable(Of String)
|
||||||
@@ -32,7 +31,7 @@ Friend Class LabelsForm : Implements IOkCancelDeleteToolbar
|
|||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
LabelsList = New List(Of String)
|
LabelsList = New List(Of String)
|
||||||
LabelsList.ListAddList(LabelsArr)
|
LabelsList.ListAddList(LabelsArr)
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub New(ByVal Current As IEnumerable(Of String), ByVal Source As IEnumerable(Of String))
|
Friend Sub New(ByVal Current As IEnumerable(Of String), ByVal Source As IEnumerable(Of String))
|
||||||
Me.New(Current)
|
Me.New(Current)
|
||||||
@@ -41,8 +40,9 @@ Friend Class LabelsForm : Implements IOkCancelDeleteToolbar
|
|||||||
Private Sub LabelsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub LabelsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
Try
|
Try
|
||||||
With MyDefs
|
With MyDefs
|
||||||
.MyViewInitialize(Me, Settings.Design)
|
.MyViewInitialize()
|
||||||
.AddOkCancelToolbar(, WithDeleteButton)
|
.AddOkCancelToolbar()
|
||||||
|
.MyOkCancel.BTT_DELETE.Visible = WithDeleteButton
|
||||||
If Source.Count > 0 Then
|
If Source.Count > 0 Then
|
||||||
Dim items As New List(Of Integer)
|
Dim items As New List(Of Integer)
|
||||||
CMB_LABELS.BeginUpdate()
|
CMB_LABELS.BeginUpdate()
|
||||||
@@ -66,7 +66,7 @@ Friend Class LabelsForm : Implements IOkCancelDeleteToolbar
|
|||||||
Private Sub LabelsForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
Private Sub LabelsForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
||||||
LabelsList.Clear()
|
LabelsList.Clear()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDefs_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonOkClick
|
||||||
Try
|
Try
|
||||||
If MultiUser Then
|
If MultiUser Then
|
||||||
Dim m As New MMessage("You are changing labels for more one user" & vbNewLine & "What do you want to do?",
|
Dim m As New MMessage("You are changing labels for more one user" & vbNewLine & "What do you want to do?",
|
||||||
@@ -88,18 +88,15 @@ Friend Class LabelsForm : Implements IOkCancelDeleteToolbar
|
|||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Choosing labels")
|
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Choosing labels")
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
Private Sub MyDefs_ButtonDeleteClickOC(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonDeleteClickOC
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
Private Sub Delete() Implements IOkCancelDeleteToolbar.Delete
|
|
||||||
LabelsList.Clear()
|
LabelsList.Clear()
|
||||||
MyDefs.CloseForm()
|
MyDefs.CloseForm()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CMB_LABELS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles CMB_LABELS.ActionOnButtonClick
|
Private Sub CMB_LABELS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles CMB_LABELS.ActionOnButtonClick
|
||||||
If Sender.DefaultButton = ActionButton.DefaultButtons.Add Then AddNewLabel()
|
Select Case Sender.DefaultButton
|
||||||
End Sub
|
Case ActionButton.DefaultButtons.Add : AddNewLabel()
|
||||||
Private Sub CMB_LABELS_ActionOnButtonClearClick() Handles CMB_LABELS.ActionOnButtonClearClick
|
Case ActionButton.DefaultButtons.Clear : CMB_LABELS.Clear(ComboBoxExtended.ClearMode.CheckedIndexes)
|
||||||
CMB_LABELS.Clear(ComboBoxExtended.ClearMode.CheckedIndexes)
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub AddNewLabel()
|
Private Sub AddNewLabel()
|
||||||
Dim nl$ = InputBoxE("Enter new label name:", "New label")
|
Dim nl$ = InputBoxE("Enter new label name:", "New label")
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ Namespace Editors
|
|||||||
Private Sub InitCheckBox(ByRef CH As CheckBox, ByVal Caption As String)
|
Private Sub InitCheckBox(ByRef CH As CheckBox, ByVal Caption As String)
|
||||||
CH = New CheckBox With {.Text = Caption, .Dock = DockStyle.Fill, .UseVisualStyleBackColor = True,
|
CH = New CheckBox With {.Text = Caption, .Dock = DockStyle.Fill, .UseVisualStyleBackColor = True,
|
||||||
.ThreeState = True, .CheckState = CheckState.Indeterminate}
|
.ThreeState = True, .CheckState = CheckState.Indeterminate}
|
||||||
AddHandler CH.CheckedChanged, AddressOf Checker_CheckedChanged
|
|
||||||
AddHandler CH.CheckStateChanged, AddressOf Checker_CheckedChanged
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub SiteDefaults_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
Private Sub SiteDefaults_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
||||||
CH_TEMP.Dispose()
|
CH_TEMP.Dispose()
|
||||||
@@ -64,11 +62,6 @@ Namespace Editors
|
|||||||
Private Function ShouldSerializeBaseControlsPadding() As Boolean
|
Private Function ShouldSerializeBaseControlsPadding() As Boolean
|
||||||
Return Not _BaseControlsPadding.Equals(New Padding(0))
|
Return Not _BaseControlsPadding.Equals(New Padding(0))
|
||||||
End Function
|
End Function
|
||||||
<Browsable(False), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)>
|
|
||||||
Public Property ChangesDetected As Boolean = False
|
|
||||||
Private Sub Checker_CheckedChanged(sender As Object, e As EventArgs)
|
|
||||||
ChangesDetected = True
|
|
||||||
End Sub
|
|
||||||
<Browsable(True), EditorBrowsable(EditorBrowsableState.Always), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
|
<Browsable(True), EditorBrowsable(EditorBrowsableState.Always), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
|
||||||
Category("Values"), DefaultValue(CheckState.Indeterminate), DisplayName("Temporary"), Description("Temporary profile")>
|
Category("Values"), DefaultValue(CheckState.Indeterminate), DisplayName("Temporary"), Description("Temporary profile")>
|
||||||
Public Property MyTemporary As CheckState
|
Public Property MyTemporary As CheckState
|
||||||
|
|||||||
37
SCrawler/Editors/SiteEditorForm.Designer.vb
generated
37
SCrawler/Editors/SiteEditorForm.Designer.vb
generated
@@ -22,20 +22,21 @@
|
|||||||
Dim ActionButton4 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton4 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
Dim ActionButton5 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton5 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
Dim ActionButton6 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton6 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
|
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
|
||||||
Me.TP_MAIN = New System.Windows.Forms.TableLayoutPanel()
|
Me.TP_MAIN = New System.Windows.Forms.TableLayoutPanel()
|
||||||
Me.TXT_PATH = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.TXT_PATH = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
Me.TXT_COOKIES = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.TXT_COOKIES = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
Me.TP_SITE_PROPS = New SCrawler.Editors.SiteDefaults()
|
Me.TP_SITE_PROPS = New SCrawler.Editors.SiteDefaults()
|
||||||
Me.TXT_PATH_SAVED_POSTS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.TXT_PATH_SAVED_POSTS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
Me.CH_GET_USER_MEDIA_ONLY = New System.Windows.Forms.CheckBox()
|
Me.CH_GET_USER_MEDIA_ONLY = New System.Windows.Forms.CheckBox()
|
||||||
Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
|
||||||
Me.TT_MAIN = New System.Windows.Forms.ToolTip(Me.components)
|
Me.TT_MAIN = New System.Windows.Forms.ToolTip(Me.components)
|
||||||
|
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
||||||
Me.TP_MAIN.SuspendLayout()
|
Me.TP_MAIN.SuspendLayout()
|
||||||
CType(Me.TXT_PATH, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.TXT_PATH, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(Me.TXT_COOKIES, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.TXT_COOKIES, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(Me.TXT_PATH_SAVED_POSTS, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.TXT_PATH_SAVED_POSTS, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
||||||
Me.CONTAINER_MAIN.SuspendLayout()
|
CONTAINER_MAIN.SuspendLayout()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
'TP_MAIN
|
'TP_MAIN
|
||||||
@@ -142,23 +143,23 @@
|
|||||||
'
|
'
|
||||||
'CONTAINER_MAIN.ContentPanel
|
'CONTAINER_MAIN.ContentPanel
|
||||||
'
|
'
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Controls.Add(Me.TP_MAIN)
|
CONTAINER_MAIN.ContentPanel.Controls.Add(Me.TP_MAIN)
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(544, 219)
|
CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(544, 219)
|
||||||
Me.CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
|
CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.CONTAINER_MAIN.LeftToolStripPanelVisible = False
|
CONTAINER_MAIN.LeftToolStripPanelVisible = False
|
||||||
Me.CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
|
CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
|
||||||
Me.CONTAINER_MAIN.Name = "CONTAINER_MAIN"
|
CONTAINER_MAIN.Name = "CONTAINER_MAIN"
|
||||||
Me.CONTAINER_MAIN.RightToolStripPanelVisible = False
|
CONTAINER_MAIN.RightToolStripPanelVisible = False
|
||||||
Me.CONTAINER_MAIN.Size = New System.Drawing.Size(544, 219)
|
CONTAINER_MAIN.Size = New System.Drawing.Size(544, 219)
|
||||||
Me.CONTAINER_MAIN.TabIndex = 0
|
CONTAINER_MAIN.TabIndex = 0
|
||||||
Me.CONTAINER_MAIN.TopToolStripPanelVisible = False
|
CONTAINER_MAIN.TopToolStripPanelVisible = False
|
||||||
'
|
'
|
||||||
'SiteEditorForm
|
'SiteEditorForm
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||||
Me.ClientSize = New System.Drawing.Size(544, 219)
|
Me.ClientSize = New System.Drawing.Size(544, 219)
|
||||||
Me.Controls.Add(Me.CONTAINER_MAIN)
|
Me.Controls.Add(CONTAINER_MAIN)
|
||||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
|
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
|
||||||
Me.KeyPreview = True
|
Me.KeyPreview = True
|
||||||
Me.MaximizeBox = False
|
Me.MaximizeBox = False
|
||||||
@@ -174,14 +175,12 @@
|
|||||||
CType(Me.TXT_PATH, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.TXT_PATH, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
CType(Me.TXT_COOKIES, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.TXT_COOKIES, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
CType(Me.TXT_PATH_SAVED_POSTS, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.TXT_PATH_SAVED_POSTS, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
Me.CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
|
CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
|
||||||
Me.CONTAINER_MAIN.ResumeLayout(False)
|
CONTAINER_MAIN.ResumeLayout(False)
|
||||||
Me.CONTAINER_MAIN.PerformLayout()
|
CONTAINER_MAIN.PerformLayout()
|
||||||
Me.ResumeLayout(False)
|
Me.ResumeLayout(False)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private WithEvents CONTAINER_MAIN As ToolStripContainer
|
|
||||||
Private WithEvents TXT_PATH As PersonalUtilities.Forms.Controls.TextBoxExtended
|
Private WithEvents TXT_PATH As PersonalUtilities.Forms.Controls.TextBoxExtended
|
||||||
Private WithEvents TXT_COOKIES As PersonalUtilities.Forms.Controls.TextBoxExtended
|
Private WithEvents TXT_COOKIES As PersonalUtilities.Forms.Controls.TextBoxExtended
|
||||||
Private WithEvents TP_MAIN As TableLayoutPanel
|
Private WithEvents TP_MAIN As TableLayoutPanel
|
||||||
|
|||||||
@@ -222,6 +222,9 @@
|
|||||||
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
|
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
|
<metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</value>
|
||||||
|
</metadata>
|
||||||
<metadata name="TT_MAIN.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="TT_MAIN.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|||||||
@@ -9,16 +9,15 @@
|
|||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Controls
|
Imports PersonalUtilities.Forms.Controls
|
||||||
Imports PersonalUtilities.Forms.Controls.Base
|
Imports PersonalUtilities.Forms.Controls.Base
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
|
||||||
Imports PersonalUtilities.Tools.WEB
|
Imports PersonalUtilities.Tools.WEB
|
||||||
Imports CookieControl = PersonalUtilities.Tools.WEB.CookieListForm.CookieControl
|
Imports CookieControl = PersonalUtilities.Tools.WEB.CookieListForm.CookieControl
|
||||||
Imports SCrawler.Plugin
|
Imports SCrawler.Plugin
|
||||||
Imports SCrawler.Plugin.Hosts
|
Imports SCrawler.Plugin.Hosts
|
||||||
Namespace Editors
|
Namespace Editors
|
||||||
Friend Class SiteEditorForm : Implements IOkCancelToolbar
|
Friend Class SiteEditorForm
|
||||||
Private ReadOnly LBL_AUTH As Label
|
Private ReadOnly LBL_AUTH As Label
|
||||||
Private ReadOnly LBL_OTHER As Label
|
Private ReadOnly LBL_OTHER As Label
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Private WithEvents SpecialButton As Button
|
Private WithEvents SpecialButton As Button
|
||||||
#Region "Providers"
|
#Region "Providers"
|
||||||
Private Class SavedPostsChecker : Implements IFieldsCheckerProvider
|
Private Class SavedPostsChecker : Implements IFieldsCheckerProvider
|
||||||
@@ -35,14 +34,14 @@ Namespace Editors
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
|
Private Function GetFormat(ByVal FormatType As Type) As Object Implements IFormatProvider.GetFormat
|
||||||
Throw New NotImplementedException()
|
Throw New NotImplementedException("[GetFormat] is not available in the context of [SavedPostsChecker]")
|
||||||
End Function
|
End Function
|
||||||
End Class
|
End Class
|
||||||
#End Region
|
#End Region
|
||||||
Private ReadOnly Property Host As SettingsHost
|
Private ReadOnly Property Host As SettingsHost
|
||||||
Friend Sub New(ByVal h As SettingsHost)
|
Friend Sub New(ByVal h As SettingsHost)
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
Host = h
|
Host = h
|
||||||
LBL_AUTH = New Label With {.Text = "Authorization", .TextAlign = ContentAlignment.MiddleCenter, .Dock = DockStyle.Fill}
|
LBL_AUTH = New Label With {.Text = "Authorization", .TextAlign = ContentAlignment.MiddleCenter, .Dock = DockStyle.Fill}
|
||||||
LBL_OTHER = New Label With {.Text = "Other Parameters", .TextAlign = ContentAlignment.MiddleCenter, .Dock = DockStyle.Fill}
|
LBL_OTHER = New Label With {.Text = "Other Parameters", .TextAlign = ContentAlignment.MiddleCenter, .Dock = DockStyle.Fill}
|
||||||
@@ -50,7 +49,7 @@ Namespace Editors
|
|||||||
Private Sub SiteEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub SiteEditorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
Try
|
Try
|
||||||
With MyDefs
|
With MyDefs
|
||||||
.MyViewInitialize(Me, Settings.Design, True)
|
.MyViewInitialize(True)
|
||||||
.AddOkCancelToolbar()
|
.AddOkCancelToolbar()
|
||||||
|
|
||||||
.MyFieldsChecker = New FieldsChecker
|
.MyFieldsChecker = New FieldsChecker
|
||||||
@@ -68,7 +67,7 @@ Namespace Editors
|
|||||||
|
|
||||||
SiteDefaultsFunctions.SetChecker(TP_SITE_PROPS, Host)
|
SiteDefaultsFunctions.SetChecker(TP_SITE_PROPS, Host)
|
||||||
|
|
||||||
With DirectCast(MyDefs.MyFieldsChecker, FieldsChecker)
|
With MyDefs.MyFieldsCheckerE
|
||||||
.AddControl(Of String)(TXT_PATH, TXT_PATH.CaptionText, True, New SavedPostsChecker)
|
.AddControl(Of String)(TXT_PATH, TXT_PATH.CaptionText, True, New SavedPostsChecker)
|
||||||
.AddControl(Of String)(TXT_PATH_SAVED_POSTS, TXT_PATH_SAVED_POSTS.CaptionText, True, New SavedPostsChecker)
|
.AddControl(Of String)(TXT_PATH_SAVED_POSTS, TXT_PATH_SAVED_POSTS.CaptionText, True, New SavedPostsChecker)
|
||||||
End With
|
End With
|
||||||
@@ -115,10 +114,9 @@ Namespace Editors
|
|||||||
.CreateControl(TT_MAIN)
|
.CreateControl(TT_MAIN)
|
||||||
AddTpControl(.Control, .ControlHeight)
|
AddTpControl(.Control, .ControlHeight)
|
||||||
If .LeftOffset > offset Then offset = .LeftOffset
|
If .LeftOffset > offset Then offset = .LeftOffset
|
||||||
If Not .Options.AllowNull Or Not .ProviderFieldsChecker Is Nothing Then
|
If Not .Options.AllowNull Or Not .ProviderFieldsChecker Is Nothing Then _
|
||||||
DirectCast(MyDefs.MyFieldsChecker, FieldsChecker).
|
MyDefs.MyFieldsCheckerE.AddControl(.Control, .Options.ControlText, .Type,
|
||||||
AddControl(.Control, .Options.ControlText, .Type, .Options.AllowNull, .ProviderFieldsChecker)
|
.Options.AllowNull, .ProviderFieldsChecker)
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
End With
|
End With
|
||||||
End If
|
End If
|
||||||
@@ -155,7 +153,7 @@ Namespace Editors
|
|||||||
LBL_AUTH.Dispose()
|
LBL_AUTH.Dispose()
|
||||||
LBL_OTHER.Dispose()
|
LBL_OTHER.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDefs_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonOkClick
|
||||||
If MyDefs.MyFieldsChecker.AllParamsOK Then
|
If MyDefs.MyFieldsChecker.AllParamsOK Then
|
||||||
Dim i%, ii%
|
Dim i%, ii%
|
||||||
With Host
|
With Host
|
||||||
@@ -198,13 +196,10 @@ Namespace Editors
|
|||||||
MyDefs.CloseForm()
|
MyDefs.CloseForm()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
Private Sub TXT_PATH_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_PATH.ActionOnButtonClick
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
Private Sub TXT_PATH_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_PATH.ActionOnButtonClick
|
|
||||||
ChangePath(Sender, Host.Path(False), TXT_PATH)
|
ChangePath(Sender, Host.Path(False), TXT_PATH)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub TXT_PATH_SAVED_POSTS_ActionOnButtonClick(Sender As ActionButton) Handles TXT_PATH_SAVED_POSTS.ActionOnButtonClick
|
Private Sub TXT_PATH_SAVED_POSTS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_PATH_SAVED_POSTS.ActionOnButtonClick
|
||||||
ChangePath(Sender, Host.SavedPostsPath(False), TXT_PATH_SAVED_POSTS)
|
ChangePath(Sender, Host.SavedPostsPath(False), TXT_PATH_SAVED_POSTS)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub ChangePath(ByVal Sender As ActionButton, ByVal PathValue As SFile, ByRef CNT As TextBoxExtended)
|
Private Sub ChangePath(ByVal Sender As ActionButton, ByVal PathValue As SFile, ByRef CNT As TextBoxExtended)
|
||||||
@@ -213,27 +208,27 @@ Namespace Editors
|
|||||||
If Not f.IsEmptyString Then CNT.Text = f
|
If Not f.IsEmptyString Then CNT.Text = f
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub TXT_COOKIES_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_COOKIES.ActionOnButtonClick
|
Private Sub TXT_COOKIES_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_COOKIES.ActionOnButtonClick
|
||||||
If Sender.DefaultButton = ActionButton.DefaultButtons.Edit Then
|
Select Case Sender.DefaultButton
|
||||||
If Not Host.Responser Is Nothing Then
|
Case ActionButton.DefaultButtons.Edit
|
||||||
Using f As New CookieListForm(Host.Responser) With {
|
If Not Host.Responser Is Nothing Then
|
||||||
.MyDesignXML = Settings.Design,
|
Using f As New CookieListForm(Host.Responser) With {
|
||||||
.DisableControls = CookieControl.AddFromInternal + CookieControl.AuthorizeProgram + CookieControl.OpenBrowser
|
.MyDesignXML = Settings.Design,
|
||||||
}
|
.DisableControls = CookieControl.AddFromInternal + CookieControl.AuthorizeProgram + CookieControl.OpenBrowser
|
||||||
f.ShowDialog()
|
}
|
||||||
End Using
|
f.ShowDialog()
|
||||||
SetCookieText()
|
End Using
|
||||||
End If
|
SetCookieText()
|
||||||
End If
|
End If
|
||||||
End Sub
|
Case ActionButton.DefaultButtons.Clear
|
||||||
Private Sub TXT_COOKIES_ActionOnButtonClearClick() Handles TXT_COOKIES.ActionOnButtonClearClick
|
If Not Host.Responser Is Nothing Then
|
||||||
If Not Host.Responser Is Nothing Then
|
With Host.Responser
|
||||||
With Host.Responser
|
If Not .Cookies Is Nothing Then .Cookies.Dispose()
|
||||||
If Not .Cookies Is Nothing Then .Cookies.Dispose()
|
.Cookies = New CookieKeeper(.CookiesDomain)
|
||||||
.Cookies = New CookieKeeper(.CookiesDomain)
|
End With
|
||||||
End With
|
SetCookieText()
|
||||||
SetCookieText()
|
End If
|
||||||
End If
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub SetCookieText()
|
Private Sub SetCookieText()
|
||||||
If Not Host.Responser Is Nothing Then TXT_COOKIES.Text = $"{If(Host.Responser.Cookies?.Count, 0)} cookies"
|
If Not Host.Responser Is Nothing Then TXT_COOKIES.Text = $"{If(Host.Responser.Cookies?.Count, 0)} cookies"
|
||||||
|
|||||||
@@ -7,39 +7,42 @@
|
|||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
|
||||||
Imports PersonalUtilities.Forms.Controls.Base
|
Imports PersonalUtilities.Forms.Controls.Base
|
||||||
Namespace Editors
|
Namespace Editors
|
||||||
Friend Class SiteSelectionForm : Implements IOkCancelToolbar
|
Friend Class SiteSelectionForm
|
||||||
Private ReadOnly MyDefs As DefaultFormOptions
|
Private WithEvents MyDefs As DefaultFormOptions
|
||||||
Friend ReadOnly Property SelectedSites As List(Of String)
|
Friend ReadOnly Property SelectedSites As List(Of String)
|
||||||
Friend Sub New(ByVal s As List(Of String))
|
Friend Sub New(ByVal s As List(Of String))
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
SelectedSites.ListAddList(s)
|
SelectedSites.ListAddList(s)
|
||||||
If SelectedSites Is Nothing Then SelectedSites = New List(Of String)
|
If SelectedSites Is Nothing Then SelectedSites = New List(Of String)
|
||||||
MyDefs = New DefaultFormOptions
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub SiteSelectionForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub SiteSelectionForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
With MyDefs
|
Try
|
||||||
.MyViewInitialize(Me, Settings.Design, True)
|
With MyDefs
|
||||||
.AddOkCancelToolbar()
|
.MyViewInitialize(True)
|
||||||
CMB_SITES.BeginUpdate()
|
.AddOkCancelToolbar()
|
||||||
Dim sl As List(Of String) = ListAddList(Nothing, Settings.Plugins.Select(Function(p) p.Name))
|
CMB_SITES.BeginUpdate()
|
||||||
CMB_SITES.Items.AddRange(sl.Select(Function(s) New ListItem(s)))
|
Dim sl As List(Of String) = ListAddList(Nothing, Settings.Plugins.Select(Function(p) p.Name))
|
||||||
Dim l As New List(Of Integer)
|
CMB_SITES.Items.AddRange(sl.Select(Function(s) New ListItem(s)))
|
||||||
If SelectedSites.Count > 0 Then sl.ForEach(Sub(s) If SelectedSites.Contains(s) Then l.Add(sl.IndexOf(s)))
|
Dim l As New List(Of Integer)
|
||||||
sl.Clear()
|
If SelectedSites.Count > 0 Then sl.ForEach(Sub(s) If SelectedSites.Contains(s) Then l.Add(sl.IndexOf(s)))
|
||||||
CMB_SITES.EndUpdate()
|
sl.Clear()
|
||||||
If l.Count > 0 Then CMB_SITES.ListCheckedIndexes = l : l.Clear()
|
CMB_SITES.EndUpdate()
|
||||||
.DelegateClosingChecker = False
|
If l.Count > 0 Then CMB_SITES.ListCheckedIndexes = l : l.Clear()
|
||||||
.EndLoaderOperations()
|
.DelegateClosingChecker = False
|
||||||
.MyOkCancel.EnableOK = True
|
.EndLoaderOperations()
|
||||||
End With
|
.MyOkCancel.EnableOK = True
|
||||||
|
End With
|
||||||
|
Catch ex As Exception
|
||||||
|
MyDefs.InvokeLoaderError(ex)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub SiteSelectionForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
Private Sub SiteSelectionForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
|
||||||
SelectedSites.Clear()
|
SelectedSites.Clear()
|
||||||
End Sub
|
End Sub
|
||||||
Public Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDefs_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonOkClick
|
||||||
Try
|
Try
|
||||||
SelectedSites.ListAddList(CMB_SITES.Items.CheckedItems.Select(Function(i) CStr(i.Value(0))), LAP.ClearBeforeAdd)
|
SelectedSites.ListAddList(CMB_SITES.Items.CheckedItems.Select(Function(i) CStr(i.Value(0))), LAP.ClearBeforeAdd)
|
||||||
MyDefs.CloseForm()
|
MyDefs.CloseForm()
|
||||||
@@ -47,8 +50,5 @@ Namespace Editors
|
|||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, ex)
|
ErrorsDescriber.Execute(EDP.LogMessageValue, ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Public Sub Cancel() Implements IOkCancelToolbar.Cancel
|
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
45
SCrawler/Editors/UserCreatorForm.Designer.vb
generated
45
SCrawler/Editors/UserCreatorForm.Designer.vb
generated
@@ -32,6 +32,7 @@
|
|||||||
Dim ActionButton7 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton7 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
Dim ActionButton8 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
Dim ActionButton8 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
|
||||||
Dim TT_MAIN As System.Windows.Forms.ToolTip
|
Dim TT_MAIN As System.Windows.Forms.ToolTip
|
||||||
|
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
|
||||||
Me.TXT_USER = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.TXT_USER = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
Me.CH_IS_CHANNEL = New System.Windows.Forms.CheckBox()
|
Me.CH_IS_CHANNEL = New System.Windows.Forms.CheckBox()
|
||||||
Me.CMB_SITE = New PersonalUtilities.Forms.Controls.ComboBoxExtended()
|
Me.CMB_SITE = New PersonalUtilities.Forms.Controls.ComboBoxExtended()
|
||||||
@@ -50,13 +51,13 @@
|
|||||||
Me.CH_DOWN_VIDEOS = New System.Windows.Forms.CheckBox()
|
Me.CH_DOWN_VIDEOS = New System.Windows.Forms.CheckBox()
|
||||||
Me.TXT_SPEC_FOLDER = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.TXT_SPEC_FOLDER = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
Me.TXT_SCRIPT = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.TXT_SCRIPT = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
|
||||||
TP_MAIN = New System.Windows.Forms.TableLayoutPanel()
|
TP_MAIN = New System.Windows.Forms.TableLayoutPanel()
|
||||||
TP_SITE = New System.Windows.Forms.TableLayoutPanel()
|
TP_SITE = New System.Windows.Forms.TableLayoutPanel()
|
||||||
TP_PARAMS = New System.Windows.Forms.TableLayoutPanel()
|
TP_PARAMS = New System.Windows.Forms.TableLayoutPanel()
|
||||||
TP_OTHER = New System.Windows.Forms.TableLayoutPanel()
|
TP_OTHER = New System.Windows.Forms.TableLayoutPanel()
|
||||||
TP_DOWN_OPTIONS = New System.Windows.Forms.TableLayoutPanel()
|
TP_DOWN_OPTIONS = New System.Windows.Forms.TableLayoutPanel()
|
||||||
TT_MAIN = New System.Windows.Forms.ToolTip(Me.components)
|
TT_MAIN = New System.Windows.Forms.ToolTip(Me.components)
|
||||||
|
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
||||||
TP_MAIN.SuspendLayout()
|
TP_MAIN.SuspendLayout()
|
||||||
CType(Me.TXT_USER, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.TXT_USER, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
TP_SITE.SuspendLayout()
|
TP_SITE.SuspendLayout()
|
||||||
@@ -70,8 +71,8 @@
|
|||||||
TP_DOWN_OPTIONS.SuspendLayout()
|
TP_DOWN_OPTIONS.SuspendLayout()
|
||||||
CType(Me.TXT_SPEC_FOLDER, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.TXT_SPEC_FOLDER, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
CONTAINER_MAIN.ContentPanel.SuspendLayout()
|
||||||
Me.CONTAINER_MAIN.SuspendLayout()
|
CONTAINER_MAIN.SuspendLayout()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
'TP_MAIN
|
'TP_MAIN
|
||||||
@@ -125,7 +126,7 @@
|
|||||||
TP_SITE.ColumnCount = 3
|
TP_SITE.ColumnCount = 3
|
||||||
TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 79.0!))
|
TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 79.0!))
|
||||||
TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
||||||
TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 98.0!))
|
TP_SITE.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100.0!))
|
||||||
TP_SITE.Controls.Add(Me.CH_IS_CHANNEL, 0, 0)
|
TP_SITE.Controls.Add(Me.CH_IS_CHANNEL, 0, 0)
|
||||||
TP_SITE.Controls.Add(Me.CMB_SITE, 1, 0)
|
TP_SITE.Controls.Add(Me.CMB_SITE, 1, 0)
|
||||||
TP_SITE.Controls.Add(Me.BTT_OTHER_SETTINGS, 2, 0)
|
TP_SITE.Controls.Add(Me.BTT_OTHER_SETTINGS, 2, 0)
|
||||||
@@ -168,17 +169,17 @@
|
|||||||
Me.CMB_SITE.Location = New System.Drawing.Point(84, 3)
|
Me.CMB_SITE.Location = New System.Drawing.Point(84, 3)
|
||||||
Me.CMB_SITE.Margin = New System.Windows.Forms.Padding(3, 2, 3, 3)
|
Me.CMB_SITE.Margin = New System.Windows.Forms.Padding(3, 2, 3, 3)
|
||||||
Me.CMB_SITE.Name = "CMB_SITE"
|
Me.CMB_SITE.Name = "CMB_SITE"
|
||||||
Me.CMB_SITE.Size = New System.Drawing.Size(265, 22)
|
Me.CMB_SITE.Size = New System.Drawing.Size(263, 22)
|
||||||
Me.CMB_SITE.TabIndex = 1
|
Me.CMB_SITE.TabIndex = 1
|
||||||
Me.CMB_SITE.TextBoxBorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
Me.CMB_SITE.TextBoxBorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
||||||
'
|
'
|
||||||
'BTT_OTHER_SETTINGS
|
'BTT_OTHER_SETTINGS
|
||||||
'
|
'
|
||||||
Me.BTT_OTHER_SETTINGS.Dock = System.Windows.Forms.DockStyle.Fill
|
Me.BTT_OTHER_SETTINGS.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.BTT_OTHER_SETTINGS.Location = New System.Drawing.Point(354, 2)
|
Me.BTT_OTHER_SETTINGS.Location = New System.Drawing.Point(352, 2)
|
||||||
Me.BTT_OTHER_SETTINGS.Margin = New System.Windows.Forms.Padding(1)
|
Me.BTT_OTHER_SETTINGS.Margin = New System.Windows.Forms.Padding(1)
|
||||||
Me.BTT_OTHER_SETTINGS.Name = "BTT_OTHER_SETTINGS"
|
Me.BTT_OTHER_SETTINGS.Name = "BTT_OTHER_SETTINGS"
|
||||||
Me.BTT_OTHER_SETTINGS.Size = New System.Drawing.Size(96, 24)
|
Me.BTT_OTHER_SETTINGS.Size = New System.Drawing.Size(98, 24)
|
||||||
Me.BTT_OTHER_SETTINGS.TabIndex = 2
|
Me.BTT_OTHER_SETTINGS.TabIndex = 2
|
||||||
Me.BTT_OTHER_SETTINGS.Text = "Options (F2)"
|
Me.BTT_OTHER_SETTINGS.Text = "Options (F2)"
|
||||||
TT_MAIN.SetToolTip(Me.BTT_OTHER_SETTINGS, "Other settings")
|
TT_MAIN.SetToolTip(Me.BTT_OTHER_SETTINGS, "Other settings")
|
||||||
@@ -438,23 +439,23 @@
|
|||||||
'
|
'
|
||||||
'CONTAINER_MAIN.ContentPanel
|
'CONTAINER_MAIN.ContentPanel
|
||||||
'
|
'
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Controls.Add(TP_MAIN)
|
CONTAINER_MAIN.ContentPanel.Controls.Add(TP_MAIN)
|
||||||
Me.CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(454, 461)
|
CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(454, 461)
|
||||||
Me.CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
|
CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.CONTAINER_MAIN.LeftToolStripPanelVisible = False
|
CONTAINER_MAIN.LeftToolStripPanelVisible = False
|
||||||
Me.CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
|
CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
|
||||||
Me.CONTAINER_MAIN.Name = "CONTAINER_MAIN"
|
CONTAINER_MAIN.Name = "CONTAINER_MAIN"
|
||||||
Me.CONTAINER_MAIN.RightToolStripPanelVisible = False
|
CONTAINER_MAIN.RightToolStripPanelVisible = False
|
||||||
Me.CONTAINER_MAIN.Size = New System.Drawing.Size(454, 461)
|
CONTAINER_MAIN.Size = New System.Drawing.Size(454, 461)
|
||||||
Me.CONTAINER_MAIN.TabIndex = 0
|
CONTAINER_MAIN.TabIndex = 0
|
||||||
Me.CONTAINER_MAIN.TopToolStripPanelVisible = False
|
CONTAINER_MAIN.TopToolStripPanelVisible = False
|
||||||
'
|
'
|
||||||
'UserCreatorForm
|
'UserCreatorForm
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||||
Me.ClientSize = New System.Drawing.Size(454, 461)
|
Me.ClientSize = New System.Drawing.Size(454, 461)
|
||||||
Me.Controls.Add(Me.CONTAINER_MAIN)
|
Me.Controls.Add(CONTAINER_MAIN)
|
||||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
|
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
|
||||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||||
Me.KeyPreview = True
|
Me.KeyPreview = True
|
||||||
@@ -484,14 +485,12 @@
|
|||||||
TP_DOWN_OPTIONS.PerformLayout()
|
TP_DOWN_OPTIONS.PerformLayout()
|
||||||
CType(Me.TXT_SPEC_FOLDER, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.TXT_SPEC_FOLDER, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
Me.CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
|
CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
|
||||||
Me.CONTAINER_MAIN.ResumeLayout(False)
|
CONTAINER_MAIN.ResumeLayout(False)
|
||||||
Me.CONTAINER_MAIN.PerformLayout()
|
CONTAINER_MAIN.PerformLayout()
|
||||||
Me.ResumeLayout(False)
|
Me.ResumeLayout(False)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private WithEvents CONTAINER_MAIN As ToolStripContainer
|
|
||||||
Private WithEvents TXT_USER As PersonalUtilities.Forms.Controls.TextBoxExtended
|
Private WithEvents TXT_USER As PersonalUtilities.Forms.Controls.TextBoxExtended
|
||||||
Private WithEvents CH_TEMP As CheckBox
|
Private WithEvents CH_TEMP As CheckBox
|
||||||
Private WithEvents CH_FAV As CheckBox
|
Private WithEvents CH_FAV As CheckBox
|
||||||
|
|||||||
@@ -294,6 +294,9 @@
|
|||||||
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
|
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
|
<metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>False</value>
|
||||||
|
</metadata>
|
||||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
AAABAAkAMDAQAAAAAABoBgAAlgAAACAgEAAAAAAA6AIAAP4GAAAQEBAAAAAAACgBAADmCQAAMDAAAAEA
|
AAABAAkAMDAQAAAAAABoBgAAlgAAACAgEAAAAAAA6AIAAP4GAAAQEBAAAAAAACgBAADmCQAAMDAAAAEA
|
||||||
|
|||||||
@@ -9,15 +9,14 @@
|
|||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Controls
|
Imports PersonalUtilities.Forms.Controls
|
||||||
Imports PersonalUtilities.Forms.Controls.Base
|
Imports PersonalUtilities.Forms.Controls.Base
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
|
||||||
Imports PersonalUtilities.Functions.RegularExpressions
|
Imports PersonalUtilities.Functions.RegularExpressions
|
||||||
Imports SCrawler.API.Base
|
Imports SCrawler.API.Base
|
||||||
Imports SCrawler.Plugin
|
Imports SCrawler.Plugin
|
||||||
Imports SCrawler.Plugin.Hosts
|
Imports SCrawler.Plugin.Hosts
|
||||||
Imports ADB = PersonalUtilities.Forms.Controls.Base.ActionButton.DefaultButtons
|
Imports ADB = PersonalUtilities.Forms.Controls.Base.ActionButton.DefaultButtons
|
||||||
Namespace Editors
|
Namespace Editors
|
||||||
Friend Class UserCreatorForm : Implements IOkCancelToolbar
|
Friend Class UserCreatorForm
|
||||||
Private ReadOnly MyDef As DefaultFormOptions
|
Private WithEvents MyDef As DefaultFormOptions
|
||||||
Friend Property User As UserInfo
|
Friend Property User As UserInfo
|
||||||
Private Property UserInstance As IUserData
|
Private Property UserInstance As IUserData
|
||||||
#Region "User options"
|
#Region "User options"
|
||||||
@@ -100,7 +99,7 @@ Namespace Editors
|
|||||||
Friend Sub New()
|
Friend Sub New()
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
UserLabels = New List(Of String)
|
UserLabels = New List(Of String)
|
||||||
MyDef = New DefaultFormOptions
|
MyDef = New DefaultFormOptions(Me, Settings.Design)
|
||||||
End Sub
|
End Sub
|
||||||
''' <summary>Edit exist user</summary>
|
''' <summary>Edit exist user</summary>
|
||||||
Friend Sub New(ByVal _Instance As IUserData)
|
Friend Sub New(ByVal _Instance As IUserData)
|
||||||
@@ -115,7 +114,7 @@ Namespace Editors
|
|||||||
Private Sub UserCreatorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub UserCreatorForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
Try
|
Try
|
||||||
With MyDef
|
With MyDef
|
||||||
.MyViewInitialize(Me, Settings.Design, True)
|
.MyViewInitialize(True)
|
||||||
.AddOkCancelToolbar()
|
.AddOkCancelToolbar()
|
||||||
CH_AUTO_DETECT_SITE.Enabled = False
|
CH_AUTO_DETECT_SITE.Enabled = False
|
||||||
With CMB_SITE
|
With CMB_SITE
|
||||||
@@ -168,7 +167,7 @@ Namespace Editors
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
.MyFieldsChecker = New FieldsChecker
|
.MyFieldsChecker = New FieldsChecker
|
||||||
DirectCast(.MyFieldsChecker, FieldsChecker).AddControl(Of String)(TXT_USER, TXT_USER.CaptionText)
|
.MyFieldsCheckerE.AddControl(Of String)(TXT_USER, TXT_USER.CaptionText)
|
||||||
.MyFieldsChecker.EndLoaderOperations()
|
.MyFieldsChecker.EndLoaderOperations()
|
||||||
.EndLoaderOperations()
|
.EndLoaderOperations()
|
||||||
End With
|
End With
|
||||||
@@ -190,7 +189,7 @@ Namespace Editors
|
|||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Ok, Cancel"
|
#Region "Ok, Cancel"
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
Private Sub MyDef_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDef.ButtonOkClick
|
||||||
If Not CH_ADD_BY_LIST.Checked Then
|
If Not CH_ADD_BY_LIST.Checked Then
|
||||||
If MyDef.MyFieldsChecker.AllParamsOK Then
|
If MyDef.MyFieldsChecker.AllParamsOK Then
|
||||||
Dim s As SettingsHost = GetSiteByCheckers()
|
Dim s As SettingsHost = GetSiteByCheckers()
|
||||||
@@ -250,13 +249,13 @@ Namespace Editors
|
|||||||
CloseForm:
|
CloseForm:
|
||||||
MyDef.CloseForm()
|
MyDef.CloseForm()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
Private Sub MyDef_ButtonCancelClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDef.ButtonCancelClick
|
||||||
MyDef.CloseForm(IIf(StartIndex >= 0, DialogResult.OK, DialogResult.Cancel))
|
MyDef.CloseForm(IIf(StartIndex >= 0, DialogResult.OK, DialogResult.Cancel))
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Controls handlers"
|
#Region "Controls handlers"
|
||||||
Private _TextChangeInvoked As Boolean = False
|
Private _TextChangeInvoked As Boolean = False
|
||||||
Private Sub TXT_USER_ActionOnTextChange() Handles TXT_USER.ActionOnTextChange
|
Private Sub TXT_USER_ActionOnTextChanged(ByVal Sender As Object, ByVal e As EventArgs) Handles TXT_USER.ActionOnTextChanged
|
||||||
Try
|
Try
|
||||||
If Not _TextChangeInvoked Then
|
If Not _TextChangeInvoked Then
|
||||||
_TextChangeInvoked = True
|
_TextChangeInvoked = True
|
||||||
@@ -280,10 +279,10 @@ CloseForm:
|
|||||||
End If
|
End If
|
||||||
_TextChangeInvoked = False
|
_TextChangeInvoked = False
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CMB_SITE_ActionSelectedItemChanged(ByVal _Item As ListViewItem) Handles CMB_SITE.ActionSelectedItemChanged
|
Private Sub CMB_SITE_ActionSelectedItemChanged(ByVal Item As ListViewItem) Handles CMB_SITE.ActionSelectedItemChanged
|
||||||
CH_IS_CHANNEL.Checked = False
|
CH_IS_CHANNEL.Checked = False
|
||||||
MyExchangeOptions = Nothing
|
MyExchangeOptions = Nothing
|
||||||
SetParamsBySite()
|
SetParamsBySite()
|
||||||
@@ -296,8 +295,8 @@ CloseForm:
|
|||||||
MyDef.MyOkCancel.EnableOK = True
|
MyDef.MyOkCancel.EnableOK = True
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub TXT_SPEC_FOLDER_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_SPEC_FOLDER.ActionOnButtonClick
|
Private Sub TXT_SPEC_FOLDER_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_SPEC_FOLDER.ActionOnButtonClick
|
||||||
If Sender.DefaultButton = ActionButton.DefaultButtons.Open Then
|
If Sender.DefaultButton = ADB.Open Then
|
||||||
Dim f As SFile = Nothing
|
Dim f As SFile = Nothing
|
||||||
If Not TXT_SPEC_FOLDER.Text.IsEmptyString Then f = $"{TXT_SPEC_FOLDER.Text}\"
|
If Not TXT_SPEC_FOLDER.Text.IsEmptyString Then f = $"{TXT_SPEC_FOLDER.Text}\"
|
||||||
f = SFile.SelectPath(f, True)
|
f = SFile.SelectPath(f, True)
|
||||||
@@ -333,13 +332,13 @@ CloseForm:
|
|||||||
BTT_OTHER_SETTINGS.Enabled = True
|
BTT_OTHER_SETTINGS.Enabled = True
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub TXT_LABELS_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_LABELS.ActionOnButtonClick
|
Private Sub TXT_LABELS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_LABELS.ActionOnButtonClick
|
||||||
Select Case Sender.DefaultButton
|
Select Case Sender.DefaultButton
|
||||||
Case ADB.Open : ChangeLabels()
|
Case ADB.Open : ChangeLabels()
|
||||||
Case ADB.Clear : UserLabels.Clear()
|
Case ADB.Clear : UserLabels.Clear()
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub TXT_SCRIPT_ActionOnButtonClick(ByVal Sender As ActionButton) Handles TXT_SCRIPT.ActionOnButtonClick
|
Private Sub TXT_SCRIPT_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_SCRIPT.ActionOnButtonClick
|
||||||
SettingsCLS.ScriptTextBoxButtonClick(TXT_SCRIPT, Sender)
|
SettingsCLS.ScriptTextBoxButtonClick(TXT_SCRIPT, Sender)
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
@@ -449,7 +448,7 @@ CloseForm:
|
|||||||
End If
|
End If
|
||||||
Return False
|
Return False
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Return ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Error on adding users by list", False)
|
Return ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Error when adding users by list", False)
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
Private Function GetSiteByText(ByRef TXT As String) As ExchangeOptions
|
Private Function GetSiteByText(ByRef TXT As String) As ExchangeOptions
|
||||||
|
|||||||
@@ -7,9 +7,8 @@
|
|||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Forms
|
Imports PersonalUtilities.Forms
|
||||||
Imports PersonalUtilities.Forms.Toolbars
|
Friend Class FDatePickerForm
|
||||||
Friend Class FDatePickerForm : Implements IOkCancelDeleteToolbar
|
Private ReadOnly MyDefs As DefaultFormOptions
|
||||||
Private MyDefs As DefaultFormOptions
|
|
||||||
Friend ReadOnly Property SelectedDate As Date?
|
Friend ReadOnly Property SelectedDate As Date?
|
||||||
Get
|
Get
|
||||||
If DT.Checked Then Return DT.Value.Date Else Return Nothing
|
If DT.Checked Then Return DT.Value.Date Else Return Nothing
|
||||||
@@ -19,12 +18,12 @@ Friend Class FDatePickerForm : Implements IOkCancelDeleteToolbar
|
|||||||
Friend Sub New(ByVal d As Date?)
|
Friend Sub New(ByVal d As Date?)
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
_InitialValue = d
|
_InitialValue = d
|
||||||
|
MyDefs = New DefaultFormOptions(Me, Settings.Design)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub FDatePickerForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub FDatePickerForm_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
MyDefs = New DefaultFormOptions
|
|
||||||
With MyDefs
|
With MyDefs
|
||||||
.MyViewInitialize(Me, Settings.Design, True)
|
.MyViewInitialize(True)
|
||||||
.AddOkCancelToolbar()
|
.AddOkCancelToolbar(True)
|
||||||
If _InitialValue.HasValue Then
|
If _InitialValue.HasValue Then
|
||||||
DT.Checked = True
|
DT.Checked = True
|
||||||
DT.Value = _InitialValue.Value.Date
|
DT.Value = _InitialValue.Value.Date
|
||||||
@@ -36,13 +35,4 @@ Friend Class FDatePickerForm : Implements IOkCancelDeleteToolbar
|
|||||||
MyDefs.MyOkCancel.EnableOK = True
|
MyDefs.MyOkCancel.EnableOK = True
|
||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub OK() Implements IOkCancelToolbar.OK
|
|
||||||
MyDefs.CloseForm()
|
|
||||||
End Sub
|
|
||||||
Private Sub Cancel() Implements IOkCancelToolbar.Cancel
|
|
||||||
MyDefs.CloseForm(DialogResult.Cancel)
|
|
||||||
End Sub
|
|
||||||
Private Sub Delete() Implements IOkCancelDeleteToolbar.Delete
|
|
||||||
MyDefs.CloseForm(DialogResult.Abort)
|
|
||||||
End Sub
|
|
||||||
End Class
|
End Class
|
||||||
@@ -101,7 +101,7 @@ Friend Class LabelsKeeper : Implements ICollection(Of String), IMyEnumerator(Of
|
|||||||
End Function
|
End Function
|
||||||
Private ReadOnly Property IsReadOnly As Boolean = False Implements ICollection(Of String).IsReadOnly
|
Private ReadOnly Property IsReadOnly As Boolean = False Implements ICollection(Of String).IsReadOnly
|
||||||
Private Sub CopyTo(ByVal _Array() As String, ByVal ArrayIndex As Integer) Implements ICollection(Of String).CopyTo
|
Private Sub CopyTo(ByVal _Array() As String, ByVal ArrayIndex As Integer) Implements ICollection(Of String).CopyTo
|
||||||
Throw New NotImplementedException()
|
LabelsList.CopyTo(_Array, ArrayIndex)
|
||||||
End Sub
|
End Sub
|
||||||
#Region "IEnumerable Support"
|
#Region "IEnumerable Support"
|
||||||
Private Function GetEnumerator() As IEnumerator(Of String) Implements IEnumerable(Of String).GetEnumerator
|
Private Function GetEnumerator() As IEnumerator(Of String) Implements IEnumerable(Of String).GetEnumerator
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ Friend Class ListImagesLoader
|
|||||||
If Settings.ViewModeIsPicture Then
|
If Settings.ViewModeIsPicture Then
|
||||||
.LargeImageList.ColorDepth = ColorDepth.Depth32Bit
|
.LargeImageList.ColorDepth = ColorDepth.Depth32Bit
|
||||||
.SmallImageList.ColorDepth = ColorDepth.Depth32Bit
|
.SmallImageList.ColorDepth = ColorDepth.Depth32Bit
|
||||||
.LargeImageList.ImageSize = New Size(DivideWithZeroChecking(Settings.MaxLargeImageHeigh.Value, 100) * 75, Settings.MaxLargeImageHeigh.Value)
|
.LargeImageList.ImageSize = New Size(DivideWithZeroChecking(Settings.MaxLargeImageHeight.Value, 100) * 75, Settings.MaxLargeImageHeight.Value)
|
||||||
.SmallImageList.ImageSize = New Size(DivideWithZeroChecking(Settings.MaxSmallImageHeigh.Value, 100) * 75, Settings.MaxSmallImageHeigh.Value)
|
.SmallImageList.ImageSize = New Size(DivideWithZeroChecking(Settings.MaxSmallImageHeight.Value, 100) * 75, Settings.MaxSmallImageHeight.Value)
|
||||||
End If
|
End If
|
||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
@@ -148,11 +148,11 @@ Friend Class ListImagesLoader
|
|||||||
Friend Shared Function ApplyLVIColor(ByVal User As IUserData, ByVal LVI As ListViewItem, ByVal IsInit As Boolean) As ListViewItem
|
Friend Shared Function ApplyLVIColor(ByVal User As IUserData, ByVal LVI As ListViewItem, ByVal IsInit As Boolean) As ListViewItem
|
||||||
With LVI
|
With LVI
|
||||||
If Not User.Exists Then
|
If Not User.Exists Then
|
||||||
.BackColor = ColorBttDeleteBack
|
.BackColor = MyColor.DeleteBack
|
||||||
.ForeColor = ColorBttDeleteFore
|
.ForeColor = MyColor.DeleteFore
|
||||||
ElseIf User.Suspended Then
|
ElseIf User.Suspended Then
|
||||||
.BackColor = ColorBttEditBack
|
.BackColor = MyColor.EditBack
|
||||||
.ForeColor = ColorBttEditFore
|
.ForeColor = MyColor.EditFore
|
||||||
ElseIf CheckUserCollection(User) Then
|
ElseIf CheckUserCollection(User) Then
|
||||||
.BackColor = Color.LightSkyBlue
|
.BackColor = Color.LightSkyBlue
|
||||||
.ForeColor = Color.MidnightBlue
|
.ForeColor = Color.MidnightBlue
|
||||||
|
|||||||
18
SCrawler/MainFrame.Designer.vb
generated
18
SCrawler/MainFrame.Designer.vb
generated
@@ -50,6 +50,7 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
|
|||||||
Me.BTT_DOWN_SITE_FULL = New System.Windows.Forms.ToolStripMenuItem()
|
Me.BTT_DOWN_SITE_FULL = New System.Windows.Forms.ToolStripMenuItem()
|
||||||
Me.BTT_ADD_NEW_GROUP = New System.Windows.Forms.ToolStripMenuItem()
|
Me.BTT_ADD_NEW_GROUP = New System.Windows.Forms.ToolStripMenuItem()
|
||||||
Me.BTT_DOWN_AUTOMATION = New System.Windows.Forms.ToolStripMenuItem()
|
Me.BTT_DOWN_AUTOMATION = New System.Windows.Forms.ToolStripMenuItem()
|
||||||
|
Me.BTT_DOWN_AUTOMATION_PAUSE = New System.Windows.Forms.ToolStripMenuItem()
|
||||||
Me.BTT_DOWN_VIDEO = New System.Windows.Forms.ToolStripButton()
|
Me.BTT_DOWN_VIDEO = New System.Windows.Forms.ToolStripButton()
|
||||||
Me.BTT_DOWN_STOP = New System.Windows.Forms.ToolStripButton()
|
Me.BTT_DOWN_STOP = New System.Windows.Forms.ToolStripButton()
|
||||||
Me.MENU_VIEW = New System.Windows.Forms.ToolStripDropDownButton()
|
Me.MENU_VIEW = New System.Windows.Forms.ToolStripDropDownButton()
|
||||||
@@ -104,7 +105,6 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
|
|||||||
Me.BTT_TRAY_SHOW_HIDE = New System.Windows.Forms.ToolStripMenuItem()
|
Me.BTT_TRAY_SHOW_HIDE = New System.Windows.Forms.ToolStripMenuItem()
|
||||||
Me.BTT_TRAY_CLOSE = New System.Windows.Forms.ToolStripMenuItem()
|
Me.BTT_TRAY_CLOSE = New System.Windows.Forms.ToolStripMenuItem()
|
||||||
Me.BTT_TRAY_CLOSE_NO_SCRIPT = New System.Windows.Forms.ToolStripMenuItem()
|
Me.BTT_TRAY_CLOSE_NO_SCRIPT = New System.Windows.Forms.ToolStripMenuItem()
|
||||||
Me.BTT_DOWN_AUTOMATION_PAUSE = New System.Windows.Forms.ToolStripMenuItem()
|
|
||||||
SEP_1 = New System.Windows.Forms.ToolStripSeparator()
|
SEP_1 = New System.Windows.Forms.ToolStripSeparator()
|
||||||
SEP_2 = New System.Windows.Forms.ToolStripSeparator()
|
SEP_2 = New System.Windows.Forms.ToolStripSeparator()
|
||||||
CONTEXT_SEP_1 = New System.Windows.Forms.ToolStripSeparator()
|
CONTEXT_SEP_1 = New System.Windows.Forms.ToolStripSeparator()
|
||||||
@@ -372,6 +372,13 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
|
|||||||
Me.BTT_DOWN_AUTOMATION.Size = New System.Drawing.Size(231, 22)
|
Me.BTT_DOWN_AUTOMATION.Size = New System.Drawing.Size(231, 22)
|
||||||
Me.BTT_DOWN_AUTOMATION.Text = "Automation"
|
Me.BTT_DOWN_AUTOMATION.Text = "Automation"
|
||||||
'
|
'
|
||||||
|
'BTT_DOWN_AUTOMATION_PAUSE
|
||||||
|
'
|
||||||
|
Me.BTT_DOWN_AUTOMATION_PAUSE.Image = Global.SCrawler.My.Resources.Resources.Pause_Blue_16
|
||||||
|
Me.BTT_DOWN_AUTOMATION_PAUSE.Name = "BTT_DOWN_AUTOMATION_PAUSE"
|
||||||
|
Me.BTT_DOWN_AUTOMATION_PAUSE.Size = New System.Drawing.Size(231, 22)
|
||||||
|
Me.BTT_DOWN_AUTOMATION_PAUSE.Text = "Pause automation"
|
||||||
|
'
|
||||||
'BTT_DOWN_VIDEO
|
'BTT_DOWN_VIDEO
|
||||||
'
|
'
|
||||||
Me.BTT_DOWN_VIDEO.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
|
Me.BTT_DOWN_VIDEO.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
|
||||||
@@ -547,7 +554,7 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
|
|||||||
Me.BTT_DONATE.Name = "BTT_DONATE"
|
Me.BTT_DONATE.Name = "BTT_DONATE"
|
||||||
Me.BTT_DONATE.Size = New System.Drawing.Size(23, 20)
|
Me.BTT_DONATE.Size = New System.Drawing.Size(23, 20)
|
||||||
Me.BTT_DONATE.Text = "Donate"
|
Me.BTT_DONATE.Text = "Donate"
|
||||||
Me.BTT_DONATE.ToolTipText = "Donate"
|
Me.BTT_DONATE.ToolTipText = "Support"
|
||||||
'
|
'
|
||||||
'Toolbar_BOTTOM
|
'Toolbar_BOTTOM
|
||||||
'
|
'
|
||||||
@@ -766,13 +773,6 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
|
|||||||
Me.BTT_TRAY_CLOSE_NO_SCRIPT.ToolTipText = "Close the program without executing the script"
|
Me.BTT_TRAY_CLOSE_NO_SCRIPT.ToolTipText = "Close the program without executing the script"
|
||||||
Me.BTT_TRAY_CLOSE_NO_SCRIPT.Visible = False
|
Me.BTT_TRAY_CLOSE_NO_SCRIPT.Visible = False
|
||||||
'
|
'
|
||||||
'BTT_DOWN_AUTOMATION_PAUSE
|
|
||||||
'
|
|
||||||
Me.BTT_DOWN_AUTOMATION_PAUSE.Image = Global.SCrawler.My.Resources.Resources.Pause_Blue_16
|
|
||||||
Me.BTT_DOWN_AUTOMATION_PAUSE.Name = "BTT_DOWN_AUTOMATION_PAUSE"
|
|
||||||
Me.BTT_DOWN_AUTOMATION_PAUSE.Size = New System.Drawing.Size(231, 22)
|
|
||||||
Me.BTT_DOWN_AUTOMATION_PAUSE.Text = "Pause automation"
|
|
||||||
'
|
|
||||||
'MainFrame
|
'MainFrame
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ EndFunction:
|
|||||||
Downloader.Dispose()
|
Downloader.Dispose()
|
||||||
MyProgressForm.Dispose()
|
MyProgressForm.Dispose()
|
||||||
InfoForm.Dispose()
|
InfoForm.Dispose()
|
||||||
MainFrameObj.CLearNotifications()
|
MainFrameObj.ClearNotifications()
|
||||||
If Not MyChannels Is Nothing Then MyChannels.Dispose()
|
If Not MyChannels Is Nothing Then MyChannels.Dispose()
|
||||||
If Not VideoDownloader Is Nothing Then VideoDownloader.Dispose()
|
If Not VideoDownloader Is Nothing Then VideoDownloader.Dispose()
|
||||||
If Not MySavedPosts Is Nothing Then MySavedPosts.Dispose()
|
If Not MySavedPosts Is Nothing Then MySavedPosts.Dispose()
|
||||||
@@ -206,7 +206,7 @@ CloseResume:
|
|||||||
Case Keys.F2 : DownloadVideoByURL()
|
Case Keys.F2 : DownloadVideoByURL()
|
||||||
Case Keys.F3 : EditSelectedUser()
|
Case Keys.F3 : EditSelectedUser()
|
||||||
Case Keys.F5 : BTT_DOWN_SELECTED.PerformClick()
|
Case Keys.F5 : BTT_DOWN_SELECTED.PerformClick()
|
||||||
Case Keys.F6 : If Settings.ShowingMode.Value = ShowingModes.All Then BTT_DOWN_ALL.PerformClick()
|
Case Keys.F6 : BTT_DOWN_ALL.PerformClick()
|
||||||
Case Else : b = NumGroup(e)
|
Case Else : b = NumGroup(e)
|
||||||
End Select
|
End Select
|
||||||
If b Then e.Handled = True
|
If b Then e.Handled = True
|
||||||
@@ -262,13 +262,13 @@ CloseResume:
|
|||||||
#Region "Settings"
|
#Region "Settings"
|
||||||
Private Sub BTT_SETTINGS_Click(sender As Object, e As EventArgs) Handles BTT_SETTINGS.Click
|
Private Sub BTT_SETTINGS_Click(sender As Object, e As EventArgs) Handles BTT_SETTINGS.Click
|
||||||
With Settings
|
With Settings
|
||||||
Dim mhl% = .MaxLargeImageHeigh.Value
|
Dim mhl% = .MaxLargeImageHeight.Value
|
||||||
Dim mhs% = .MaxSmallImageHeigh.Value
|
Dim mhs% = .MaxSmallImageHeight.Value
|
||||||
Dim sg As Boolean = .ShowGroups
|
Dim sg As Boolean = .ShowGroups
|
||||||
Using f As New GlobalSettingsForm
|
Using f As New GlobalSettingsForm
|
||||||
f.ShowDialog()
|
f.ShowDialog()
|
||||||
If f.DialogResult = DialogResult.OK Then
|
If f.DialogResult = DialogResult.OK Then
|
||||||
If ((Not .MaxLargeImageHeigh = mhl Or Not .MaxSmallImageHeigh = mhs) And .ViewModeIsPicture) Or
|
If ((Not .MaxLargeImageHeight = mhl Or Not .MaxSmallImageHeight = mhs) And .ViewModeIsPicture) Or
|
||||||
(Not sg = Settings.ShowGroups And .UseGrouping) Then RefillList()
|
(Not sg = Settings.ShowGroups And .UseGrouping) Then RefillList()
|
||||||
TrayIcon.Visible = .CloseToTray
|
TrayIcon.Visible = .CloseToTray
|
||||||
LIST_PROFILES.ShowGroups = .UseGrouping
|
LIST_PROFILES.ShowGroups = .UseGrouping
|
||||||
@@ -565,7 +565,6 @@ CloseResume:
|
|||||||
.ShowingMode.Value = m
|
.ShowingMode.Value = m
|
||||||
End If
|
End If
|
||||||
End With
|
End With
|
||||||
BTT_DOWN_ALL.Enabled = m = ShowingModes.All
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub SetExcludedButtonChecker()
|
Private Sub SetExcludedButtonChecker()
|
||||||
BTT_SHOW_EXCLUDED_LABELS.Checked = Settings.Labels.Excluded.Count > 0
|
BTT_SHOW_EXCLUDED_LABELS.Checked = Settings.Labels.Excluded.Count > 0
|
||||||
@@ -696,7 +695,7 @@ CloseResume:
|
|||||||
End If
|
End If
|
||||||
End Using
|
End Using
|
||||||
Else
|
Else
|
||||||
MsgBoxE("No one user does not detected", vbExclamation)
|
MsgBoxE("No user found", vbExclamation)
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.ShowAllMsg, ex, "[ChangeUserGroups]")
|
ErrorsDescriber.Execute(EDP.ShowAllMsg, ex, "[ChangeUserGroups]")
|
||||||
@@ -747,7 +746,7 @@ CloseResume:
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub BTT_CONTEXT_ADD_TO_COL_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_ADD_TO_COL.Click
|
Private Sub BTT_CONTEXT_ADD_TO_COL_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_ADD_TO_COL.Click
|
||||||
If Settings.CollectionsPath.Value.IsEmptyString Then
|
If Settings.CollectionsPath.Value.IsEmptyString Then
|
||||||
MsgBoxE("Collection path does not set", MsgBoxStyle.Exclamation)
|
MsgBoxE("Collection path not specified", MsgBoxStyle.Exclamation)
|
||||||
Else
|
Else
|
||||||
Dim user As IUserData = GetSelectedUser()
|
Dim user As IUserData = GetSelectedUser()
|
||||||
If Not user Is Nothing Then
|
If Not user Is Nothing Then
|
||||||
@@ -979,7 +978,7 @@ CloseResume:
|
|||||||
On Error Resume Next
|
On Error Resume Next
|
||||||
If user.IsCollection Then
|
If user.IsCollection Then
|
||||||
If USER_CONTEXT.Visible Then USER_CONTEXT.Hide()
|
If USER_CONTEXT.Visible Then USER_CONTEXT.Hide()
|
||||||
MsgBoxE($"This is collection!{vbNewLine}Edit collections does not allowed!", vbExclamation)
|
MsgBoxE($"This is collection!{vbNewLine}Collection editing not allowed!", vbExclamation)
|
||||||
Else
|
Else
|
||||||
Using f As New UserCreatorForm(user)
|
Using f As New UserCreatorForm(user)
|
||||||
f.ShowDialog()
|
f.ShowDialog()
|
||||||
|
|||||||
@@ -27,14 +27,14 @@ Friend Class MainFrameObjects
|
|||||||
Else
|
Else
|
||||||
RemoveHandler User.UserUpdated, AddressOf MF.User_OnUserUpdated
|
RemoveHandler User.UserUpdated, AddressOf MF.User_OnUserUpdated
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub CollectionHandler(ByVal [Collection] As UserDataBind)
|
Friend Sub CollectionHandler(ByVal [Collection] As UserDataBind)
|
||||||
Try
|
Try
|
||||||
AddHandler Collection.OnCollectionSelfRemoved, AddressOf MF.CollectionRemoved
|
AddHandler Collection.OnCollectionSelfRemoved, AddressOf MF.CollectionRemoved
|
||||||
AddHandler Collection.OnUserRemoved, AddressOf MF.UserRemovedFromCollection
|
AddHandler Collection.OnUserRemoved, AddressOf MF.UserRemovedFromCollection
|
||||||
Catch ex As Exception
|
Catch
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub Focus(Optional ByVal Show As Boolean = False)
|
Friend Sub Focus(Optional ByVal Show As Boolean = False)
|
||||||
@@ -54,7 +54,7 @@ Friend Class MainFrameObjects
|
|||||||
Friend Overloads Sub ShowNotification(ByVal Message As String, ByVal Title As String, ByVal Icon As ToolTipIcon)
|
Friend Overloads Sub ShowNotification(ByVal Message As String, ByVal Title As String, ByVal Icon As ToolTipIcon)
|
||||||
MF.TrayIcon.ShowBalloonTip(2000, Title, Message, Icon)
|
MF.TrayIcon.ShowBalloonTip(2000, Title, Message, Icon)
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub CLearNotifications()
|
Friend Sub ClearNotifications()
|
||||||
Notificator.Clear()
|
Notificator.Clear()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub Notificator_OnClicked(ByVal Key As String) Handles Notificator.OnClicked
|
Private Sub Notificator_OnClicked(ByVal Key As String) Handles Notificator.OnClicked
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
'
|
'
|
||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Functions.XML
|
|
||||||
Imports PersonalUtilities.Functions.XML.Base
|
Imports PersonalUtilities.Functions.XML.Base
|
||||||
Imports PersonalUtilities.Functions.RegularExpressions
|
Imports PersonalUtilities.Functions.RegularExpressions
|
||||||
Imports PersonalUtilities.Tools
|
Imports PersonalUtilities.Tools
|
||||||
@@ -16,7 +15,6 @@ Imports SCrawler.API
|
|||||||
Imports SCrawler.API.Base
|
Imports SCrawler.API.Base
|
||||||
Imports SCrawler.Plugin.Hosts
|
Imports SCrawler.Plugin.Hosts
|
||||||
Imports SCrawler.DownloadObjects
|
Imports SCrawler.DownloadObjects
|
||||||
Imports DownOptions = SCrawler.Plugin.ISiteSettings.Download
|
|
||||||
Friend Module MainMod
|
Friend Module MainMod
|
||||||
Friend Settings As SettingsCLS
|
Friend Settings As SettingsCLS
|
||||||
Friend Const SettingsFolderName As String = "Settings"
|
Friend Const SettingsFolderName As String = "Settings"
|
||||||
@@ -85,6 +83,11 @@ Friend Module MainMod
|
|||||||
Deleted = 10000
|
Deleted = 10000
|
||||||
Suspended = 12000
|
Suspended = 12000
|
||||||
End Enum
|
End Enum
|
||||||
|
Friend Enum FileNameReplaceMode As Integer
|
||||||
|
None = 0
|
||||||
|
Replace = 1
|
||||||
|
Add = 2
|
||||||
|
End Enum
|
||||||
Friend Downloader As TDownloader
|
Friend Downloader As TDownloader
|
||||||
Friend InfoForm As DownloadedInfoForm
|
Friend InfoForm As DownloadedInfoForm
|
||||||
Friend VideoDownloader As VideosDownloaderForm
|
Friend VideoDownloader As VideosDownloaderForm
|
||||||
@@ -133,138 +136,6 @@ Friend Module MainMod
|
|||||||
Return $"{If(Host?.Name, String.Empty)}{Opt}"
|
Return $"{If(Host?.Name, String.Empty)}{Opt}"
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
Friend Structure UserInfo : Implements IComparable(Of UserInfo), IEquatable(Of UserInfo), ICloneable, IEContainerProvider
|
|
||||||
Friend Const Name_Site As String = "Site"
|
|
||||||
Friend Const Name_Plugin As String = "Plugin"
|
|
||||||
Friend Const Name_Collection As String = "Collection"
|
|
||||||
Friend Const Name_Merged As String = "Merged"
|
|
||||||
Friend Const Name_IsChannel As String = "IsChannel"
|
|
||||||
Friend Const Name_SpecialPath As String = "SpecialPath"
|
|
||||||
Friend Name As String
|
|
||||||
Friend Site As String
|
|
||||||
Friend Plugin As String
|
|
||||||
Friend File As SFile
|
|
||||||
Friend SpecialPath As SFile
|
|
||||||
Friend Merged As Boolean
|
|
||||||
Friend IncludedInCollection As Boolean
|
|
||||||
Friend CollectionName As String
|
|
||||||
Friend IsChannel As Boolean
|
|
||||||
Friend [Protected] As Boolean
|
|
||||||
Friend ReadOnly Property DownloadOption As DownOptions
|
|
||||||
Get
|
|
||||||
If IsChannel Then
|
|
||||||
Return DownOptions.Channel
|
|
||||||
Else
|
|
||||||
Return DownOptions.Main
|
|
||||||
End If
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
Friend Sub New(ByVal _Name As String, ByVal Host As SettingsHost, Optional ByVal Collection As String = Nothing,
|
|
||||||
Optional ByVal _Merged As Boolean = False, Optional ByVal _SpecialPath As SFile = Nothing)
|
|
||||||
Name = _Name
|
|
||||||
Site = Host.Name
|
|
||||||
Plugin = Host.Key
|
|
||||||
IncludedInCollection = Not Collection.IsEmptyString
|
|
||||||
CollectionName = Collection
|
|
||||||
Merged = _Merged
|
|
||||||
SpecialPath = _SpecialPath
|
|
||||||
UpdateUserFile()
|
|
||||||
End Sub
|
|
||||||
Private Sub New(ByVal x As EContainer)
|
|
||||||
Name = x.Value
|
|
||||||
Site = x.Attribute(Name_Site).Value
|
|
||||||
Plugin = x.Attribute(Name_Plugin).Value
|
|
||||||
CollectionName = x.Attribute(Name_Collection).Value
|
|
||||||
IncludedInCollection = Not CollectionName.IsEmptyString
|
|
||||||
Merged = x.Attribute(Name_Merged).Value.FromXML(Of Boolean)(False)
|
|
||||||
SpecialPath = SFile.GetPath(x.Attribute(Name_SpecialPath).Value)
|
|
||||||
IsChannel = x.Attribute(Name_IsChannel).Value.FromXML(Of Boolean)(False)
|
|
||||||
'UpdateUserFile()
|
|
||||||
End Sub
|
|
||||||
Friend Sub New(ByVal c As Reddit.Channel)
|
|
||||||
Name = c.Name
|
|
||||||
Site = Reddit.RedditSite
|
|
||||||
Plugin = Reddit.RedditSiteKey
|
|
||||||
File = c.File
|
|
||||||
IsChannel = True
|
|
||||||
End Sub
|
|
||||||
Public Shared Widening Operator CType(ByVal x As EContainer) As UserInfo
|
|
||||||
Return New UserInfo(x)
|
|
||||||
End Operator
|
|
||||||
Public Shared Widening Operator CType(ByVal u As UserInfo) As String
|
|
||||||
Return u.Name
|
|
||||||
End Operator
|
|
||||||
Public Shared Operator =(ByVal x As UserInfo, ByVal y As UserInfo)
|
|
||||||
Return x.Equals(y)
|
|
||||||
End Operator
|
|
||||||
Public Shared Operator <>(ByVal x As UserInfo, ByVal y As UserInfo)
|
|
||||||
Return Not x.Equals(y)
|
|
||||||
End Operator
|
|
||||||
Public Overrides Function ToString() As String
|
|
||||||
Return Name
|
|
||||||
End Function
|
|
||||||
Friend Sub UpdateUserFile()
|
|
||||||
File = New SFile With {
|
|
||||||
.Separator = "\",
|
|
||||||
.Path = GetFilePathByParams(),
|
|
||||||
.Extension = "xml",
|
|
||||||
.Name = $"{UserDataBase.UserFileAppender}_{Site}_{Name}"
|
|
||||||
}
|
|
||||||
End Sub
|
|
||||||
Private Function GetFilePathByParams() As String
|
|
||||||
If [Protected] Then Return String.Empty
|
|
||||||
If Not SpecialPath.IsEmptyString Then
|
|
||||||
Return $"{SpecialPath.PathWithSeparator}{SettingsFolderName}"
|
|
||||||
ElseIf Merged And IncludedInCollection Then
|
|
||||||
Return $"{Settings.CollectionsPathF.PathNoSeparator}\{CollectionName}\{SettingsFolderName}"
|
|
||||||
Else
|
|
||||||
If IncludedInCollection Then
|
|
||||||
Return $"{Settings.CollectionsPathF.PathNoSeparator}\{CollectionName}\{Site}_{Name}\{SettingsFolderName}"
|
|
||||||
ElseIf Not Settings(Plugin) Is Nothing Then
|
|
||||||
Return $"{Settings(Plugin).Path.PathNoSeparator}\{Name}\{SettingsFolderName}"
|
|
||||||
Else
|
|
||||||
Dim s$ = Site.ToLower
|
|
||||||
Dim i% = Settings.Plugins.FindIndex(Function(p) p.Name.ToLower = s)
|
|
||||||
If i >= 0 Then Return $"{Settings.Plugins(i).Settings.Path.PathNoSeparator}\{Name}\{SettingsFolderName}" Else Return String.Empty
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End Function
|
|
||||||
Friend Function GetContainer(Optional ByVal e As ErrorsDescriber = Nothing) As EContainer Implements IEContainerProvider.ToEContainer
|
|
||||||
Return New EContainer("User", Name, {New EAttribute(Name_Site, Site),
|
|
||||||
New EAttribute(Name_Plugin, Plugin),
|
|
||||||
New EAttribute(Name_Collection, CollectionName),
|
|
||||||
New EAttribute(Name_Merged, Merged.BoolToInteger),
|
|
||||||
New EAttribute(Name_IsChannel, IsChannel.BoolToInteger),
|
|
||||||
New EAttribute(Name_SpecialPath, SpecialPath.PathWithSeparator)})
|
|
||||||
End Function
|
|
||||||
Friend Function CompareTo(ByVal Other As UserInfo) As Integer Implements IComparable(Of UserInfo).CompareTo
|
|
||||||
If Site = Other.Site Then
|
|
||||||
Return Name.CompareTo(Other.Name)
|
|
||||||
Else
|
|
||||||
Return Site.CompareTo(Other.Site)
|
|
||||||
End If
|
|
||||||
End Function
|
|
||||||
Friend Overloads Function Equals(ByVal Other As UserInfo) As Boolean Implements IEquatable(Of UserInfo).Equals
|
|
||||||
Return Site = Other.Site And Name = Other.Name
|
|
||||||
End Function
|
|
||||||
Public Overloads Overrides Function Equals(ByVal Obj As Object) As Boolean
|
|
||||||
Return Equals(DirectCast(Obj, UserInfo))
|
|
||||||
End Function
|
|
||||||
Friend Function Clone() As Object Implements ICloneable.Clone
|
|
||||||
Return New UserInfo With {
|
|
||||||
.Name = Name,
|
|
||||||
.Site = Site,
|
|
||||||
.Plugin = Plugin,
|
|
||||||
.File = File,
|
|
||||||
.SpecialPath = SpecialPath,
|
|
||||||
.Merged = Merged,
|
|
||||||
.IncludedInCollection = IncludedInCollection,
|
|
||||||
.CollectionName = CollectionName,
|
|
||||||
.IsChannel = IsChannel,
|
|
||||||
.[Protected] = [Protected]
|
|
||||||
}
|
|
||||||
End Function
|
|
||||||
End Structure
|
|
||||||
#Region "Image Handlers management"
|
#Region "Image Handlers management"
|
||||||
Friend Sub ImageHandler(ByVal User As IUserData)
|
Friend Sub ImageHandler(ByVal User As IUserData)
|
||||||
ImageHandler(User, False)
|
ImageHandler(User, False)
|
||||||
@@ -324,7 +195,7 @@ Friend Module MainMod
|
|||||||
ElseIf URL.Contains("imgur.com") Then
|
ElseIf URL.Contains("imgur.com") Then
|
||||||
um = Imgur.Envir.GetVideoInfo(URL)
|
um = Imgur.Envir.GetVideoInfo(URL)
|
||||||
Else
|
Else
|
||||||
MsgBoxE("Site of video URL does not recognized" & vbCr & "Operation canceled", MsgBoxStyle.Exclamation, e)
|
MsgBoxE("Site of video URL not recognized" & vbCr & "Operation canceled", MsgBoxStyle.Exclamation, e)
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -377,13 +248,13 @@ Friend Module MainMod
|
|||||||
Result = True
|
Result = True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If um.Count = 1 Then MsgBoxE("File does not downloaded", MsgBoxStyle.Critical, e)
|
If um.Count = 1 Then MsgBoxE("File not downloaded", MsgBoxStyle.Critical, e)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If um.Count = 1 Then MsgBoxE("File destination does not pointed" & vbCr & "Operation canceled",, e)
|
If um.Count = 1 Then MsgBoxE("File destination not specified" & vbCr & "Operation canceled",, e)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If um.Count = 1 Then MsgBoxE("File URL does not found!", MsgBoxStyle.Critical, e)
|
If um.Count = 1 Then MsgBoxE("File URL not found!", MsgBoxStyle.Critical, e)
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
@@ -392,100 +263,13 @@ Friend Module MainMod
|
|||||||
End If
|
End If
|
||||||
Return Result
|
Return Result
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Return ErrorsDescriber.Execute(e, ex, "Downloading video by URL error", False)
|
Return ErrorsDescriber.Execute(e, ex, $"Error when trying to download video from URL: [{URL}]", False)
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
|
||||||
#Region "Blacklist Support"
|
|
||||||
Friend Structure UserBan
|
|
||||||
Friend ReadOnly Name As String
|
|
||||||
Friend ReadOnly Reason As String
|
|
||||||
Friend ReadOnly Exists As Boolean
|
|
||||||
Friend Sub New(ByVal Value As String)
|
|
||||||
If Not Value.IsEmptyString Then
|
|
||||||
Dim v$() = Value.Split("|")
|
|
||||||
If v.ListExists Then
|
|
||||||
Name = v(0)
|
|
||||||
If v.Length > 1 Then Reason = v(1)
|
|
||||||
Exists = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
Friend Sub New(ByVal _Name As String, ByVal _Reason As String)
|
|
||||||
Name = _Name
|
|
||||||
Reason = _Reason
|
|
||||||
Exists = True
|
|
||||||
End Sub
|
|
||||||
Public Shared Widening Operator CType(ByVal Value As String) As UserBan
|
|
||||||
Return New UserBan(Value)
|
|
||||||
End Operator
|
|
||||||
Public Shared Widening Operator CType(ByVal b As UserBan) As String
|
|
||||||
Return b.ToString
|
|
||||||
End Operator
|
|
||||||
Public Overrides Function ToString() As String
|
|
||||||
Return $"{Name}|{Reason}"
|
|
||||||
End Function
|
|
||||||
Friend Function Info() As String
|
|
||||||
If Not Reason.IsEmptyString Then
|
|
||||||
Return $"[{Name}] ({Reason})"
|
|
||||||
Else
|
|
||||||
Return Name
|
|
||||||
End If
|
|
||||||
End Function
|
|
||||||
Public Overrides Function Equals(ByVal Obj As Object) As Boolean
|
|
||||||
If Not IsNothing(Obj) Then
|
|
||||||
If TypeOf Obj Is UserBan Then
|
|
||||||
Return Name = DirectCast(Obj, UserBan).Name
|
|
||||||
Else
|
|
||||||
Return Name = New UserBan(CStr(Obj)).Name
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Return False
|
|
||||||
End Function
|
|
||||||
End Structure
|
|
||||||
Friend Function UserBanned(ByVal UserNames() As String) As String()
|
|
||||||
If UserNames.ListExists Then
|
|
||||||
Dim i%
|
|
||||||
Dim Found As New List(Of UserBan)
|
|
||||||
For Each user In UserNames
|
|
||||||
i = Settings.BlackList.FindIndex(Function(u) u.Name = user)
|
|
||||||
If i >= 0 Then Found.Add(Settings.BlackList(i))
|
|
||||||
Next
|
|
||||||
If Found.Count = 0 Then
|
|
||||||
Return New String() {}
|
|
||||||
Else
|
|
||||||
Dim m As New MMessage With {
|
|
||||||
.Title = "Banned user found",
|
|
||||||
.Buttons = {"Remove from ban and add", "Leave in ban and add", "Skip"},
|
|
||||||
.Style = MsgBoxStyle.Exclamation,
|
|
||||||
.Exists = True
|
|
||||||
}
|
|
||||||
If Found.Count = 1 Then
|
|
||||||
m.Text = $"This user is banned:{vbNewLine}User: {Found(0).Name}"
|
|
||||||
If Not Found(0).Reason.IsEmptyString Then m.Text.StringAppendLine($"Reason: {Found(0).Reason}")
|
|
||||||
Else
|
|
||||||
m.Text = $"These users was banned:{vbNewLine.StringDup(2)}{Found.Select(Function(u) u.Info).ListToString(vbNewLine)}"
|
|
||||||
End If
|
|
||||||
Dim r% = MsgBoxE(m)
|
|
||||||
If r = 2 Then
|
|
||||||
Return Found.Select(Function(u) u.Name).ToArray
|
|
||||||
Else
|
|
||||||
If r = 0 Then
|
|
||||||
Settings.BlackList.ListDisposeRemove(Found)
|
|
||||||
Settings.UpdateBlackList()
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Return New String() {}
|
|
||||||
End Function
|
|
||||||
Friend Function UserBanned(ByVal UserName As String) As Boolean
|
|
||||||
Return UserBanned({UserName}).ListExists
|
|
||||||
End Function
|
|
||||||
#End Region
|
#End Region
|
||||||
Friend Sub CheckVersion(ByVal Force As Boolean)
|
Friend Sub CheckVersion(ByVal Force As Boolean)
|
||||||
If Settings.CheckUpdatesAtStart Or Force Then _
|
If Settings.CheckUpdatesAtStart Or Force Then _
|
||||||
GitHub.DefaultVersionChecker(My.Application.Info.Version, "AAndyProgram", "SCrawler",
|
GitHub.DefaultVersionChecker(My.Application.Info.Version, "AAndyProgram", "SCrawler",
|
||||||
Settings.LatestVersion.Value, Settings.ShowNewVersionNotification.Value, Force)
|
Settings.LatestVersion.Value, Settings.ShowNewVersionNotification.Value, Force)
|
||||||
End Sub
|
End Sub
|
||||||
End Module
|
End Module
|
||||||
@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
|||||||
<Assembly: AssemblyDescription("Social networks media downloader")>
|
<Assembly: AssemblyDescription("Social networks media downloader")>
|
||||||
<Assembly: AssemblyCompany("AndyProgram")>
|
<Assembly: AssemblyCompany("AndyProgram")>
|
||||||
<Assembly: AssemblyProduct("SCrawler")>
|
<Assembly: AssemblyProduct("SCrawler")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
<Assembly: AssemblyCopyright("Copyright © 2022")>
|
||||||
<Assembly: AssemblyTrademark("AndyProgram")>
|
<Assembly: AssemblyTrademark("AndyProgram")>
|
||||||
|
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2022.7.7.0")>
|
<Assembly: AssemblyVersion("2022.8.22.0")>
|
||||||
<Assembly: AssemblyFileVersion("2022.7.7.0")>
|
<Assembly: AssemblyFileVersion("2022.8.22.0")>
|
||||||
<Assembly: NeutralResourcesLanguage("en")>
|
<Assembly: NeutralResourcesLanguage("en")>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ Namespace Plugin.Hosts
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.SendInLog, ex, "[PluginHost.New]")
|
ErrorsDescriber.Execute(EDP.SendInLog, ex, $"[PluginHost.New({AssemblyFile})]")
|
||||||
_HasError = True
|
_HasError = True
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
@@ -93,7 +93,7 @@ Namespace Plugin.Hosts
|
|||||||
End If
|
End If
|
||||||
Return pList
|
Return pList
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.SendInLog, ex, "[PluginHost.GetPluginsHosts]")
|
ErrorsDescriber.Execute(EDP.SendInLog, ex, $"[PluginHost.GetPluginsHosts({GlobalPath})]")
|
||||||
Return Nothing
|
Return Nothing
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ Namespace Plugin.Hosts
|
|||||||
Friend Sub DisposeControl()
|
Friend Sub DisposeControl()
|
||||||
If Not Control Is Nothing Then Control.Dispose() : Control = Nothing
|
If Not Control Is Nothing Then Control.Dispose() : Control = Nothing
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub TextBoxClick(ByVal Sender As ActionButton)
|
Private Sub TextBoxClick(ByVal Sender As ActionButton, ByVal e As EventArgs)
|
||||||
Try
|
Try
|
||||||
If Sender.DefaultButton = ADB.Refresh AndAlso Not Source Is Nothing AndAlso Not UpdateMethod Is Nothing Then
|
If Sender.DefaultButton = ADB.Refresh AndAlso Not Source Is Nothing AndAlso Not UpdateMethod Is Nothing Then
|
||||||
If CBool(UpdateMethod.Invoke(Source, Nothing)) Then
|
If CBool(UpdateMethod.Invoke(Source, Nothing)) Then
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
'
|
'
|
||||||
' This program is distributed in the hope that it will be useful,
|
' This program is distributed in the hope that it will be useful,
|
||||||
' but WITHOUT ANY WARRANTY
|
' but WITHOUT ANY WARRANTY
|
||||||
Imports PersonalUtilities.Functions.XML
|
|
||||||
Imports SCrawler.API.Base
|
|
||||||
Imports System.Threading
|
Imports System.Threading
|
||||||
Imports System.Reflection
|
Imports System.Reflection
|
||||||
|
Imports PersonalUtilities.Functions.XML
|
||||||
|
Imports SCrawler.API.Base
|
||||||
Imports UStates = SCrawler.Plugin.PluginUserMedia.States
|
Imports UStates = SCrawler.Plugin.PluginUserMedia.States
|
||||||
Imports UTypes = SCrawler.Plugin.PluginUserMedia.Types
|
Imports UTypes = SCrawler.Plugin.PluginUserMedia.Types
|
||||||
Namespace Plugin.Hosts
|
Namespace Plugin.Hosts
|
||||||
|
|||||||
@@ -30,6 +30,10 @@
|
|||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.16299.0</TargetPlatformVersion>
|
||||||
|
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@@ -308,6 +312,7 @@
|
|||||||
<Compile Include="PluginsEnvironment\Hosts\SettingsHost.vb" />
|
<Compile Include="PluginsEnvironment\Hosts\SettingsHost.vb" />
|
||||||
<Compile Include="SettingsCLS.vb" />
|
<Compile Include="SettingsCLS.vb" />
|
||||||
<Compile Include="Download\TDownloader.vb" />
|
<Compile Include="Download\TDownloader.vb" />
|
||||||
|
<Compile Include="UserBan.vb" />
|
||||||
<Compile Include="UserImage.vb" />
|
<Compile Include="UserImage.vb" />
|
||||||
<Compile Include="Download\VideosDownloaderForm.Designer.vb">
|
<Compile Include="Download\VideosDownloaderForm.Designer.vb">
|
||||||
<DependentUpon>VideosDownloaderForm.vb</DependentUpon>
|
<DependentUpon>VideosDownloaderForm.vb</DependentUpon>
|
||||||
@@ -315,6 +320,7 @@
|
|||||||
<Compile Include="Download\VideosDownloaderForm.vb">
|
<Compile Include="Download\VideosDownloaderForm.vb">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="UserInfo.vb" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="API\Instagram\OptionsForm.resx">
|
<EmbeddedResource Include="API\Instagram\OptionsForm.resx">
|
||||||
|
|||||||
@@ -70,8 +70,10 @@ Friend Class SettingsCLS : Implements IDisposable
|
|||||||
If tmpPluginList.ListExists Then Plugins.AddRange(tmpPluginList)
|
If tmpPluginList.ListExists Then Plugins.AddRange(tmpPluginList)
|
||||||
|
|
||||||
FastProfilesLoading = New XMLValue(Of Boolean)("FastProfilesLoading", False, MyXML)
|
FastProfilesLoading = New XMLValue(Of Boolean)("FastProfilesLoading", False, MyXML)
|
||||||
MaxLargeImageHeigh = New XMLValue(Of Integer)("MaxLargeImageHeigh", 150, MyXML)
|
MaxLargeImageHeight = New XMLValue(Of Integer)("MaxLargeImageHeight", 150, MyXML)
|
||||||
MaxSmallImageHeigh = New XMLValue(Of Integer)("MaxSmallImageHeigh", 15, MyXML)
|
MaxLargeImageHeight.ReplaceByValue("MaxLargeImageHeigh",, MyXML)
|
||||||
|
MaxSmallImageHeight = New XMLValue(Of Integer)("MaxSmallImageHeight", 15, MyXML)
|
||||||
|
MaxSmallImageHeight.ReplaceByValue("MaxSmallImageHeigh",, MyXML)
|
||||||
DownloadOpenInfo = New XMLValueAttribute(Of Boolean, Boolean)("DownloadOpenInfo", "OpenAgain", False, False, MyXML)
|
DownloadOpenInfo = New XMLValueAttribute(Of Boolean, Boolean)("DownloadOpenInfo", "OpenAgain", False, False, MyXML)
|
||||||
DownloadOpenProgress = New XMLValueAttribute(Of Boolean, Boolean)("DownloadOpenProgress", "OpenAgain", False, False, MyXML)
|
DownloadOpenProgress = New XMLValueAttribute(Of Boolean, Boolean)("DownloadOpenProgress", "OpenAgain", False, False, MyXML)
|
||||||
DownloadsCompleteCommand = New XMLValueAttribute(Of String, Boolean)("DownloadsCompleteCommand", "Use",,, MyXML)
|
DownloadsCompleteCommand = New XMLValueAttribute(Of String, Boolean)("DownloadsCompleteCommand", "Use",,, MyXML)
|
||||||
@@ -119,7 +121,7 @@ Friend Class SettingsCLS : Implements IDisposable
|
|||||||
AddHandler FileAddTimeToFileName.OnValueChanged, AddressOf ChangeDateProvider
|
AddHandler FileAddTimeToFileName.OnValueChanged, AddressOf ChangeDateProvider
|
||||||
FileDateTimePositionEnd = New XMLValue(Of Boolean)("FileDateTimePositionEnd", True, MyXML, n)
|
FileDateTimePositionEnd = New XMLValue(Of Boolean)("FileDateTimePositionEnd", True, MyXML, n)
|
||||||
AddHandler FileDateTimePositionEnd.OnValueChanged, AddressOf ChangeDateProvider
|
AddHandler FileDateTimePositionEnd.OnValueChanged, AddressOf ChangeDateProvider
|
||||||
FileReplaceNameByDate = New XMLValue(Of Boolean)("FileReplaceNameByDate", False, MyXML, n)
|
FileReplaceNameByDate = New XMLValue(Of Integer)("FileReplaceNameByDate", FileNameReplaceMode.None, MyXML, n)
|
||||||
|
|
||||||
CheckUpdatesAtStart = New XMLValue(Of Boolean)("CheckUpdatesAtStart", True, MyXML)
|
CheckUpdatesAtStart = New XMLValue(Of Boolean)("CheckUpdatesAtStart", True, MyXML)
|
||||||
ShowNewVersionNotification = New XMLValue(Of Boolean)("ShowNewVersionNotification", True, MyXML)
|
ShowNewVersionNotification = New XMLValue(Of Boolean)("ShowNewVersionNotification", True, MyXML)
|
||||||
@@ -151,7 +153,11 @@ Friend Class SettingsCLS : Implements IDisposable
|
|||||||
If FileAddDateToFileName Then p = "yyyyMMdd"
|
If FileAddDateToFileName Then p = "yyyyMMdd"
|
||||||
If FileAddTimeToFileName Then p.StringAppend("HHmmss", "_")
|
If FileAddTimeToFileName Then p.StringAppend("HHmmss", "_")
|
||||||
If Not p.IsEmptyString Then FileDateAppenderProvider = New ADateTime(p) Else FileDateAppenderProvider = New ADateTime("yyyyMMdd_HHmmss")
|
If Not p.IsEmptyString Then FileDateAppenderProvider = New ADateTime(p) Else FileDateAppenderProvider = New ADateTime("yyyyMMdd_HHmmss")
|
||||||
If FileDateTimePositionEnd Then FileDateAppenderPattern = "{0}_{1}" Else FileDateAppenderPattern = "{1}_{0}"
|
If FileReplaceNameByDate.Value = FileNameReplaceMode.Replace Then
|
||||||
|
FileDateAppenderPattern = "{1}"
|
||||||
|
Else
|
||||||
|
If FileDateTimePositionEnd Then FileDateAppenderPattern = "{0}_{1}" Else FileDateAppenderPattern = "{1}_{0}"
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
#Region "Script"
|
#Region "Script"
|
||||||
@@ -378,7 +384,7 @@ Friend Class SettingsCLS : Implements IDisposable
|
|||||||
Friend ReadOnly Property CollectionsPathF As SFile
|
Friend ReadOnly Property CollectionsPathF As SFile
|
||||||
Get
|
Get
|
||||||
If GlobalPath.IsEmptyString Then
|
If GlobalPath.IsEmptyString Then
|
||||||
Throw New ArgumentNullException("GlobalPath", "GlobalPath does not set")
|
Throw New ArgumentNullException("GlobalPath", "GlobalPath not set")
|
||||||
Else
|
Else
|
||||||
Return SFile.GetPath($"{GlobalPath.Value.PathWithSeparator}{CollectionsPath.Value}")
|
Return SFile.GetPath($"{GlobalPath.Value.PathWithSeparator}{CollectionsPath.Value}")
|
||||||
End If
|
End If
|
||||||
@@ -402,13 +408,13 @@ Friend Class SettingsCLS : Implements IDisposable
|
|||||||
Friend ReadOnly Property FileAddDateToFileName As XMLValue(Of Boolean)
|
Friend ReadOnly Property FileAddDateToFileName As XMLValue(Of Boolean)
|
||||||
Friend ReadOnly Property FileAddTimeToFileName As XMLValue(Of Boolean)
|
Friend ReadOnly Property FileAddTimeToFileName As XMLValue(Of Boolean)
|
||||||
Friend ReadOnly Property FileDateTimePositionEnd As XMLValue(Of Boolean)
|
Friend ReadOnly Property FileDateTimePositionEnd As XMLValue(Of Boolean)
|
||||||
Friend ReadOnly Property FileReplaceNameByDate As XMLValue(Of Boolean)
|
Friend ReadOnly Property FileReplaceNameByDate As XMLValue(Of Integer)
|
||||||
#End Region
|
#End Region
|
||||||
#End Region
|
#End Region
|
||||||
#Region "View"
|
#Region "View"
|
||||||
Friend ReadOnly Property FastProfilesLoading As XMLValue(Of Boolean)
|
Friend ReadOnly Property FastProfilesLoading As XMLValue(Of Boolean)
|
||||||
Friend ReadOnly Property MaxLargeImageHeigh As XMLValue(Of Integer)
|
Friend ReadOnly Property MaxLargeImageHeight As XMLValue(Of Integer)
|
||||||
Friend ReadOnly Property MaxSmallImageHeigh As XMLValue(Of Integer)
|
Friend ReadOnly Property MaxSmallImageHeight As XMLValue(Of Integer)
|
||||||
Friend ReadOnly Property DownloadOpenInfo As XMLValueAttribute(Of Boolean, Boolean)
|
Friend ReadOnly Property DownloadOpenInfo As XMLValueAttribute(Of Boolean, Boolean)
|
||||||
Friend ReadOnly Property DownloadOpenProgress As XMLValueAttribute(Of Boolean, Boolean)
|
Friend ReadOnly Property DownloadOpenProgress As XMLValueAttribute(Of Boolean, Boolean)
|
||||||
Friend ReadOnly Property DownloadsCompleteCommand As XMLValueAttribute(Of String, Boolean)
|
Friend ReadOnly Property DownloadsCompleteCommand As XMLValueAttribute(Of String, Boolean)
|
||||||
@@ -481,6 +487,7 @@ Friend Class SettingsCLS : Implements IDisposable
|
|||||||
DeleteCachePath()
|
DeleteCachePath()
|
||||||
End If
|
End If
|
||||||
If Not Automation Is Nothing Then Automation.Dispose()
|
If Not Automation Is Nothing Then Automation.Dispose()
|
||||||
|
AutoDownloader.CachePath.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.None)
|
||||||
Plugins.Clear()
|
Plugins.Clear()
|
||||||
Users.ListClearDispose
|
Users.ListClearDispose
|
||||||
UsersList.Clear()
|
UsersList.Clear()
|
||||||
|
|||||||
95
SCrawler/UserBan.vb
Normal file
95
SCrawler/UserBan.vb
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
' Copyright (C) 2022 Andy
|
||||||
|
' This program is free software: you can redistribute it and/or modify
|
||||||
|
' it under the terms of the GNU General Public License as published by
|
||||||
|
' the Free Software Foundation, either version 3 of the License, or
|
||||||
|
' (at your option) any later version.
|
||||||
|
'
|
||||||
|
' This program is distributed in the hope that it will be useful,
|
||||||
|
' but WITHOUT ANY WARRANTY
|
||||||
|
Partial Friend Module MainMod
|
||||||
|
Friend Structure UserBan
|
||||||
|
Friend ReadOnly Name As String
|
||||||
|
Friend ReadOnly Reason As String
|
||||||
|
Friend ReadOnly Exists As Boolean
|
||||||
|
Friend Sub New(ByVal Value As String)
|
||||||
|
If Not Value.IsEmptyString Then
|
||||||
|
Dim v$() = Value.Split("|")
|
||||||
|
If v.ListExists Then
|
||||||
|
Name = v(0)
|
||||||
|
If v.Length > 1 Then Reason = v(1)
|
||||||
|
Exists = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Friend Sub New(ByVal _Name As String, ByVal _Reason As String)
|
||||||
|
Name = _Name
|
||||||
|
Reason = _Reason
|
||||||
|
Exists = True
|
||||||
|
End Sub
|
||||||
|
Public Shared Widening Operator CType(ByVal Value As String) As UserBan
|
||||||
|
Return New UserBan(Value)
|
||||||
|
End Operator
|
||||||
|
Public Shared Widening Operator CType(ByVal b As UserBan) As String
|
||||||
|
Return b.ToString
|
||||||
|
End Operator
|
||||||
|
Public Overrides Function ToString() As String
|
||||||
|
Return $"{Name}|{Reason}"
|
||||||
|
End Function
|
||||||
|
Friend Function Info() As String
|
||||||
|
If Not Reason.IsEmptyString Then
|
||||||
|
Return $"[{Name}] ({Reason})"
|
||||||
|
Else
|
||||||
|
Return Name
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
Public Overrides Function Equals(ByVal Obj As Object) As Boolean
|
||||||
|
If Not IsNothing(Obj) Then
|
||||||
|
If TypeOf Obj Is UserBan Then
|
||||||
|
Return Name = DirectCast(Obj, UserBan).Name
|
||||||
|
Else
|
||||||
|
Return Name = New UserBan(CStr(Obj)).Name
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
End Structure
|
||||||
|
Friend Function UserBanned(ByVal UserNames() As String) As String()
|
||||||
|
If UserNames.ListExists Then
|
||||||
|
Dim i%
|
||||||
|
Dim Found As New List(Of UserBan)
|
||||||
|
For Each user In UserNames
|
||||||
|
i = Settings.BlackList.FindIndex(Function(u) u.Name = user)
|
||||||
|
If i >= 0 Then Found.Add(Settings.BlackList(i))
|
||||||
|
Next
|
||||||
|
If Found.Count = 0 Then
|
||||||
|
Return New String() {}
|
||||||
|
Else
|
||||||
|
Dim m As New MMessage With {
|
||||||
|
.Title = "Banned user found",
|
||||||
|
.Buttons = {"Remove from ban and add", "Leave in ban and add", "Skip"},
|
||||||
|
.Style = MsgBoxStyle.Exclamation,
|
||||||
|
.Exists = True
|
||||||
|
}
|
||||||
|
If Found.Count = 1 Then
|
||||||
|
m.Text = $"This user is banned:{vbNewLine}User: {Found(0).Name}"
|
||||||
|
If Not Found(0).Reason.IsEmptyString Then m.Text.StringAppendLine($"Reason: {Found(0).Reason}")
|
||||||
|
Else
|
||||||
|
m.Text = $"These users have been banned:{vbNewLine.StringDup(2)}{Found.Select(Function(u) u.Info).ListToString(vbNewLine)}"
|
||||||
|
End If
|
||||||
|
Dim r% = MsgBoxE(m)
|
||||||
|
If r = 2 Then
|
||||||
|
Return Found.Select(Function(u) u.Name).ToArray
|
||||||
|
Else
|
||||||
|
If r = 0 Then
|
||||||
|
Settings.BlackList.ListDisposeRemove(Found)
|
||||||
|
Settings.UpdateBlackList()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return New String() {}
|
||||||
|
End Function
|
||||||
|
Friend Function UserBanned(ByVal UserName As String) As Boolean
|
||||||
|
Return UserBanned({UserName}).ListExists
|
||||||
|
End Function
|
||||||
|
End Module
|
||||||
@@ -25,8 +25,8 @@ Friend Class UserImage : Inherits ImageRenderer
|
|||||||
_SmallAddress = Address
|
_SmallAddress = Address
|
||||||
_SmallAddress.Name &= ImagePostfix_Small
|
_SmallAddress.Name &= ImagePostfix_Small
|
||||||
If GenerateLargeSmallPictures Then
|
If GenerateLargeSmallPictures Then
|
||||||
GetImage(Settings.MaxSmallImageHeigh.Value, True)
|
GetImage(Settings.MaxSmallImageHeight.Value, True)
|
||||||
GetImage(Settings.MaxLargeImageHeigh.Value, False)
|
GetImage(Settings.MaxLargeImageHeight.Value, False)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Friend Sub New(ByVal _ImgOriginal As SFile, ByVal _ImgLarge As SFile, ByVal _ImgSmall As SFile, ByVal Destination As SFile)
|
Friend Sub New(ByVal _ImgOriginal As SFile, ByVal _ImgLarge As SFile, ByVal _ImgSmall As SFile, ByVal Destination As SFile)
|
||||||
@@ -39,27 +39,15 @@ Friend Class UserImage : Inherits ImageRenderer
|
|||||||
_SmallAddress = _ImgSmall
|
_SmallAddress = _ImgSmall
|
||||||
End Sub
|
End Sub
|
||||||
''' <inheritdoc cref="GetImage(Integer, Boolean)"/>
|
''' <inheritdoc cref="GetImage(Integer, Boolean)"/>
|
||||||
Friend ReadOnly Property SmallSize As Size
|
|
||||||
Get
|
|
||||||
Return GetImage(Settings.MaxSmallImageHeigh.Value, True).Size
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
''' <inheritdoc cref="GetImage(Integer, Boolean)"/>
|
|
||||||
Friend ReadOnly Property Small As ImageRenderer
|
Friend ReadOnly Property Small As ImageRenderer
|
||||||
Get
|
Get
|
||||||
Return GetImage(Settings.MaxSmallImageHeigh.Value, True)
|
Return GetImage(Settings.MaxSmallImageHeight.Value, True)
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
''' <inheritdoc cref="GetImage(Integer, Boolean)"/>
|
|
||||||
Friend ReadOnly Property LargeSize As Size
|
|
||||||
Get
|
|
||||||
Return GetImage(Settings.MaxLargeImageHeigh.Value, False).Size
|
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
''' <inheritdoc cref="GetImage(Integer, Boolean)"/>
|
''' <inheritdoc cref="GetImage(Integer, Boolean)"/>
|
||||||
Friend ReadOnly Property Large As ImageRenderer
|
Friend ReadOnly Property Large As ImageRenderer
|
||||||
Get
|
Get
|
||||||
Return GetImage(Settings.MaxLargeImageHeigh.Value, False)
|
Return GetImage(Settings.MaxLargeImageHeight.Value, False)
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
''' <exception cref="ArgumentNullException"></exception>
|
''' <exception cref="ArgumentNullException"></exception>
|
||||||
|
|||||||
148
SCrawler/UserInfo.vb
Normal file
148
SCrawler/UserInfo.vb
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
' Copyright (C) 2022 Andy
|
||||||
|
' This program is free software: you can redistribute it and/or modify
|
||||||
|
' it under the terms of the GNU General Public License as published by
|
||||||
|
' the Free Software Foundation, either version 3 of the License, or
|
||||||
|
' (at your option) any later version.
|
||||||
|
'
|
||||||
|
' This program is distributed in the hope that it will be useful,
|
||||||
|
' but WITHOUT ANY WARRANTY
|
||||||
|
Imports PersonalUtilities.Functions.XML
|
||||||
|
Imports PersonalUtilities.Functions.XML.Base
|
||||||
|
Imports SCrawler.API
|
||||||
|
Imports SCrawler.API.Base
|
||||||
|
Imports SCrawler.Plugin.Hosts
|
||||||
|
Imports DownOptions = SCrawler.Plugin.ISiteSettings.Download
|
||||||
|
Partial Friend Module MainMod
|
||||||
|
Friend Structure UserInfo : Implements IComparable(Of UserInfo), IEquatable(Of UserInfo), ICloneable, IEContainerProvider
|
||||||
|
Friend Const Name_Site As String = "Site"
|
||||||
|
Friend Const Name_Plugin As String = "Plugin"
|
||||||
|
Friend Const Name_Collection As String = "Collection"
|
||||||
|
Friend Const Name_Merged As String = "Merged"
|
||||||
|
Friend Const Name_IsChannel As String = "IsChannel"
|
||||||
|
Friend Const Name_SpecialPath As String = "SpecialPath"
|
||||||
|
Friend Name As String
|
||||||
|
Friend Site As String
|
||||||
|
Friend Plugin As String
|
||||||
|
Friend File As SFile
|
||||||
|
Friend SpecialPath As SFile
|
||||||
|
Friend Merged As Boolean
|
||||||
|
Friend IncludedInCollection As Boolean
|
||||||
|
Friend CollectionName As String
|
||||||
|
Friend IsChannel As Boolean
|
||||||
|
Friend [Protected] As Boolean
|
||||||
|
Friend ReadOnly Property DownloadOption As DownOptions
|
||||||
|
Get
|
||||||
|
If IsChannel Then
|
||||||
|
Return DownOptions.Channel
|
||||||
|
Else
|
||||||
|
Return DownOptions.Main
|
||||||
|
End If
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
Friend Sub New(ByVal _Name As String, ByVal Host As SettingsHost, Optional ByVal Collection As String = Nothing,
|
||||||
|
Optional ByVal _Merged As Boolean = False, Optional ByVal _SpecialPath As SFile = Nothing)
|
||||||
|
Name = _Name
|
||||||
|
Site = Host.Name
|
||||||
|
Plugin = Host.Key
|
||||||
|
IncludedInCollection = Not Collection.IsEmptyString
|
||||||
|
CollectionName = Collection
|
||||||
|
Merged = _Merged
|
||||||
|
SpecialPath = _SpecialPath
|
||||||
|
UpdateUserFile()
|
||||||
|
End Sub
|
||||||
|
Private Sub New(ByVal x As EContainer)
|
||||||
|
Name = x.Value
|
||||||
|
Site = x.Attribute(Name_Site).Value
|
||||||
|
Plugin = x.Attribute(Name_Plugin).Value
|
||||||
|
CollectionName = x.Attribute(Name_Collection).Value
|
||||||
|
IncludedInCollection = Not CollectionName.IsEmptyString
|
||||||
|
Merged = x.Attribute(Name_Merged).Value.FromXML(Of Boolean)(False)
|
||||||
|
SpecialPath = SFile.GetPath(x.Attribute(Name_SpecialPath).Value)
|
||||||
|
IsChannel = x.Attribute(Name_IsChannel).Value.FromXML(Of Boolean)(False)
|
||||||
|
'UpdateUserFile()
|
||||||
|
End Sub
|
||||||
|
Friend Sub New(ByVal c As Reddit.Channel)
|
||||||
|
Name = c.Name
|
||||||
|
Site = Reddit.RedditSite
|
||||||
|
Plugin = Reddit.RedditSiteKey
|
||||||
|
File = c.File
|
||||||
|
IsChannel = True
|
||||||
|
End Sub
|
||||||
|
Public Shared Widening Operator CType(ByVal x As EContainer) As UserInfo
|
||||||
|
Return New UserInfo(x)
|
||||||
|
End Operator
|
||||||
|
Public Shared Widening Operator CType(ByVal u As UserInfo) As String
|
||||||
|
Return u.Name
|
||||||
|
End Operator
|
||||||
|
Public Shared Operator =(ByVal x As UserInfo, ByVal y As UserInfo)
|
||||||
|
Return x.Equals(y)
|
||||||
|
End Operator
|
||||||
|
Public Shared Operator <>(ByVal x As UserInfo, ByVal y As UserInfo)
|
||||||
|
Return Not x.Equals(y)
|
||||||
|
End Operator
|
||||||
|
Public Overrides Function ToString() As String
|
||||||
|
Return Name
|
||||||
|
End Function
|
||||||
|
Friend Sub UpdateUserFile()
|
||||||
|
File = New SFile With {
|
||||||
|
.Separator = "\",
|
||||||
|
.Path = GetFilePathByParams(),
|
||||||
|
.Extension = "xml",
|
||||||
|
.Name = $"{UserDataBase.UserFileAppender}_{Site}_{Name}"
|
||||||
|
}
|
||||||
|
End Sub
|
||||||
|
Private Function GetFilePathByParams() As String
|
||||||
|
If [Protected] Then Return String.Empty
|
||||||
|
If Not SpecialPath.IsEmptyString Then
|
||||||
|
Return $"{SpecialPath.PathWithSeparator}{SettingsFolderName}"
|
||||||
|
ElseIf Merged And IncludedInCollection Then
|
||||||
|
Return $"{Settings.CollectionsPathF.PathNoSeparator}\{CollectionName}\{SettingsFolderName}"
|
||||||
|
Else
|
||||||
|
If IncludedInCollection Then
|
||||||
|
Return $"{Settings.CollectionsPathF.PathNoSeparator}\{CollectionName}\{Site}_{Name}\{SettingsFolderName}"
|
||||||
|
ElseIf Not Settings(Plugin) Is Nothing Then
|
||||||
|
Return $"{Settings(Plugin).Path.PathNoSeparator}\{Name}\{SettingsFolderName}"
|
||||||
|
Else
|
||||||
|
Dim s$ = Site.ToLower
|
||||||
|
Dim i% = Settings.Plugins.FindIndex(Function(p) p.Name.ToLower = s)
|
||||||
|
If i >= 0 Then Return $"{Settings.Plugins(i).Settings.Path.PathNoSeparator}\{Name}\{SettingsFolderName}" Else Return String.Empty
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
Friend Function GetContainer(Optional ByVal e As ErrorsDescriber = Nothing) As EContainer Implements IEContainerProvider.ToEContainer
|
||||||
|
Return New EContainer("User", Name, {New EAttribute(Name_Site, Site),
|
||||||
|
New EAttribute(Name_Plugin, Plugin),
|
||||||
|
New EAttribute(Name_Collection, CollectionName),
|
||||||
|
New EAttribute(Name_Merged, Merged.BoolToInteger),
|
||||||
|
New EAttribute(Name_IsChannel, IsChannel.BoolToInteger),
|
||||||
|
New EAttribute(Name_SpecialPath, SpecialPath.PathWithSeparator)})
|
||||||
|
End Function
|
||||||
|
Friend Function CompareTo(ByVal Other As UserInfo) As Integer Implements IComparable(Of UserInfo).CompareTo
|
||||||
|
If Site = Other.Site Then
|
||||||
|
Return Name.CompareTo(Other.Name)
|
||||||
|
Else
|
||||||
|
Return Site.CompareTo(Other.Site)
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
Friend Overloads Function Equals(ByVal Other As UserInfo) As Boolean Implements IEquatable(Of UserInfo).Equals
|
||||||
|
Return Site = Other.Site And Name = Other.Name
|
||||||
|
End Function
|
||||||
|
Public Overloads Overrides Function Equals(ByVal Obj As Object) As Boolean
|
||||||
|
Return Equals(DirectCast(Obj, UserInfo))
|
||||||
|
End Function
|
||||||
|
Friend Function Clone() As Object Implements ICloneable.Clone
|
||||||
|
Return New UserInfo With {
|
||||||
|
.Name = Name,
|
||||||
|
.Site = Site,
|
||||||
|
.Plugin = Plugin,
|
||||||
|
.File = File,
|
||||||
|
.SpecialPath = SpecialPath,
|
||||||
|
.Merged = Merged,
|
||||||
|
.IncludedInCollection = IncludedInCollection,
|
||||||
|
.CollectionName = CollectionName,
|
||||||
|
.IsChannel = IsChannel,
|
||||||
|
.[Protected] = [Protected]
|
||||||
|
}
|
||||||
|
End Function
|
||||||
|
End Structure
|
||||||
|
End Module
|
||||||
Reference in New Issue
Block a user