mirror of
https://github.com/AAndyProgram/SCrawler.git
synced 2026-03-14 15:52:18 +00:00
2023.9.28.0
API.Mastodon: hide 503 error API.PornHub: minor fixes API.RedGifs: fix 'DataGone' Minor bugs
This commit is contained in:
@@ -11,6 +11,6 @@ Namespace Plugin
|
|||||||
Overloads Sub Add(ByVal Message As String)
|
Overloads Sub Add(ByVal Message As String)
|
||||||
Overloads Sub Add(ByVal ex As Exception, ByVal Message As String,
|
Overloads Sub Add(ByVal ex As Exception, ByVal Message As String,
|
||||||
Optional ByVal ShowMainMsg As Boolean = False, Optional ByVal ShowErrorMsg As Boolean = False,
|
Optional ByVal ShowMainMsg As Boolean = False, Optional ByVal ShowErrorMsg As Boolean = False,
|
||||||
Optional ByVal SendInLog As Boolean = True)
|
Optional ByVal SendToLog As Boolean = True)
|
||||||
End Interface
|
End Interface
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -203,7 +203,10 @@ Namespace API.Mastodon
|
|||||||
#Region "UpdateServersList"
|
#Region "UpdateServersList"
|
||||||
Private Sub UpdateServersList()
|
Private Sub UpdateServersList()
|
||||||
Try
|
Try
|
||||||
Dim r$ = GetWebString("https://api.joinmastodon.org/servers?language=&category=®ion=&ownership=®istrations=",, EDP.ThrowException)
|
Using resp As New Responser With {
|
||||||
|
.ProcessExceptionDecision = Function(rr, obj, e) If(rr.StatusCode = Net.HttpStatusCode.ServiceUnavailable,
|
||||||
|
EDP.ReturnValue, EDP.ThrowException)}
|
||||||
|
Dim r$ = resp.GetResponse("https://api.joinmastodon.org/servers?language=&category=®ion=&ownership=®istrations=")
|
||||||
If Not r.IsEmptyString Then
|
If Not r.IsEmptyString Then
|
||||||
Dim j As EContainer = JsonDocument.Parse(r, EDP.ReturnValue)
|
Dim j As EContainer = JsonDocument.Parse(r, EDP.ReturnValue)
|
||||||
If If(j?.Count, 0) > 0 Then
|
If If(j?.Count, 0) > 0 Then
|
||||||
@@ -212,8 +215,9 @@ Namespace API.Mastodon
|
|||||||
Domains.Save()
|
Domains.Save()
|
||||||
j.Dispose()
|
j.Dispose()
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
DomainsLastUpdateDate.Value = Now
|
DomainsLastUpdateDate.Value = Now
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[API.Mastodon.SiteSettings.UpdateServersList]")
|
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[API.Mastodon.SiteSettings.UpdateServersList]")
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
@@ -896,8 +896,8 @@ Namespace API.PornHub
|
|||||||
If Not script.IsEmptyString Then
|
If Not script.IsEmptyString Then
|
||||||
Using j As EContainer = JsonDocument.Parse(script)
|
Using j As EContainer = JsonDocument.Parse(script)
|
||||||
If j.ListExists Then
|
If j.ListExists Then
|
||||||
Dim s As List(Of Sizes) = j.Select(Function(jj) New Sizes(jj.Value("quality"), jj.Value("videoUrl"))).ToList
|
Dim s As List(Of Sizes) = j.Select(Function(jj) New Sizes(jj.Value("quality"), jj.Value("videoUrl"))).ListWithRemove(Function(d) d.HasError Or d.Data.IsEmptyString)
|
||||||
If s.ListExists Then s.Sort() : result = s(0).Data
|
If s.ListExists Then s.Sort() : result = s(0).Data : s.Clear()
|
||||||
End If
|
End If
|
||||||
End Using
|
End Using
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ Namespace API.RedGifs
|
|||||||
Optional ByVal EObj As Object = Nothing) As Integer
|
Optional ByVal EObj As Object = Nothing) As Integer
|
||||||
Dim s As WebExceptionStatus = Responser.Status
|
Dim s As WebExceptionStatus = Responser.Status
|
||||||
Dim sc As HttpStatusCode = Responser.StatusCode
|
Dim sc As HttpStatusCode = Responser.StatusCode
|
||||||
If sc = HttpStatusCode.NotFound Or s = DataGone Then
|
If sc = HttpStatusCode.NotFound Or s = DataGone Or sc = DataGone Then
|
||||||
UserExists = False
|
UserExists = False
|
||||||
ElseIf sc = HttpStatusCode.Unauthorized Then
|
ElseIf sc = HttpStatusCode.Unauthorized Then
|
||||||
MyMainLOG = $"RedGifs credentials have expired [{CInt(sc)}]: {ToStringForLog()}"
|
MyMainLOG = $"RedGifs credentials have expired [{CInt(sc)}]: {ToStringForLog()}"
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ Namespace Plugin.Hosts
|
|||||||
End Sub
|
End Sub
|
||||||
Friend Sub Add(ByVal ex As Exception, ByVal Message As String,
|
Friend Sub Add(ByVal ex As Exception, ByVal Message As String,
|
||||||
Optional ByVal ShowMainMsg As Boolean = False, Optional ByVal ShowErrorMsg As Boolean = False,
|
Optional ByVal ShowMainMsg As Boolean = False, Optional ByVal ShowErrorMsg As Boolean = False,
|
||||||
Optional ByVal SendInLog As Boolean = True) Implements ILogProvider.Add
|
Optional ByVal SendToLog As Boolean = True) Implements ILogProvider.Add
|
||||||
ErrorsDescriber.Execute(New ErrorsDescriber(ShowMainMsg, ShowErrorMsg, SendInLog), ex, Message)
|
ErrorsDescriber.Execute(New ErrorsDescriber(ShowMainMsg, ShowErrorMsg, SendToLog), ex, Message)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
Reference in New Issue
Block a user