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 ex As Exception, ByVal Message As String,
|
||||
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 Namespace
|
||||
@@ -203,17 +203,21 @@ Namespace API.Mastodon
|
||||
#Region "UpdateServersList"
|
||||
Private Sub UpdateServersList()
|
||||
Try
|
||||
Dim r$ = GetWebString("https://api.joinmastodon.org/servers?language=&category=®ion=&ownership=®istrations=",, EDP.ThrowException)
|
||||
If Not r.IsEmptyString Then
|
||||
Dim j As EContainer = JsonDocument.Parse(r, EDP.ReturnValue)
|
||||
If If(j?.Count, 0) > 0 Then
|
||||
Domains.Domains.ListAddList(j.Select(Function(e) e.Value("domain")), LAP.NotContainsOnly, EDP.ReturnValue)
|
||||
Domains.Domains.Sort()
|
||||
Domains.Save()
|
||||
j.Dispose()
|
||||
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
|
||||
Dim j As EContainer = JsonDocument.Parse(r, EDP.ReturnValue)
|
||||
If If(j?.Count, 0) > 0 Then
|
||||
Domains.Domains.ListAddList(j.Select(Function(e) e.Value("domain")), LAP.NotContainsOnly, EDP.ReturnValue)
|
||||
Domains.Domains.Sort()
|
||||
Domains.Save()
|
||||
j.Dispose()
|
||||
End If
|
||||
DomainsLastUpdateDate.Value = Now
|
||||
End If
|
||||
End If
|
||||
DomainsLastUpdateDate.Value = Now
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[API.Mastodon.SiteSettings.UpdateServersList]")
|
||||
End Try
|
||||
|
||||
@@ -896,8 +896,8 @@ Namespace API.PornHub
|
||||
If Not script.IsEmptyString Then
|
||||
Using j As EContainer = JsonDocument.Parse(script)
|
||||
If j.ListExists Then
|
||||
Dim s As List(Of Sizes) = j.Select(Function(jj) New Sizes(jj.Value("quality"), jj.Value("videoUrl"))).ToList
|
||||
If s.ListExists Then s.Sort() : result = s(0).Data
|
||||
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 : s.Clear()
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
@@ -249,7 +249,7 @@ Namespace API.RedGifs
|
||||
Optional ByVal EObj As Object = Nothing) As Integer
|
||||
Dim s As WebExceptionStatus = Responser.Status
|
||||
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
|
||||
ElseIf sc = HttpStatusCode.Unauthorized Then
|
||||
MyMainLOG = $"RedGifs credentials have expired [{CInt(sc)}]: {ToStringForLog()}"
|
||||
|
||||
@@ -13,8 +13,8 @@ Namespace Plugin.Hosts
|
||||
End Sub
|
||||
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 SendInLog As Boolean = True) Implements ILogProvider.Add
|
||||
ErrorsDescriber.Execute(New ErrorsDescriber(ShowMainMsg, ShowErrorMsg, SendInLog), ex, Message)
|
||||
Optional ByVal SendToLog As Boolean = True) Implements ILogProvider.Add
|
||||
ErrorsDescriber.Execute(New ErrorsDescriber(ShowMainMsg, ShowErrorMsg, SendToLog), ex, Message)
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user