mirror of
https://github.com/AAndyProgram/SCrawler.git
synced 2026-03-15 08:12:17 +00:00
2022.11.16.0
Add sites: PornHub, XHamster Add saved xvideos posts downloading PluginProvider: added TaskGroup attribute; added IUserMedia inteface; changed PluginUserMedia to IUserMedia in interface declarations; changed 'User' String to IPluginContentProvider in ISiteSettings sinterface Added update the 'LOG' button at the end of the ProfileSaved download function API.Base: added 'IUserMedia' compatibility for 'UserMedia'; moved 'GetImage' from 'UserPost' to 'ChannelsViewForm'; update constants in UserDataBase; updated UserDataBase to new UserInfo environment. API.Instagram.UserData: fixed date issue API.Reddit.SiteSettings: update user patterns API.Twitter.Declarations: moved provider here from MainFrame UserDataBind: updated to new UserInfo environment ActiveDownloadingProgress: updated form rendering AutoDownloader: added SpecialDelay TDownloader: added 'Suspended' option; updated for TaskGroups CollectionEditorForm: fixed order bug LabelsForm: remove old stuff UserEditorForm: added collection editing MainFrame: improve label selection Add import users Added the ability to create a virtual collection and add a virtual user to a real collection SettingsCLS: improve users loading
This commit is contained in:
@@ -15,22 +15,38 @@ Imports DownOptions = SCrawler.Plugin.ISiteSettings.Download
|
||||
Partial Friend Module MainMod
|
||||
Friend Structure UserInfo : Implements IComparable(Of UserInfo), IEquatable(Of UserInfo), ICloneable, IEContainerProvider
|
||||
#Region "XML Names"
|
||||
Friend Const Name_UserNode As String = "User"
|
||||
Friend Const Name_Site As String = "Site"
|
||||
Friend Const Name_Plugin As String = "Plugin"
|
||||
Friend Const Name_Collection As String = "Collection"
|
||||
Friend Const Name_Model_User As String = "ModelUser"
|
||||
Friend Const Name_Model_Collection As String = "ModelCollection"
|
||||
Friend Const Name_Merged As String = "Merged"
|
||||
Friend Const Name_IsChannel As String = "IsChannel"
|
||||
Friend Const Name_SpecialPath As String = "SpecialPath"
|
||||
Friend Const Name_UserNode As String = "User"
|
||||
Friend Const Name_SpecialCollectionPath As String = "SpecialCollectionPath"
|
||||
#End Region
|
||||
#Region "Declarations"
|
||||
Friend Name As String
|
||||
Friend Site As String
|
||||
Friend Plugin As String
|
||||
Friend File As SFile
|
||||
Friend SpecialPath As SFile
|
||||
Friend SpecialCollectionPath As SFile
|
||||
Friend Merged As Boolean
|
||||
Friend IncludedInCollection As Boolean
|
||||
Friend ReadOnly Property IncludedInCollection As Boolean
|
||||
Get
|
||||
Return Not CollectionName.IsEmptyString
|
||||
End Get
|
||||
End Property
|
||||
Friend ReadOnly Property IsVirual As Boolean
|
||||
Get
|
||||
Return CollectionModel = UsageModel.Virtual Or UserModel = UsageModel.Virtual
|
||||
End Get
|
||||
End Property
|
||||
Friend UserModel As UsageModel
|
||||
Friend CollectionName As String
|
||||
Friend CollectionModel As UsageModel
|
||||
Friend IsChannel As Boolean
|
||||
Friend [Protected] As Boolean
|
||||
Friend ReadOnly Property DownloadOption As DownOptions
|
||||
@@ -42,15 +58,12 @@ Partial Friend Module MainMod
|
||||
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)
|
||||
#End Region
|
||||
#Region "Initializers"
|
||||
Friend Sub New(ByVal _Name As String, ByVal Host As SettingsHost)
|
||||
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)
|
||||
@@ -58,9 +71,11 @@ Partial Friend Module MainMod
|
||||
Site = x.Attribute(Name_Site).Value
|
||||
Plugin = x.Attribute(Name_Plugin).Value
|
||||
CollectionName = x.Attribute(Name_Collection).Value
|
||||
IncludedInCollection = Not CollectionName.IsEmptyString
|
||||
CollectionModel = x.Attribute(Name_Model_Collection).Value.FromXML(Of Integer)(UsageModel.Default)
|
||||
UserModel = x.Attribute(Name_Model_User).Value.FromXML(Of Integer)(UsageModel.Default)
|
||||
Merged = x.Attribute(Name_Merged).Value.FromXML(Of Boolean)(False)
|
||||
SpecialPath = SFile.GetPath(x.Attribute(Name_SpecialPath).Value)
|
||||
SpecialCollectionPath = SFile.GetPath(x.Attribute(Name_SpecialCollectionPath).Value)
|
||||
IsChannel = x.Attribute(Name_IsChannel).Value.FromXML(Of Boolean)(False)
|
||||
End Sub
|
||||
Friend Sub New(ByVal c As Reddit.Channel)
|
||||
@@ -76,15 +91,21 @@ Partial Friend Module MainMod
|
||||
Public Shared Widening Operator CType(ByVal u As UserInfo) As String
|
||||
Return u.Name
|
||||
End Operator
|
||||
#End Region
|
||||
#Region "Operators"
|
||||
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
|
||||
#End Region
|
||||
#Region "ToString"
|
||||
Public Overrides Function ToString() As String
|
||||
Return Name
|
||||
End Function
|
||||
#End Region
|
||||
#Region "FilePath"
|
||||
Friend Sub UpdateUserFile()
|
||||
File = New SFile With {
|
||||
.Separator = "\",
|
||||
@@ -95,13 +116,15 @@ Partial Friend Module MainMod
|
||||
End Sub
|
||||
Private Function GetFilePathByParams() As String
|
||||
If [Protected] Then Return String.Empty
|
||||
Dim ColPath$ = If(SpecialCollectionPath.IsEmptyString, Settings.CollectionsPathF, SpecialCollectionPath).PathNoSeparator
|
||||
If SpecialCollectionPath.IsEmptyString Then ColPath &= $"\{CollectionName}"
|
||||
If Not SpecialPath.IsEmptyString Then
|
||||
Return $"{SpecialPath.PathWithSeparator}{SettingsFolderName}"
|
||||
ElseIf Merged And IncludedInCollection Then
|
||||
Return $"{Settings.CollectionsPathF.PathNoSeparator}\{CollectionName}\{SettingsFolderName}"
|
||||
Return $"{ColPath}\{SettingsFolderName}"
|
||||
Else
|
||||
If IncludedInCollection Then
|
||||
Return $"{Settings.CollectionsPathF.PathNoSeparator}\{CollectionName}\{Site}_{Name}\{SettingsFolderName}"
|
||||
If IncludedInCollection And Not IsVirual Then
|
||||
Return $"{ColPath}\{Site}_{Name}\{SettingsFolderName}"
|
||||
ElseIf Not Settings(Plugin) Is Nothing Then
|
||||
Return $"{Settings(Plugin).Path.PathNoSeparator}\{Name}\{SettingsFolderName}"
|
||||
Else
|
||||
@@ -111,14 +134,21 @@ Partial Friend Module MainMod
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
#End Region
|
||||
#Region "ToEContainer Support"
|
||||
Friend Function ToEContainer(Optional ByVal e As ErrorsDescriber = Nothing) As EContainer Implements IEContainerProvider.ToEContainer
|
||||
Return New EContainer(Name_UserNode, Name, {New EAttribute(Name_Site, Site),
|
||||
New EAttribute(Name_Plugin, Plugin),
|
||||
New EAttribute(Name_Collection, CollectionName),
|
||||
New EAttribute(Name_Model_User, CInt(UserModel)),
|
||||
New EAttribute(Name_Model_Collection, CInt(CollectionModel)),
|
||||
New EAttribute(Name_Merged, Merged.BoolToInteger),
|
||||
New EAttribute(Name_IsChannel, IsChannel.BoolToInteger),
|
||||
New EAttribute(Name_SpecialPath, SpecialPath.PathWithSeparator)})
|
||||
New EAttribute(Name_SpecialPath, SpecialPath.PathWithSeparator),
|
||||
New EAttribute(Name_SpecialCollectionPath, SpecialCollectionPath.PathWithSeparator)})
|
||||
End Function
|
||||
#End Region
|
||||
#Region "IComparable Support"
|
||||
Friend Function CompareTo(ByVal Other As UserInfo) As Integer Implements IComparable(Of UserInfo).CompareTo
|
||||
If Site = Other.Site Then
|
||||
Return Name.CompareTo(Other.Name)
|
||||
@@ -126,12 +156,16 @@ Partial Friend Module MainMod
|
||||
Return Site.CompareTo(Other.Site)
|
||||
End If
|
||||
End Function
|
||||
#End Region
|
||||
#Region "IEquatable Support"
|
||||
Friend Overloads Function Equals(ByVal Other As UserInfo) As Boolean Implements IEquatable(Of UserInfo).Equals
|
||||
Return Site = Other.Site And Name = Other.Name
|
||||
Return Site.StringToLower = Other.Site.StringToLower And Name.StringToLower = Other.Name.StringToLower
|
||||
End Function
|
||||
Public Overloads Overrides Function Equals(ByVal Obj As Object) As Boolean
|
||||
Return Equals(DirectCast(Obj, UserInfo))
|
||||
End Function
|
||||
#End Region
|
||||
#Region "ICloneable Support"
|
||||
Friend Function Clone() As Object Implements ICloneable.Clone
|
||||
Return New UserInfo With {
|
||||
.Name = Name,
|
||||
@@ -140,11 +174,13 @@ Partial Friend Module MainMod
|
||||
.File = File,
|
||||
.SpecialPath = SpecialPath,
|
||||
.Merged = Merged,
|
||||
.IncludedInCollection = IncludedInCollection,
|
||||
.CollectionName = CollectionName,
|
||||
.CollectionModel = CollectionModel,
|
||||
.UserModel = UserModel,
|
||||
.IsChannel = IsChannel,
|
||||
.[Protected] = [Protected]
|
||||
}
|
||||
End Function
|
||||
#End Region
|
||||
End Structure
|
||||
End Module
|
||||
Reference in New Issue
Block a user