mirror of
https://github.com/AAndyProgram/SCrawler.git
synced 2026-03-14 15:52:18 +00:00
2023.8.6.0
Plugins.Attributes: add 'DependentFields' attribute Plugins.IPluginContentProvider: add 'Options' and 'IsSubscription' properties Plugins.ISiteSettings: add 'SubscriptionsAllowed' property Plugins.ExchangeOptions: add 'Options' field Plugins.Attributes.PropertyUpdater: replace 'Dependencies' with 'Arguments' YT: add 'OutputPathAskForName' and 'OutputPathAutoAddPaths' properties; add the ability to store download locations; add 'DownloadLocation' and 'DownloadLocationsCollection' objects YT.IDownloaderSettings: add 'OutputPathAskForName' and 'OutputPathAutoAddPaths' properties YT.Downloader: fixed bug with re-saving elements when loading a video list; fixed bug when files were not deleted when clicking on the delete button; fixed a bug that caused the video to redownload; download job removes elements at wrong indexes; added skipping of downloaded elements in the job; fixed a bug, pending option did not change after download complete YT.YouTubeMediaContainerBase: add '_MediaStateOnLoad' field and 'NeedToSave' function; update the 'Save' function to prevent saving a file when a download is complete and the file has already been saved; update code for new yt-dlp version Fixed cache deletion errors Add user queue Add global locations API.Base.SiteSettingsBase: implement 'SubscriptionsAllowed' property; remove request headers with null values on save; add '_AllowUserAgentUpdate' parameter API.Base.Structures: add 'SiteModes' enum API.Base.UserDataBase: add 'Erase' button; implement 'Options' and 'IsSubscription' properties; add 'SpecialLabels' property; update 'LVIKey'; update 'FitToAddParams' function; add 'EraseData' function; user colors; Not UserExists notification, UserQueue support API.Base: add 'DeclaredNames' API.Instagram: remove default values for headers; disable updating UserAgent from global; check for a new username for non-existent users API.Mastodon: bypass new inherited twitter options; update names and headers API.OnlyFans: make 'HH_BROWSER' property nullable; remove 'HH_BROWSER' from required; fix username bug (dots); handling of 504 and 429 errors; add 'DownloadHighlights' and 'DownloadChatMedia' options; add 'UserExchangeOptions'; fixed incorrect error handler API.PathPlugin: fixed incorrect detection of path existence API.Pinterest: add 'SpecialLabels' API.PornHub: add new video regex; remove old regex; added 'DownloadUploaded', 'DownloadTagged', 'DownloadPrivate' and 'DownloadFavorite' properties to 'SiteSettings', 'UserData' and 'UserExchangeOptions'; update regex to define user; added downloading search queries; update 'GetUserUrl' function; hide unnecessary 'RegexFieldsTextBecameNullException' errors; add subscriptions API.Reddit: add 'SpecialLabels'; add bearer token and its refresh interval; add OAuth; add additional options API.RedGifs: add 'DependentFields' for 'Token' API.ThisVid: add 'DownloadFavourite' option; add downloading search queries, tags, categories; add 'SpecialLabels'; add subscriptions; updating cookies issue API.TikTok: rewrite algorithms API.Twitter: add 'UseAppropriateModel', 'UseNewEndPointSearch', 'UseNewEndPointProfiles', 'AbortOnLimit', 'DownloadAlreadyParsed', 'MediaModelAllowNonUserTweets' properties; remove old commented code; remove 'TwitterPic_400' and replace with 'TwitterIcon_32.ToBitmap'; add 'DownloadModelForceApply' user option; update environment to GDL 1.25.8; fixed gifs downloading; fix typo in 'ReparseMissing'; update names API.UserDataBind: prevent adding site-specific labels when adding to a collection API.Xhamster: add downloading search queries, tags, categories; add 'SpecialLabels'; add additional nodes for channels; add subscriptions API.XVIDEOS: add downloading search queries, tags, categories; add 'SpecialLabels'; add subscriptions; changed users creation method; add subscriptions API.YouTube: add subscriptions AutoDownloader: add new group subscription options; update predicates; fixed excluded labels and sites in default mode; update notifications; add an additional skip options, add 'Force start' option DownloadedInfoForm: add subscriptions; fixed size/location bug; hide unnecessary error (refill) Feed: add subscriptions; update filters; add 'Ctrl+G' shortcut FeedMedia: add subscriptions; fixed 'webm' bug; add title for subscription media; add site icon to post; user colors; always using 'FriendlyName' instead of 'UserName' if it exists DownloadGroup, GroupDefaults, GroupParameters: add subscription and 'UsersCount' options MissingPostsForm: add 'BTT_DELETE_ALL' VideoDownloaderForm, DownloaderUrlForm, DownloaderUrlsArrForm: add download locations support VideoDownloaderForm: add subscriptions support GlobalSettingsForm: add new properties UserCreatorForm: add subscriptions; add 'Options' support (of 'ExchangeOptions'); user colors ListImagesLoader: add subscription colors; user colors MainFrame: add subscriptions; add filters by subscription and user; update predicates NuGet: update 'LibVLCSharp', 'LibVLCSharp.WinForms', 'VideoLAN.LibVLC.Windows' DownloadableMediaHost: update 'Save' function PropertyValueHost: fix 'CaptionWidth' bug; add 'Dependents' SettingsHost: add 'Dependents' UserDataHost: add 'Options' and 'IsSubscription' properties SettingsCLS: implement new 'IDownloaderSettings' properties; add 'CacheSnapshots'; add 'DownloadLocations'; add new properties UserInfo, UserFinder: add subscriptions UserSearchForm: fixed search by name bug
This commit is contained in:
@@ -50,7 +50,11 @@ Namespace DownloadObjects.STDownloader
|
||||
End If
|
||||
|
||||
If AppMode Then
|
||||
If Now.Month.ValueBetween(6, 8) Then Text = "SCrawler: Happy LGBT Pride Month! :-)"
|
||||
If Now.Month.ValueBetween(6, 8) Then
|
||||
Text = "SCrawler: Happy LGBT Pride Month! :-)"
|
||||
ElseIf Not MyYouTubeSettings Is Nothing AndAlso Not MyYouTubeSettings.ProgramText.IsEmptyString Then
|
||||
Text = MyYouTubeSettings.ProgramText
|
||||
End If
|
||||
MyNotificator = New YTNotificator(Me)
|
||||
MyDownloaderSettings = MyYouTubeSettings
|
||||
End If
|
||||
@@ -64,6 +68,7 @@ Namespace DownloadObjects.STDownloader
|
||||
BTT_LOG.Visible = False
|
||||
BTT_INFO.Visible = False
|
||||
BTT_DONATE.Visible = False
|
||||
BTT_BUG_REPORT.Visible = False
|
||||
End If
|
||||
MyProgress.Visible = False
|
||||
LoadData()
|
||||
@@ -96,7 +101,7 @@ Namespace DownloadObjects.STDownloader
|
||||
If c.ListExists Then
|
||||
c.Sort(New ContainerDateComparer)
|
||||
SuspendLayout()
|
||||
For i% = c.Count - 1 To 0 Step -1 : ControlCreateAndAdd(c(i), True, i = 0) : Next
|
||||
For i% = c.Count - 1 To 0 Step -1 : ControlCreateAndAdd(c(i), True, i = 0, True) : Next
|
||||
ResumeLayout(False)
|
||||
PerformLayout()
|
||||
End If
|
||||
@@ -121,11 +126,11 @@ Namespace DownloadObjects.STDownloader
|
||||
#End Region
|
||||
#Region "Controls"
|
||||
Protected Sub ControlCreateAndAdd(ByVal Container As IYouTubeMediaContainer, Optional ByVal DisableDownload As Boolean = False,
|
||||
Optional ByVal PerformClick As Boolean = True)
|
||||
Optional ByVal PerformClick As Boolean = True, Optional ByVal IsLoading As Boolean = False)
|
||||
ControlInvokeFast(TP_CONTROLS, Sub()
|
||||
With TP_CONTROLS
|
||||
.SuspendLayout()
|
||||
If DisableDownload Or Not MyDownloaderSettings.DownloadAutomatically Then Container.Save()
|
||||
If Not IsLoading And (DisableDownload Or Not MyDownloaderSettings.DownloadAutomatically) Then Container.Save()
|
||||
'.AutoScroll = True
|
||||
'.HorizontalScroll.Visible = False
|
||||
.RowStyles.Insert(0, New RowStyle(SizeType.Absolute, 60))
|
||||
@@ -337,13 +342,13 @@ Namespace DownloadObjects.STDownloader
|
||||
MyJob.Cancel()
|
||||
End Sub
|
||||
Private Sub BTT_DELETE_Click(sender As Object, e As EventArgs) Handles BTT_DELETE.Click
|
||||
RemoveControls(ControlsChecked)
|
||||
RemoveControls(ControlsChecked, True)
|
||||
End Sub
|
||||
Protected Overridable Sub BTT_CLEAR_DONE_Click(sender As Object, e As EventArgs) Handles BTT_CLEAR_DONE.Click
|
||||
RemoveControls(ControlsDownloaded)
|
||||
RemoveControls(ControlsDownloaded, False)
|
||||
End Sub
|
||||
Protected Overridable Sub BTT_CLEAR_ALL_Click(sender As Object, e As EventArgs) Handles BTT_CLEAR_ALL.Click
|
||||
RemoveControls()
|
||||
RemoveControls(, False)
|
||||
End Sub
|
||||
Private Sub BTT_LOG_Click(sender As Object, e As EventArgs) Handles BTT_LOG.Click
|
||||
MyMainLOG_ShowForm(DesignXML,,,, AddressOf UpdateLogButton)
|
||||
@@ -351,20 +356,23 @@ Namespace DownloadObjects.STDownloader
|
||||
Friend Sub UpdateLogButton()
|
||||
If AppMode Then MyMainLOG_UpdateLogButton(BTT_LOG, TOOLBAR_TOP)
|
||||
End Sub
|
||||
Private Sub BTT_BUG_REPORT_Click(sender As Object, e As EventArgs) Handles BTT_BUG_REPORT.Click
|
||||
Try
|
||||
With MyYouTubeSettings
|
||||
Using f As New Editors.BugReporterForm(MyCache, .DesignXml, .ProgramText, My.Application.Info.Version,
|
||||
True, .Self, .ProgramDescription) : f.ShowDialog() : End Using
|
||||
End With
|
||||
Catch
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub BTT_DONATE_Click(sender As Object, e As EventArgs) Handles BTT_DONATE.Click
|
||||
Try : Process.Start("https://github.com/AAndyProgram/SCrawler/blob/main/HowToSupport.md") : Catch : End Try
|
||||
End Sub
|
||||
Private Sub BTT_INFO_Click(sender As Object, e As EventArgs) Handles BTT_INFO.Click
|
||||
Try
|
||||
MsgBoxE({$"YouTube Downloader v{My.Application.Info.Version}" & vbCr &
|
||||
$"Address: https://github.com/AAndyProgram/SCrawler" & vbCr &
|
||||
"Created by Greek LGBT person Andy (Gay)",
|
||||
"Program information"},,,,
|
||||
{"OK", New MsgBoxButton("Go to site") With {.CallBack = Sub(r, n, b) Process.Start("https://github.com/AAndyProgram/SCrawler/releases")}})
|
||||
Catch
|
||||
End Try
|
||||
ShowProgramInfo(MyYouTubeSettings.ProgramText.Value.IfNullOrEmpty("YouTube Downloader"),
|
||||
My.Application.Info.Version, False, True, MyYouTubeSettings, True,, False, MyYouTubeSettings.ProgramDescription)
|
||||
End Sub
|
||||
Protected Overloads Sub RemoveControls(Optional ByVal Predicate As Predicate(Of MediaItem) = Nothing)
|
||||
Protected Overloads Sub RemoveControls(Optional ByVal Predicate As Predicate(Of MediaItem) = Nothing, Optional ByVal RemoveFiles As Boolean = False)
|
||||
ControlInvokeFast(TP_CONTROLS, Sub()
|
||||
With TP_CONTROLS
|
||||
If .Controls.Count > 0 Then
|
||||
@@ -379,7 +387,7 @@ Namespace DownloadObjects.STDownloader
|
||||
For i = rCnt.Count - 1 To 0 Step -1
|
||||
cnt = .Controls(rCnt(i))
|
||||
.Controls.RemoveAt(rCnt(i))
|
||||
If Not cnt.MyContainer Is Nothing Then cnt.MyContainer.Delete(False)
|
||||
If Not cnt.MyContainer Is Nothing Then cnt.MyContainer.Delete(RemoveFiles) : cnt.MyContainer.Dispose()
|
||||
cnt.Dispose()
|
||||
Next
|
||||
End If
|
||||
@@ -395,19 +403,24 @@ Namespace DownloadObjects.STDownloader
|
||||
UpdateScrolls(Nothing, Nothing)
|
||||
End Sub, EDP.None)
|
||||
End Sub
|
||||
Private Overloads Sub RemoveControls(ByVal CNT As MediaItem)
|
||||
Private Overloads Sub RemoveControls(ByVal CNT As MediaItem, Optional ByVal RemoveFiles As Boolean = False)
|
||||
ControlInvokeFast(TP_CONTROLS, Sub()
|
||||
If Not CNT Is Nothing Then TP_CONTROLS.Controls.Remove(CNT) : OffsetControls()
|
||||
If Not CNT Is Nothing Then
|
||||
If Not CNT.MyContainer Is Nothing Then CNT.MyContainer.Delete(RemoveFiles) : CNT.MyContainer.Dispose()
|
||||
TP_CONTROLS.Controls.Remove(CNT)
|
||||
OffsetControls()
|
||||
CNT.Dispose()
|
||||
End If
|
||||
End Sub, EDP.None)
|
||||
End Sub
|
||||
#End Region
|
||||
#Region "Media controls' handlers"
|
||||
Private Sub MediaControl_FileDownloaded(ByVal Sender As MediaItem, ByVal Container As IYouTubeMediaContainer)
|
||||
If MyDownloaderSettings.ShowNotifications Then MyNotificator.ShowNotification(Container.ToString(), Container.ThumbnailFile)
|
||||
If MyDownloaderSettings.RemoveDownloadedAutomatically Then RemoveControls(Sender)
|
||||
If MyDownloaderSettings.RemoveDownloadedAutomatically Then RemoveControls(Sender, False)
|
||||
End Sub
|
||||
Private Sub MediaControl_Removal(ByVal Sender As MediaItem, ByVal Container As IYouTubeMediaContainer)
|
||||
RemoveControls(Sender)
|
||||
RemoveControls(Sender, False)
|
||||
End Sub
|
||||
Private Sub MediaControl_DownloadAgain(ByVal Sender As MediaItem, ByVal Container As IYouTubeMediaContainer)
|
||||
If Not Container.URL.IsEmptyString Then BufferText = Container.URL : BTT_ADD.PerformClick()
|
||||
@@ -432,8 +445,6 @@ Namespace DownloadObjects.STDownloader
|
||||
Protected Sub AddToDownload(ByRef Item As MediaItem, ByVal RunThread As Boolean)
|
||||
Dim hc% = Item.MyContainer.GetHashCode
|
||||
If MyJob.Count = 0 OrElse Not MyJob.Items.Exists(Function(i) i.MyContainer.GetHashCode = hc) Then
|
||||
'TODELETE: YT video downloader 'Item.Pending'
|
||||
'Item.Pending = True
|
||||
MyJob.Add(Item)
|
||||
Item.AddToQueue()
|
||||
If RunThread Then StartDownloading()
|
||||
@@ -457,25 +468,39 @@ Namespace DownloadObjects.STDownloader
|
||||
MyJob.Start()
|
||||
Const nf As ANumbers.Formats = ANumbers.Formats.Number
|
||||
Dim t As New List(Of Task)
|
||||
Dim i%
|
||||
Dim i%, iAbs%
|
||||
Dim __item As MediaItem
|
||||
Dim Indexes As New List(Of Integer)
|
||||
Dim IndexesToRemove As New List(Of Integer)
|
||||
Dim maxJobCount% = MyDownloaderSettings.MaxJobsCount
|
||||
If maxJobCount <= 0 Then maxJobCount = 1
|
||||
MyProgress.Visible = True
|
||||
MyProgress.Maximum = MyJob.Count
|
||||
Do While MyJob.Count > 0 And Not MyJob.IsCancellationRequested
|
||||
i = -1
|
||||
iAbs = -1
|
||||
Indexes.Clear()
|
||||
IndexesToRemove.Clear()
|
||||
For Each __item In MyJob.Items
|
||||
i += 1
|
||||
If i <= maxJobCount - 1 Then
|
||||
Indexes.Add(i)
|
||||
t.Add(Task.Run(Sub() __item.Download(MyJob.Token)))
|
||||
iAbs += 1
|
||||
If Not __item.IsDisposed And Not If(__item.MyContainer?.DownloadState, Plugin.UserMediaStates.Unknown) = Plugin.UserMediaStates.Downloaded Then
|
||||
i += 1
|
||||
If i <= maxJobCount - 1 Then
|
||||
Indexes.Add(iAbs)
|
||||
t.Add(Task.Run(Sub() __item.Download(MyJob.Token)))
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
Else
|
||||
Exit For
|
||||
IndexesToRemove.Add(iAbs)
|
||||
End If
|
||||
Next
|
||||
If IndexesToRemove.Count > 0 Then
|
||||
For i = IndexesToRemove.Count - 1 To 0 Step -1
|
||||
If Not MyJob.Items(IndexesToRemove(i)).IsDisposed Then MyJob.Items(IndexesToRemove(i)).Pending = False
|
||||
MyJob.Items.RemoveAt(IndexesToRemove(i))
|
||||
Next
|
||||
End If
|
||||
If t.Count > 0 Then
|
||||
MyProgress.Information = $"Downloading {t.Count.NumToString(nf, PNumProv)}/{MyJob.Count.NumToString(nf, PNumProv)}"
|
||||
MyProgress.InformationTemporary = MyProgress.Information
|
||||
@@ -491,6 +516,7 @@ Namespace DownloadObjects.STDownloader
|
||||
End If
|
||||
Loop
|
||||
Indexes.Clear()
|
||||
IndexesToRemove.Clear()
|
||||
MyProgress.Done()
|
||||
MyProgress.InformationTemporary = "Download completed"
|
||||
Catch aoex As ArgumentOutOfRangeException
|
||||
|
||||
Reference in New Issue
Block a user