mirror of
https://github.com/AAndyProgram/SCrawler.git
synced 2026-03-15 16:22:17 +00:00
2023.08.17.0
YT.VideoListForm: hide progress API.Base.UserDataBase: add 'IsUser' property; remove 'DownloadedPictures' debug line; add a special log for non-existent users API.Twitter: group 'limit' notifications; update 'TwitterLimitException' (inherits Plugin.ExitException) AutoDownloader: fix 'Initialization' value bug DownloadedInfoForm: fix a bug due to which profiles were disposed FeedMedia: add subscriptions users BackColor & ForeColor; fix file name issue; remove icon cloning TDownloader, UserDownloadQueueForm: fix progress hang issue ColorPicker: add 'TooltipText' GlobalSettingsForm: add new properties; move design properties to new tab ListImagesLoader: add subscriptions users BackColor & ForeColor
This commit is contained in:
@@ -87,6 +87,7 @@ Namespace API.Twitter
|
||||
MyBase.New(TwitterSite, "twitter.com")
|
||||
|
||||
_Image = My.Resources.SiteResources.TwitterIcon_32.ToBitmap
|
||||
LimitSkippedUsers = New List(Of UserDataBase)
|
||||
|
||||
With Responser
|
||||
.Cookies.ChangedAllowInternalDrop = False
|
||||
@@ -126,7 +127,19 @@ Namespace API.Twitter
|
||||
Return Settings.GalleryDLFile.Exists And BaseAuthExists()
|
||||
End Function
|
||||
Friend Property LIMIT_ABORT As Boolean = False
|
||||
Friend ReadOnly Property LimitSkippedUsers As List(Of UserDataBase)
|
||||
Friend Overrides Sub DownloadDone(ByVal What As ISiteSettings.Download)
|
||||
If LimitSkippedUsers.Count > 0 Then
|
||||
With LimitSkippedUsers
|
||||
If .Count = 1 Then
|
||||
MyMainLOG = $"{ .Item(0).ToStringForLog}: twitter limit reached. Data has not been downloaded."
|
||||
Else
|
||||
MyMainLOG = "The following twitter users have not been downloaded (twitter limit reached):" & vbNewLine &
|
||||
.ListToStringE(vbNewLine, New CustomProvider(Function(v As UserDataBase) $"{v.Name} ({v.ToStringForLog})"))
|
||||
End If
|
||||
.Clear()
|
||||
End With
|
||||
End If
|
||||
LIMIT_ABORT = False
|
||||
MyBase.DownloadDone(What)
|
||||
End Sub
|
||||
|
||||
@@ -140,7 +140,7 @@ Namespace API.Twitter
|
||||
End Function
|
||||
Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken)
|
||||
If MySettings.LIMIT_ABORT Then
|
||||
TwitterLimitException.LogMessage(ToStringForLog, True)
|
||||
Throw New TwitterLimitException(Me)
|
||||
Else
|
||||
If IsSavedPosts Then
|
||||
If _ContentList.Count > 0 Then _DataNames.ListAddList(_ContentList.Select(Function(c) c.Post.ID), LAP.ClearBeforeAdd, LAP.NotContainsOnly)
|
||||
@@ -340,6 +340,7 @@ Namespace API.Twitter
|
||||
DownloadModelForceApply = False
|
||||
FirstDownloadComplete = True
|
||||
Catch limit_ex As TwitterLimitException
|
||||
Throw limit_ex
|
||||
Catch ex As Exception
|
||||
ProcessException(ex, Token, $"data downloading error [{URL}]")
|
||||
Finally
|
||||
@@ -491,12 +492,10 @@ Namespace API.Twitter
|
||||
End Function
|
||||
#End Region
|
||||
#Region "Gallery-DL Support"
|
||||
Private Class TwitterLimitException : Inherits Exception
|
||||
Friend Sub New(ByVal User As String, ByVal Skipped As Boolean)
|
||||
LogMessage(User, Skipped)
|
||||
End Sub
|
||||
Friend Shared Sub LogMessage(ByVal User As String, ByVal Skipped As Boolean)
|
||||
MyMainLOG = $"{User}: twitter limit reached.{IIf(Skipped, "Data has not been downloaded", String.Empty)}"
|
||||
Private Class TwitterLimitException : Inherits Plugin.ExitException
|
||||
Friend Sub New(ByVal User As UserData)
|
||||
Silent = True
|
||||
User.MySettings.LimitSkippedUsers.Add(User)
|
||||
End Sub
|
||||
End Class
|
||||
Private Class TwitterGDL : Inherits GDL.GDLBatch
|
||||
@@ -558,7 +557,7 @@ Namespace API.Twitter
|
||||
MySettings.LIMIT_ABORT = True
|
||||
Return dir
|
||||
Else
|
||||
Throw New TwitterLimitException(ToStringForLog, False)
|
||||
Throw New TwitterLimitException(Me)
|
||||
End If
|
||||
End If
|
||||
End Using
|
||||
@@ -626,7 +625,7 @@ Namespace API.Twitter
|
||||
MySettings.LIMIT_ABORT = True
|
||||
Exit For
|
||||
Else
|
||||
Throw New TwitterLimitException(ToStringForLog, False)
|
||||
Throw New TwitterLimitException(Me)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user