2025.6.1.0

PluginProvider
IUserMedia, PluginUserMedia: add properties 'PostText', 'PostTextFile', 'PostTextFileSpecialFolder'

YT
YouTubeFunctions: update 'Info_GetUrlType' and 'StandardizeURL' functions: add youtu.be domain
YouTubeSettings: add 'FILTER' property
Add classes 'FilterForm', 'YTDataFilter'
VideoListForm: add filters; update 'LoadData' and 'RemoveControls' functions; add hotkey 'Ctrl+F5' for refresh
YouTubeMediaContainerBase: add support for new interface properties
Minor bugs

SCrawler
DeclaredNames: add new names
EditorExchangeOptionsBase, IUserData, SiteSettingsBase, UserMedia, UserDataBase: add support for text downloading

Sites Bluesky, Instagram, OnlyFans, Reddit, ThreadsNet, Twitter: add support for text downloading
Sites Facebook, JustForFans, LPSG, Mastodon, Pinterest, PornHub, Redgifs, ThisVid, TikTok, Xhamster, XVIDEOS, YouTube (STD): disable text downloading

UserDataBase: add 'ToStringExt' functions

API.Instagram: add 'SleepTimerRequestsNextProfile' property
API.OnlyFans: update 'DynamicRules'; fix incorrect posts opening (update 'GetUserPostUrl' function); fix limited download ('DownloadTopCount')
API.Reddit: fix post date provider; add 'Best' and 'Rising' view modes; fix request (data is not downloading); set 'BearerTokenUseCurl' to 'False' by default
API.ThreadsNet: change domain from 'net' to 'com'; fix data downloading
API.TikTok: add downloading of avatar, site name and description
API.Twitter: fix JSON error; add debug options; fix downloading
API.Xhamster: add folder 'Photo' for albums

Feed: add filters; update move/copy algo; add the ability to show test posts; update table rendering; add new 'MediaItem' handlers
FeedMedia: add text options; update 'DeleteFile' function
FeedMoveCopyTo: add text option

VideoDownloaderForm: disable filter button

GlobalSettingsForm: add 'FeedShowTextPosts' and 'FeedShowTextPostsAlwaysMove' options
SettingsCLS: add feed text properties
UserImage: add 'CreateImageFromText' function
UserInfo: update 'Equals' function

Add classes: 'FeedFilter', 'FeedFilterCollection', 'FeedFilterForm'

Minor bugs and improvements
This commit is contained in:
Andy
2025-06-01 19:01:26 +03:00
parent fff63d0a9f
commit ff0c4587eb
86 changed files with 4219 additions and 1196 deletions

View File

@@ -0,0 +1,324 @@
' Copyright (C) Andy https://github.com/AAndyProgram
' 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
Namespace API.YouTube.Controls
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Friend Class FilterForm : Inherits System.Windows.Forms.Form
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
Dim TP_MAIN As System.Windows.Forms.TableLayoutPanel
Dim TP_TYPES As System.Windows.Forms.TableLayoutPanel
Dim TP_USERS As System.Windows.Forms.TableLayoutPanel
Dim TP_USERS_2 As System.Windows.Forms.TableLayoutPanel
Me.CH_FILTER_ALL = New System.Windows.Forms.CheckBox()
Me.CH_FILTER_SINGLE = New System.Windows.Forms.CheckBox()
Me.CH_FILTER_CHANNEL = New System.Windows.Forms.CheckBox()
Me.CH_FILTER_PLS = New System.Windows.Forms.CheckBox()
Me.TP_MUSIC = New System.Windows.Forms.TableLayoutPanel()
Me.CH_M_ALL = New System.Windows.Forms.CheckBox()
Me.CH_M_VIDEO = New System.Windows.Forms.CheckBox()
Me.CH_M_MUSIC = New System.Windows.Forms.CheckBox()
Me.LIST_USERS = New System.Windows.Forms.CheckedListBox()
Me.CH_USERS_USE = New System.Windows.Forms.CheckBox()
Me.BTT_SELECT_ALL = New System.Windows.Forms.Button()
Me.BTT_SELECT_NONE = New System.Windows.Forms.Button()
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
TP_MAIN = New System.Windows.Forms.TableLayoutPanel()
TP_TYPES = New System.Windows.Forms.TableLayoutPanel()
TP_USERS = New System.Windows.Forms.TableLayoutPanel()
TP_USERS_2 = New System.Windows.Forms.TableLayoutPanel()
CONTAINER_MAIN.ContentPanel.SuspendLayout()
CONTAINER_MAIN.SuspendLayout()
TP_MAIN.SuspendLayout()
TP_TYPES.SuspendLayout()
Me.TP_MUSIC.SuspendLayout()
TP_USERS.SuspendLayout()
TP_USERS_2.SuspendLayout()
Me.SuspendLayout()
'
'CONTAINER_MAIN
'
'
'CONTAINER_MAIN.ContentPanel
'
CONTAINER_MAIN.ContentPanel.Controls.Add(TP_MAIN)
CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(384, 361)
CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
CONTAINER_MAIN.LeftToolStripPanelVisible = False
CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
CONTAINER_MAIN.Name = "CONTAINER_MAIN"
CONTAINER_MAIN.RightToolStripPanelVisible = False
CONTAINER_MAIN.Size = New System.Drawing.Size(384, 361)
CONTAINER_MAIN.TabIndex = 0
CONTAINER_MAIN.TopToolStripPanelVisible = False
'
'TP_MAIN
'
TP_MAIN.ColumnCount = 1
TP_MAIN.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_MAIN.Controls.Add(TP_TYPES, 0, 0)
TP_MAIN.Controls.Add(Me.TP_MUSIC, 0, 1)
TP_MAIN.Controls.Add(TP_USERS, 0, 2)
TP_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
TP_MAIN.Location = New System.Drawing.Point(0, 0)
TP_MAIN.Name = "TP_MAIN"
TP_MAIN.RowCount = 3
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20.0!))
TP_MAIN.Size = New System.Drawing.Size(384, 361)
TP_MAIN.TabIndex = 0
'
'TP_TYPES
'
TP_TYPES.ColumnCount = 4
TP_TYPES.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0!))
TP_TYPES.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0!))
TP_TYPES.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0!))
TP_TYPES.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0!))
TP_TYPES.Controls.Add(Me.CH_FILTER_ALL, 0, 0)
TP_TYPES.Controls.Add(Me.CH_FILTER_SINGLE, 1, 0)
TP_TYPES.Controls.Add(Me.CH_FILTER_CHANNEL, 2, 0)
TP_TYPES.Controls.Add(Me.CH_FILTER_PLS, 3, 0)
TP_TYPES.Dock = System.Windows.Forms.DockStyle.Fill
TP_TYPES.Location = New System.Drawing.Point(0, 0)
TP_TYPES.Margin = New System.Windows.Forms.Padding(0)
TP_TYPES.Name = "TP_TYPES"
TP_TYPES.RowCount = 1
TP_TYPES.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_TYPES.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_TYPES.Size = New System.Drawing.Size(384, 25)
TP_TYPES.TabIndex = 0
'
'CH_FILTER_ALL
'
Me.CH_FILTER_ALL.AutoSize = True
Me.CH_FILTER_ALL.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_FILTER_ALL.Location = New System.Drawing.Point(3, 3)
Me.CH_FILTER_ALL.Name = "CH_FILTER_ALL"
Me.CH_FILTER_ALL.Size = New System.Drawing.Size(90, 19)
Me.CH_FILTER_ALL.TabIndex = 0
Me.CH_FILTER_ALL.Text = "ALL"
Me.CH_FILTER_ALL.UseVisualStyleBackColor = True
'
'CH_FILTER_SINGLE
'
Me.CH_FILTER_SINGLE.AutoSize = True
Me.CH_FILTER_SINGLE.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_FILTER_SINGLE.Location = New System.Drawing.Point(99, 3)
Me.CH_FILTER_SINGLE.Name = "CH_FILTER_SINGLE"
Me.CH_FILTER_SINGLE.Size = New System.Drawing.Size(90, 19)
Me.CH_FILTER_SINGLE.TabIndex = 1
Me.CH_FILTER_SINGLE.Text = "Single"
Me.CH_FILTER_SINGLE.UseVisualStyleBackColor = True
'
'CH_FILTER_CHANNEL
'
Me.CH_FILTER_CHANNEL.AutoSize = True
Me.CH_FILTER_CHANNEL.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_FILTER_CHANNEL.Location = New System.Drawing.Point(195, 3)
Me.CH_FILTER_CHANNEL.Name = "CH_FILTER_CHANNEL"
Me.CH_FILTER_CHANNEL.Size = New System.Drawing.Size(90, 19)
Me.CH_FILTER_CHANNEL.TabIndex = 2
Me.CH_FILTER_CHANNEL.Text = "Channel"
Me.CH_FILTER_CHANNEL.UseVisualStyleBackColor = True
'
'CH_FILTER_PLS
'
Me.CH_FILTER_PLS.AutoSize = True
Me.CH_FILTER_PLS.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_FILTER_PLS.Location = New System.Drawing.Point(291, 3)
Me.CH_FILTER_PLS.Name = "CH_FILTER_PLS"
Me.CH_FILTER_PLS.Size = New System.Drawing.Size(90, 19)
Me.CH_FILTER_PLS.TabIndex = 3
Me.CH_FILTER_PLS.Text = "Playlist"
Me.CH_FILTER_PLS.UseVisualStyleBackColor = True
'
'TP_MUSIC
'
Me.TP_MUSIC.ColumnCount = 3
Me.TP_MUSIC.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
Me.TP_MUSIC.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
Me.TP_MUSIC.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
Me.TP_MUSIC.Controls.Add(Me.CH_M_ALL, 0, 0)
Me.TP_MUSIC.Controls.Add(Me.CH_M_VIDEO, 1, 0)
Me.TP_MUSIC.Controls.Add(Me.CH_M_MUSIC, 2, 0)
Me.TP_MUSIC.Dock = System.Windows.Forms.DockStyle.Fill
Me.TP_MUSIC.Location = New System.Drawing.Point(0, 25)
Me.TP_MUSIC.Margin = New System.Windows.Forms.Padding(0)
Me.TP_MUSIC.Name = "TP_MUSIC"
Me.TP_MUSIC.RowCount = 1
Me.TP_MUSIC.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TP_MUSIC.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
Me.TP_MUSIC.Size = New System.Drawing.Size(384, 25)
Me.TP_MUSIC.TabIndex = 1
'
'CH_M_ALL
'
Me.CH_M_ALL.AutoSize = True
Me.CH_M_ALL.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_M_ALL.Location = New System.Drawing.Point(3, 3)
Me.CH_M_ALL.Name = "CH_M_ALL"
Me.CH_M_ALL.Size = New System.Drawing.Size(122, 19)
Me.CH_M_ALL.TabIndex = 0
Me.CH_M_ALL.Text = "ALL"
Me.CH_M_ALL.UseVisualStyleBackColor = True
'
'CH_M_VIDEO
'
Me.CH_M_VIDEO.AutoSize = True
Me.CH_M_VIDEO.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_M_VIDEO.Location = New System.Drawing.Point(131, 3)
Me.CH_M_VIDEO.Name = "CH_M_VIDEO"
Me.CH_M_VIDEO.Size = New System.Drawing.Size(122, 19)
Me.CH_M_VIDEO.TabIndex = 1
Me.CH_M_VIDEO.Text = "Video"
Me.CH_M_VIDEO.UseVisualStyleBackColor = True
'
'CH_M_MUSIC
'
Me.CH_M_MUSIC.AutoSize = True
Me.CH_M_MUSIC.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_M_MUSIC.Location = New System.Drawing.Point(259, 3)
Me.CH_M_MUSIC.Name = "CH_M_MUSIC"
Me.CH_M_MUSIC.Size = New System.Drawing.Size(122, 19)
Me.CH_M_MUSIC.TabIndex = 2
Me.CH_M_MUSIC.Text = "Music"
Me.CH_M_MUSIC.UseVisualStyleBackColor = True
'
'TP_USERS
'
TP_USERS.ColumnCount = 1
TP_USERS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_USERS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20.0!))
TP_USERS.Controls.Add(Me.LIST_USERS, 0, 1)
TP_USERS.Controls.Add(TP_USERS_2, 0, 0)
TP_USERS.Dock = System.Windows.Forms.DockStyle.Fill
TP_USERS.Location = New System.Drawing.Point(0, 50)
TP_USERS.Margin = New System.Windows.Forms.Padding(0)
TP_USERS.Name = "TP_USERS"
TP_USERS.RowCount = 2
TP_USERS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_USERS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_USERS.Size = New System.Drawing.Size(384, 311)
TP_USERS.TabIndex = 3
'
'LIST_USERS
'
Me.LIST_USERS.Dock = System.Windows.Forms.DockStyle.Fill
Me.LIST_USERS.FormattingEnabled = True
Me.LIST_USERS.Location = New System.Drawing.Point(3, 28)
Me.LIST_USERS.Name = "LIST_USERS"
Me.LIST_USERS.Size = New System.Drawing.Size(378, 280)
Me.LIST_USERS.TabIndex = 1
'
'TP_USERS_2
'
TP_USERS_2.ColumnCount = 3
TP_USERS_2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
TP_USERS_2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
TP_USERS_2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!))
TP_USERS_2.Controls.Add(Me.CH_USERS_USE, 0, 0)
TP_USERS_2.Controls.Add(Me.BTT_SELECT_ALL, 1, 0)
TP_USERS_2.Controls.Add(Me.BTT_SELECT_NONE, 2, 0)
TP_USERS_2.Dock = System.Windows.Forms.DockStyle.Fill
TP_USERS_2.Location = New System.Drawing.Point(0, 0)
TP_USERS_2.Margin = New System.Windows.Forms.Padding(0)
TP_USERS_2.Name = "TP_USERS_2"
TP_USERS_2.RowCount = 1
TP_USERS_2.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_USERS_2.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_USERS_2.Size = New System.Drawing.Size(384, 25)
TP_USERS_2.TabIndex = 0
'
'CH_USERS_USE
'
Me.CH_USERS_USE.AutoSize = True
Me.CH_USERS_USE.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_USERS_USE.Location = New System.Drawing.Point(3, 3)
Me.CH_USERS_USE.Name = "CH_USERS_USE"
Me.CH_USERS_USE.Size = New System.Drawing.Size(122, 19)
Me.CH_USERS_USE.TabIndex = 0
Me.CH_USERS_USE.Text = "Filter users"
Me.CH_USERS_USE.UseVisualStyleBackColor = True
'
'BTT_SELECT_ALL
'
Me.BTT_SELECT_ALL.Dock = System.Windows.Forms.DockStyle.Fill
Me.BTT_SELECT_ALL.Location = New System.Drawing.Point(129, 1)
Me.BTT_SELECT_ALL.Margin = New System.Windows.Forms.Padding(1)
Me.BTT_SELECT_ALL.Name = "BTT_SELECT_ALL"
Me.BTT_SELECT_ALL.Size = New System.Drawing.Size(126, 23)
Me.BTT_SELECT_ALL.TabIndex = 1
Me.BTT_SELECT_ALL.Text = "All"
Me.BTT_SELECT_ALL.UseVisualStyleBackColor = True
'
'BTT_SELECT_NONE
'
Me.BTT_SELECT_NONE.Dock = System.Windows.Forms.DockStyle.Fill
Me.BTT_SELECT_NONE.Location = New System.Drawing.Point(257, 1)
Me.BTT_SELECT_NONE.Margin = New System.Windows.Forms.Padding(1)
Me.BTT_SELECT_NONE.Name = "BTT_SELECT_NONE"
Me.BTT_SELECT_NONE.Size = New System.Drawing.Size(126, 23)
Me.BTT_SELECT_NONE.TabIndex = 2
Me.BTT_SELECT_NONE.Text = "None"
Me.BTT_SELECT_NONE.UseVisualStyleBackColor = True
'
'FilterForm
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(384, 361)
Me.Controls.Add(CONTAINER_MAIN)
Me.MinimizeBox = False
Me.MinimumSize = New System.Drawing.Size(400, 400)
Me.Name = "FilterForm"
Me.ShowInTaskbar = False
Me.Text = "Filter"
CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
CONTAINER_MAIN.ResumeLayout(False)
CONTAINER_MAIN.PerformLayout()
TP_MAIN.ResumeLayout(False)
TP_TYPES.ResumeLayout(False)
TP_TYPES.PerformLayout()
Me.TP_MUSIC.ResumeLayout(False)
Me.TP_MUSIC.PerformLayout()
TP_USERS.ResumeLayout(False)
TP_USERS_2.ResumeLayout(False)
TP_USERS_2.PerformLayout()
Me.ResumeLayout(False)
End Sub
Private WithEvents CH_FILTER_ALL As CheckBox
Private WithEvents CH_FILTER_SINGLE As CheckBox
Private WithEvents CH_FILTER_CHANNEL As CheckBox
Private WithEvents CH_FILTER_PLS As CheckBox
Private WithEvents TP_MUSIC As TableLayoutPanel
Private WithEvents CH_M_ALL As CheckBox
Private WithEvents CH_M_VIDEO As CheckBox
Private WithEvents CH_M_MUSIC As CheckBox
Private WithEvents LIST_USERS As CheckedListBox
Private WithEvents CH_USERS_USE As CheckBox
Private WithEvents BTT_SELECT_ALL As Button
Private WithEvents BTT_SELECT_NONE As Button
End Class
End Namespace

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_TYPES.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_USERS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_USERS_2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>

View File

@@ -0,0 +1,181 @@
' Copyright (C) Andy https://github.com/AAndyProgram
' 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 SCrawler.API.YouTube.Base
Imports SCrawler.API.YouTube.Objects
Imports PersonalUtilities.Forms
Imports SimpleUser = SCrawler.API.YouTube.Controls.YTDataFilter.SimpleUser
Namespace API.YouTube.Controls
Friend Class FilterForm
Private WithEvents MyDefs As DefaultFormOptions
Friend ReadOnly Property DATA As List(Of IYouTubeMediaContainer)
Private ReadOnly Property DataTMP As List(Of IYouTubeMediaContainer)
Private ReadOnly Property MyFilterTmp As YTDataFilter
Private ReadOnly Property MyTmpUsers As List(Of SimpleUser)
Friend Sub New(ByVal d As IEnumerable(Of IYouTubeMediaContainer))
InitializeComponent()
MyDefs = New DefaultFormOptions(Me, MyYouTubeSettings.DesignXml)
DATA = New List(Of IYouTubeMediaContainer)
DATA.ListAddList(d)
DataTMP = New List(Of IYouTubeMediaContainer)
DataTMP.ListAddList(d)
MyFilterTmp = New YTDataFilter(MyYouTubeSettings.FILTER)
MyTmpUsers = New List(Of SimpleUser)
Icon = My.Resources.FilterIcon
End Sub
Private Sub FilterForm_Load(sender As Object, e As EventArgs) Handles Me.Load
Try
With MyDefs
.MyViewInitialize()
.AddOkCancelToolbar(True)
With MyYouTubeSettings.FILTER
With .Types
If .Count = 0 Or (.Count = 1 AndAlso .Item(0) = YouTubeMediaType.Undefined) Then
CH_FILTER_ALL.Checked = True
Else
If .Contains(YouTubeMediaType.Single) Then CH_FILTER_SINGLE.Checked = True
If .Contains(YouTubeMediaType.Channel) Then CH_FILTER_CHANNEL.Checked = True
If .Contains(YouTubeMediaType.PlayList) Then CH_FILTER_PLS.Checked = True
End If
End With
If .IsMusic And .IsVideo Then
CH_M_ALL.Checked = True
Else
CH_M_MUSIC.Checked = .IsMusic
CH_M_VIDEO.Checked = .IsVideo
End If
CH_USERS_USE.Checked = .UserList.Count > 0
End With
.EndLoaderOperations()
_RefillEnabled = True
RefillList(True)
CH_USERS_USE_CheckedChanged()
End With
Catch ex As Exception
MyDefs.InvokeLoaderError(ex)
End Try
End Sub
Private Sub FilterForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
DATA.ListClearDispose
DataTMP.ListClearDispose
MyTmpUsers.ListClearDispose
End Sub
Private _RefillEnabled As Boolean = False
Private Sub RefillList(Optional ByVal Init As Boolean = False)
If Not MyDefs.Initializing And _RefillEnabled Then
ApplyFilter(MyFilterTmp, Init)
MyFilterTmp.Populate(DATA, DataTMP, CH_USERS_USE.Checked)
With DataTMP
If .Count > 0 Then
Dim tmpUsers As New List(Of SimpleUser)
tmpUsers.ListAddList(DataTMP, LAP.NotContainsOnly, CType(Function(obj As YouTubeMediaContainerBase) CType(obj, SimpleUser), Func(Of Object, Object)))
If tmpUsers.Count > 0 Then
tmpUsers.Sort()
LIST_USERS.BeginUpdate()
LIST_USERS.Items.Clear()
tmpUsers.ForEach(Sub(u) LIST_USERS.Items.Add(u, True))
If CH_USERS_USE.Checked And MyFilterTmp.UserList.Count > 0 Then
For i% = 0 To LIST_USERS.Items.Count - 1
LIST_USERS.SetItemChecked(i, MyFilterTmp.UserList.Contains(LIST_USERS.Items(i)))
Next
End If
LIST_USERS.EndUpdate()
End If
End If
End With
End If
End Sub
Private Sub ApplyFilter(ByRef Filter As YTDataFilter, ByVal Init As Boolean)
With Filter
.Reset(False, Not Init)
With .Types
If CH_FILTER_ALL.Checked Then
.Add(YouTubeMediaType.Undefined)
Else
If CH_FILTER_SINGLE.Checked Then .Add(YouTubeMediaType.Single)
If CH_FILTER_CHANNEL.Checked Then .Add(YouTubeMediaType.Channel)
If CH_FILTER_PLS.Checked Then .Add(YouTubeMediaType.PlayList)
End If
If .Count = 0 Then .Add(YouTubeMediaType.Undefined)
End With
If CH_M_ALL.Checked Then
.IsMusic = True
.IsVideo = True
Else
If CH_M_MUSIC.Checked Then .IsMusic = True
If CH_M_VIDEO.Checked Then .IsVideo = True
End If
If Not .IsVideo And Not .IsMusic Then .IsMusic = True : .IsVideo = True
If CH_USERS_USE.Checked And Not Init Then
.UserList.Clear()
If LIST_USERS.CheckedItems.Count > 0 Then
For Each item In LIST_USERS.CheckedItems : .UserList.Add(item) : Next
End If
End If
End With
End Sub
Private Sub MyDefs_ButtonOkClick(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonOkClick
ApplyFilter(MyYouTubeSettings.FILTER, False)
MyYouTubeSettings.FILTER.RemoveAll(DATA)
MyYouTubeSettings.FILTER.Update()
MyDefs.CloseForm()
End Sub
Private Sub MyDefs_ButtonDeleteClickOC(ByVal Sender As Object, ByVal e As KeyHandleEventArgs) Handles MyDefs.ButtonDeleteClickOC
With MyYouTubeSettings.FILTER : .Reset() : .Update() : End With
MyDefs.CloseForm()
End Sub
Private Sub UpdateControlOptions(ByRef CNT As CheckBox, ByVal v As Boolean)
If v Then CNT.Checked = True
CNT.Enabled = Not v
End Sub
Private Sub CH_FILTER_ALL_CheckedChanged(sender As Object, e As EventArgs) Handles CH_FILTER_ALL.CheckedChanged
_RefillEnabled = False
Dim v As Boolean = CH_FILTER_ALL.Checked
UpdateControlOptions(CH_FILTER_SINGLE, v)
UpdateControlOptions(CH_FILTER_CHANNEL, v)
UpdateControlOptions(CH_FILTER_PLS, v)
_RefillEnabled = True
RefillList()
End Sub
Private Sub CH_FILTER_SINGLE_CHANNEL_PLS_CheckedChanged(sender As Object, e As EventArgs) Handles CH_FILTER_SINGLE.CheckedChanged,
CH_FILTER_CHANNEL.CheckedChanged,
CH_FILTER_PLS.CheckedChanged
RefillList()
End Sub
Private Sub CH_M_ALL_CheckedChanged(sender As Object, e As EventArgs) Handles CH_M_ALL.CheckedChanged
_RefillEnabled = False
Dim v As Boolean = CH_M_ALL.Checked
UpdateControlOptions(CH_M_VIDEO, v)
UpdateControlOptions(CH_M_MUSIC, v)
_RefillEnabled = True
RefillList()
End Sub
Private Sub CH_M_VIDEO_MUSIC_CheckedChanged(sender As Object, e As EventArgs) Handles CH_M_VIDEO.CheckedChanged, CH_M_MUSIC.CheckedChanged
RefillList()
End Sub
Private Sub CH_USERS_USE_CheckedChanged() Handles CH_USERS_USE.CheckedChanged
LIST_USERS.Enabled = CH_USERS_USE.Checked
BTT_SELECT_ALL.Enabled = CH_USERS_USE.Checked
BTT_SELECT_NONE.Enabled = CH_USERS_USE.Checked
End Sub
Private Sub BTT_SELECT_ALL_NONE_Click(sender As Object, e As EventArgs) Handles BTT_SELECT_ALL.Click, BTT_SELECT_NONE.Click
Dim checked As Boolean = sender Is BTT_SELECT_ALL
With LIST_USERS
If .Items.Count > 0 Then
For i% = 0 To .Items.Count - 1 : .SetItemChecked(i, checked) : Next
End If
End With
End Sub
End Class
End Namespace

View File

@@ -155,7 +155,7 @@ Namespace API.YouTube.Controls
With DirectCast(MyContainer, YouTubeMediaContainerBase)
Select Case Sender.DefaultButton
Case ADB.Open
Using f As New SimpleListForm(Of String)(IIf(isLyrics, AvailableSubtitlesFormats, AvailableAudioFormats)) With {
Using f As New SimpleListForm(Of String)(If(isLyrics, AvailableSubtitlesFormats, AvailableAudioFormats)) With {
.DesignXML = DesignXML,
.DesignXMLNodeName = SimpleArraysFormNode,
.FormText = DirectCast(e.AssociatedControl, TextBoxExtended).CaptionText,

View File

@@ -0,0 +1,122 @@
' Copyright (C) Andy https://github.com/AAndyProgram
' 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 SCrawler.API.YouTube.Base
Imports SCrawler.API.YouTube.Objects
Imports PersonalUtilities.Functions.XML
Imports PersonalUtilities.Functions.XML.Base
Namespace API.YouTube.Controls
Friend Class YTDataFilter
Private Const Name_Types As String = "Types"
Private Const Name_IsMusic As String = "IsMusic"
Private Const Name_IsVideo As String = "IsVideo"
Private Const Name_UserList As String = "UserList"
Friend Structure SimpleUser : Implements IEContainerProvider, IComparable(Of SimpleUser)
Private Const Name_UID As String = "UID"
Friend Title As String
Friend ID As String
Friend Sub New(ByVal _Title As String, ByVal _ID As String)
Title = _Title
ID = _ID
End Sub
Private Sub New(ByVal u As YouTubeMediaContainerBase)
Title = u.Title
ID = u.ID
End Sub
Public Shared Widening Operator CType(ByVal u As YouTubeMediaContainerBase) As SimpleUser
Return New SimpleUser(u.UserTitle, u.UserID)
End Operator
Public Shared Widening Operator CType(ByVal e As EContainer) As SimpleUser
Return New SimpleUser(e.Value, e.Attribute(Name_UID).Value)
End Operator
Public Overrides Function ToString() As String
Return String.Format(CStr(Interaction.Switch(Title.IsEmptyString, "{1}", ID.IsEmptyString, "{0}", True, "{0} ({1})")), Title, ID)
End Function
Public Overrides Function Equals(ByVal Obj As Object) As Boolean
Return Not IsDBNull(Obj) AndAlso ToString() = DirectCast(Obj, SimpleUser).ToString
End Function
Private Function CompareTo(ByVal Other As SimpleUser) As Integer Implements IComparable(Of SimpleUser).CompareTo
Return ToString.CompareTo(Other.ToString)
End Function
Private Function ToEContainer(Optional ByVal e As ErrorsDescriber = Nothing) As EContainer Implements IEContainerProvider.ToEContainer
Return New EContainer("User", Title, {New EAttribute(Name_UID, ID)})
End Function
End Structure
Friend ReadOnly Property Types As List(Of YouTubeMediaType)
Friend Property IsMusic As Boolean = True
Friend Property IsVideo As Boolean = True
Friend ReadOnly Property UserList As List(Of SimpleUser)
Private ReadOnly File As New SFile("Settings\YouTubeFilter.xml")
Friend Sub New(Optional ByVal LoadFromFile As Boolean = True)
Types = New List(Of YouTubeMediaType) From {YouTubeMediaType.Undefined}
UserList = New List(Of SimpleUser)
If LoadFromFile AndAlso File.Exists Then
Using e As New XmlFile(File, Protector.Modes.All, False) With {.AllowSameNames = True}
e.LoadData()
If e.Count > 0 Then
Types.Clear()
Types.ListAddList(e.Value(Name_Types).StringToList(Of Integer)(","), LAP.NotContainsOnly)
IsMusic = e.Value(Name_IsMusic).FromXML(Of Boolean)(True)
IsVideo = e.Value(Name_IsVideo).FromXML(Of Boolean)(True)
UserList.ListAddList(e(Name_UserList), LAP.IgnoreICopier)
End If
End Using
End If
End Sub
Friend Sub New(ByVal f As YTDataFilter)
Me.New(False)
With f
Types.ListAddList(.Types, LAP.NotContainsOnly)
IsMusic = .IsMusic
IsVideo = .IsVideo
UserList.ListAddList(.UserList)
End With
End Sub
Friend Sub Reset(Optional ByVal AddDefType As Boolean = True, Optional ByVal ClearUserList As Boolean = True)
Types.Clear()
If AddDefType Then Types.Add(YouTubeMediaType.Undefined)
IsMusic = True
IsVideo = True
If ClearUserList Then UserList.Clear()
End Sub
Friend Sub Update()
Using x As New XmlFile With {.AllowSameNames = True}
With x
.Add(Name_Types, Types.ListToStringE(","))
.Add(Name_IsMusic, IsMusic.BoolToInteger)
.Add(Name_IsVideo, IsVideo.BoolToInteger)
.Add(Name_UserList, String.Empty)
.Self()(Name_UserList).AddRange(UserList)
.Name = "FILTER"
.Save(File)
End With
End Using
End Sub
Friend Function Ready(ByVal Item As YouTubeMediaContainerBase, Optional ByVal IgnoreUserList As Boolean = False) As Boolean
With Item
If Not IsMusic Or Not IsVideo Then
If .IsMusic And Not IsMusic Then Return False
If Not .IsMusic And Not IsVideo Then Return False
End If
If Not Types.Contains(YouTubeMediaType.Undefined) AndAlso Not Types.Contains(.ObjectType) Then Return False
If Not IgnoreUserList AndAlso UserList.Count > 0 AndAlso Not UserList.Contains(Item) Then Return False
End With
Return True
End Function
Friend Overloads Sub RemoveAll(ByRef Data As List(Of IYouTubeMediaContainer))
Data.RemoveAll(Function(item) Not Ready(item))
End Sub
Friend Overloads Sub RemoveAll(ByRef Data As List(Of YouTubeMediaContainerBase))
Data.RemoveAll(Function(item) Not Ready(item))
End Sub
Friend Sub Populate(ByVal InitList As List(Of IYouTubeMediaContainer), ByVal DestList As List(Of IYouTubeMediaContainer), ByVal IgnoreUserList As Boolean)
DestList.Clear()
If InitList.Count > 0 Then InitList.ForEach(Sub(item) If Ready(item, IgnoreUserList) Then DestList.ListAddValue(item))
End Sub
End Class
End Namespace