mirror of
https://github.com/AAndyProgram/SCrawler.git
synced 2026-03-14 15:52:18 +00:00
Update names
Updated library objects
This commit is contained in:
@@ -28,7 +28,7 @@ Namespace API.Base
|
||||
Return $"{Appender.StringTrimEnd("/")}/{File}"
|
||||
End If
|
||||
End Function
|
||||
Friend Shared Function Download(ByVal URLs As List(Of String), ByVal DestinationFile As SFile, Optional ByVal Responser As Response = Nothing) As SFile
|
||||
Friend Shared Function Download(ByVal URLs As List(Of String), ByVal DestinationFile As SFile, Optional ByVal Responser As Responser = Nothing) As SFile
|
||||
Dim CachePath As SFile = Nothing
|
||||
Try
|
||||
If URLs.ListExists Then
|
||||
|
||||
@@ -17,8 +17,8 @@ Namespace API.Base
|
||||
Friend Overridable ReadOnly Property Icon As Icon Implements ISiteSettings.Icon
|
||||
Friend Overridable ReadOnly Property Image As Image Implements ISiteSettings.Image
|
||||
Private Property Logger As ILogProvider = LogConnector Implements ISiteSettings.Logger
|
||||
Friend Overridable ReadOnly Property Responser As Response
|
||||
Private Property IResponserContainer_Responser As Response Implements IResponserContainer.Responser
|
||||
Friend Overridable ReadOnly Property Responser As Responser
|
||||
Private Property IResponserContainer_Responser As Responser Implements IResponserContainer.Responser
|
||||
Get
|
||||
Return Responser
|
||||
End Get
|
||||
@@ -30,7 +30,7 @@ Namespace API.Base
|
||||
End Sub
|
||||
Friend Sub New(ByVal SiteName As String, ByVal CookiesDomain As String)
|
||||
Site = SiteName
|
||||
Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml")
|
||||
Responser = New Responser($"{SettingsFolderName}\Responser_{Site}.xml")
|
||||
With Responser
|
||||
If .File.Exists Then
|
||||
If EncryptCookies.CookiesEncrypted Then .CookiesEncryptKey = SettingsCLS.CookieEncryptKey
|
||||
|
||||
@@ -843,7 +843,7 @@ BlockNullPicture:
|
||||
End Function
|
||||
#End Region
|
||||
#Region "Download functions and options"
|
||||
Protected Responser As Response
|
||||
Protected Responser As Responser
|
||||
Protected UseResponserClient As Boolean = False
|
||||
Friend Overridable Sub DownloadData(ByVal Token As CancellationToken) Implements IContentProvider.DownloadData
|
||||
Dim Canceled As Boolean = False
|
||||
@@ -852,7 +852,7 @@ BlockNullPicture:
|
||||
UpdateDataFiles()
|
||||
UserDescriptionReset()
|
||||
If Not Responser Is Nothing Then Responser.Dispose()
|
||||
Responser = New Response
|
||||
Responser = New Responser
|
||||
If Not HOST.Responser Is Nothing Then Responser.Copy(HOST.Responser)
|
||||
'TODO: UserDataBase remove [Responser.DecodersError]
|
||||
Responser.DecodersError = New ErrorsDescriber(EDP.SendInLog + EDP.ReturnValue) With {
|
||||
|
||||
@@ -106,8 +106,8 @@ Namespace API.Instagram
|
||||
Case NameOf(CSRF_TOKEN) : f = Header_CSRF_TOKEN
|
||||
End Select
|
||||
If Not f.IsEmptyString Then
|
||||
Responser.HeadersRemove(f)
|
||||
If Not CStr(Value).IsEmptyString Then Responser.HeadersAdd(f, CStr(Value))
|
||||
Responser.Headers.Remove(f)
|
||||
If Not CStr(Value).IsEmptyString Then Responser.Headers.Add(f, CStr(Value))
|
||||
Responser.SaveSettings()
|
||||
End If
|
||||
End If
|
||||
@@ -202,9 +202,9 @@ Namespace API.Instagram
|
||||
|
||||
With Responser
|
||||
If .Headers.Count > 0 Then
|
||||
token = .HeadersValue(Header_CSRF_TOKEN)
|
||||
app_id = .HeadersValue(Header_IG_APP_ID)
|
||||
www_claim = .HeadersValue(Header_IG_WWW_CLAIM)
|
||||
token = .Headers.Value(Header_CSRF_TOKEN)
|
||||
app_id = .Headers.Value(Header_IG_APP_ID)
|
||||
www_claim = .Headers.Value(Header_IG_WWW_CLAIM)
|
||||
End If
|
||||
If Not .Cookies Is Nothing Then
|
||||
.Cookies.ChangedAllowInternalDrop = False
|
||||
@@ -262,9 +262,9 @@ Namespace API.Instagram
|
||||
Hash = AConvert(Of String)(.Hash.Value, String.Empty)
|
||||
Hash2 = AConvert(Of String)(.HashSavedPosts.Value, String.Empty)
|
||||
With .Responser
|
||||
Token = .HeadersValue(Header_CSRF_TOKEN)
|
||||
AppID = .HeadersValue(Header_IG_APP_ID)
|
||||
WwwClaim = .HeadersValue(Header_IG_WWW_CLAIM)
|
||||
Token = .Headers.Value(Header_CSRF_TOKEN)
|
||||
AppID = .Headers.Value(Header_IG_APP_ID)
|
||||
WwwClaim = .Headers.Value(Header_IG_WWW_CLAIM)
|
||||
End With
|
||||
End With
|
||||
End Sub
|
||||
|
||||
@@ -750,7 +750,7 @@ Namespace API.Instagram
|
||||
End Function
|
||||
#End Region
|
||||
#Region "Standalone downloader"
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal r As Response) As IEnumerable(Of UserMedia)
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal r As Responser) As IEnumerable(Of UserMedia)
|
||||
Try
|
||||
If Not URL.IsEmptyString AndAlso URL.Contains("instagram.com") Then
|
||||
Dim PID$ = RegexReplace(URL, RParams.DMS(".*?instagram.com/p/([_\w\d]+)", 1))
|
||||
@@ -758,7 +758,7 @@ Namespace API.Instagram
|
||||
If Not PID.IsEmptyString Then
|
||||
Using t As New UserData
|
||||
t.SetEnvironment(Settings(InstagramSiteKey), Nothing, False, False)
|
||||
t.Responser = New Response
|
||||
t.Responser = New Responser
|
||||
t.Responser.Copy(r)
|
||||
t._SavedPostsIDs.Add(PID)
|
||||
t.DownloadPosts(Nothing)
|
||||
|
||||
@@ -88,7 +88,7 @@ Namespace API.LPSG
|
||||
End If
|
||||
End Sub
|
||||
Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken)
|
||||
With Responser : .Mode = Response.Modes.WebClient : .ResetStatus() : End With
|
||||
With Responser : .Mode = Responser.Modes.WebClient : .ResetStatus() : End With
|
||||
UseResponserClient = True
|
||||
DownloadContentDefault(Token)
|
||||
End Sub
|
||||
|
||||
@@ -14,7 +14,7 @@ Namespace API.PornHub
|
||||
Friend NotInheritable Class M3U8
|
||||
Private Sub New()
|
||||
End Sub
|
||||
Private Shared Function GetUrlsList(ByVal URL As String, ByVal Responser As Response) As List(Of String)
|
||||
Private Shared Function GetUrlsList(ByVal URL As String, ByVal Responser As Responser) As List(Of String)
|
||||
Dim appender$ = RegexReplace(URL, Regex_M3U8_FileUrl)
|
||||
Dim r$ = Responser.GetResponse(URL)
|
||||
If Not r.IsEmptyString Then
|
||||
@@ -35,7 +35,7 @@ Namespace API.PornHub
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
Friend Shared Function Download(ByVal URL As String, ByVal Responser As Response, ByVal Destination As SFile) As SFile
|
||||
Friend Shared Function Download(ByVal URL As String, ByVal Responser As Responser, ByVal Destination As SFile) As SFile
|
||||
Return M3U8Base.Download(GetUrlsList(URL, Responser), Destination, Responser)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -69,7 +69,7 @@ Namespace API.PornHub
|
||||
End Function
|
||||
Friend Overrides Function GetSpecialData(ByVal URL As String, ByVal Path As String, ByVal AskForPath As Boolean) As IEnumerable
|
||||
If Available(ISiteSettings.Download.Main, True) Then
|
||||
Using resp As Response = Responser.Copy
|
||||
Using resp As Responser = Responser.Copy
|
||||
Dim spf$ = String.Empty
|
||||
Dim f As SFile = GetSpecialDataFile(Path, AskForPath, spf)
|
||||
Dim m As UserMedia = UserData.GetVideoInfo(URL, resp, f)
|
||||
|
||||
@@ -178,7 +178,7 @@ Namespace API.PornHub
|
||||
Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken)
|
||||
Try
|
||||
Responser.ResetStatus()
|
||||
If PersonType = PersonTypeUser Then Responser.Mode = Response.Modes.Curl
|
||||
If PersonType = PersonTypeUser Then Responser.Mode = Responser.Modes.Curl
|
||||
|
||||
If IsSavedPosts Then VideoPageModel = VideoPageModels.Favorite
|
||||
|
||||
@@ -187,7 +187,7 @@ Namespace API.PornHub
|
||||
Dim __videoDone As Boolean = False
|
||||
Dim d%
|
||||
If DownloadVideos Then
|
||||
If PersonType = PersonTypeUser Then Responser.Mode = Response.Modes.Curl : Responser.Method = "POST"
|
||||
If PersonType = PersonTypeUser Then Responser.Mode = Responser.Modes.Curl : Responser.Method = "POST"
|
||||
If VideoPageModel = VideoPageModels.Undefined Then
|
||||
__continue = False
|
||||
d = DownloadUserVideos(page, Token)
|
||||
@@ -216,7 +216,7 @@ Namespace API.PornHub
|
||||
If DownloadGifs And Not IsSavedPosts Then DownloadUserGifs(Token)
|
||||
If DownloadImages Then DownloadUserPhotos(Token)
|
||||
Finally
|
||||
Responser.Mode = Response.Modes.Default
|
||||
Responser.Mode = Responser.Modes.Default
|
||||
Responser.Method = "GET"
|
||||
End Try
|
||||
End Sub
|
||||
@@ -624,7 +624,7 @@ Namespace API.PornHub
|
||||
End Function
|
||||
#End Region
|
||||
#Region "Standalone downloader"
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal Responser As Response, ByVal Destination As SFile) As UserMedia
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal Responser As Responser, ByVal Destination As SFile) As UserMedia
|
||||
Try
|
||||
Dim r$ = Responser.Curl(URL)
|
||||
If Not r.IsEmptyString Then
|
||||
|
||||
@@ -136,7 +136,7 @@ Namespace API.Reddit
|
||||
_CrossPosts.Clear()
|
||||
If Not IsSavedPosts AndAlso (IsChannel AndAlso Not ChannelInfo Is Nothing) Then
|
||||
If Not Responser Is Nothing Then Responser.Dispose()
|
||||
Responser = New Response
|
||||
Responser = New Responser
|
||||
Responser.Copy(MySiteSettings.Responser)
|
||||
ChannelPostsNames.ListAddList(ChannelInfo.PostsAll.Select(Function(p) p.ID), LNC)
|
||||
If Not ViewMode = CView.New Then ChannelPostsNames.ListAddList(ChannelInfo.PostsNames, LNC)
|
||||
@@ -524,7 +524,7 @@ Namespace API.Reddit
|
||||
End Try
|
||||
End Function
|
||||
Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken)
|
||||
Dim RedGifsResponser As Response = Nothing
|
||||
Dim RedGifsResponser As Responser = Nothing
|
||||
Try
|
||||
ThrowAny(Token)
|
||||
Const v2 As UTypes = UTypes.VideoPre + UTypes.m3u8
|
||||
@@ -581,7 +581,7 @@ Namespace API.Reddit
|
||||
End Sub
|
||||
Protected Overrides Sub ReparseMissing(ByVal Token As CancellationToken)
|
||||
Dim rList As New List(Of Integer)
|
||||
Dim RedGifsResponser As Response = Nothing
|
||||
Dim RedGifsResponser As Responser = Nothing
|
||||
Try
|
||||
If Not ChannelInfo Is Nothing Or SaveToCache Then Exit Sub
|
||||
If ContentMissingExists Then
|
||||
@@ -658,11 +658,11 @@ Namespace API.Reddit
|
||||
Public Overrides Sub Perform(Optional ByVal Value As Double = 1)
|
||||
End Sub
|
||||
End Class
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal resp As Response, ByVal f As SFile, ByVal SpecialFolder As String) As IEnumerable(Of UserMedia)
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal resp As Responser, ByVal f As SFile, ByVal SpecialFolder As String) As IEnumerable(Of UserMedia)
|
||||
Try
|
||||
If Not URL.IsEmptyString Then
|
||||
Using r As New UserData
|
||||
r.Responser = New Response
|
||||
r.Responser = New Responser
|
||||
r.Responser.Copy(resp)
|
||||
r.ParsePost(URL)
|
||||
If r._TempMediaList.Count > 0 Then
|
||||
@@ -713,7 +713,7 @@ Namespace API.Reddit
|
||||
End Function
|
||||
#End Region
|
||||
Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken)
|
||||
Dim RedGifsResponser As Response = Nothing
|
||||
Dim RedGifsResponser As Responser = Nothing
|
||||
Try
|
||||
Const _RFN$ = "RedditVideo"
|
||||
Const RFN$ = _RFN & "{0}"
|
||||
|
||||
@@ -33,7 +33,7 @@ Namespace API.RedGifs
|
||||
<PropertyOption(AllowNull:=False, ControlText:="Token", ControlToolTip:="Bearer token")>
|
||||
Friend Property Token As PropertyValue
|
||||
<PXML> Friend Property TokenLastDateUpdated As PropertyValue
|
||||
<DoNotUse> Friend ReadOnly Property NoCredentialsResponser As Response
|
||||
<DoNotUse> Friend ReadOnly Property NoCredentialsResponser As Responser
|
||||
Private Const TokenName As String = "authorization"
|
||||
#End Region
|
||||
#Region "Initializer"
|
||||
@@ -41,12 +41,12 @@ Namespace API.RedGifs
|
||||
MyBase.New(RedGifsSite, "redgifs.com")
|
||||
Dim t$ = String.Empty
|
||||
With Responser
|
||||
Dim b As Boolean = Not .Mode = Response.Modes.WebClient
|
||||
.Mode = Response.Modes.WebClient
|
||||
t = .HeadersValue(TokenName)
|
||||
Dim b As Boolean = Not .Mode = Responser.Modes.WebClient
|
||||
.Mode = Responser.Modes.WebClient
|
||||
t = .Headers.Value(TokenName)
|
||||
If b Then .SaveSettings()
|
||||
End With
|
||||
NoCredentialsResponser = New Response($"{SettingsFolderName}\Responser_{RedGifsSite}_NC.xml") With {
|
||||
NoCredentialsResponser = New Responser($"{SettingsFolderName}\Responser_{RedGifsSite}_NC.xml") With {
|
||||
.CookiesEncryptKey = SettingsCLS.CookieEncryptKey,
|
||||
.CookiesDomain = "redgifs.com"
|
||||
}
|
||||
@@ -67,7 +67,7 @@ Namespace API.RedGifs
|
||||
#End Region
|
||||
#Region "Response updater"
|
||||
Private Sub UpdateResponse(ByVal Value As String)
|
||||
Responser.HeadersAdd(TokenName, Value)
|
||||
Responser.Headers.Add(TokenName, Value)
|
||||
Responser.SaveSettings()
|
||||
End Sub
|
||||
#End Region
|
||||
@@ -85,7 +85,7 @@ Namespace API.RedGifs
|
||||
Try
|
||||
Dim r$
|
||||
Dim NewToken$ = String.Empty
|
||||
Using resp As New Response : r = resp.GetResponse("https://api.redgifs.com/v2/auth/temporary",, EDP.ThrowException) : End Using
|
||||
Using resp As New Responser : r = resp.GetResponse("https://api.redgifs.com/v2/auth/temporary",, EDP.ThrowException) : End Using
|
||||
If Not r.IsEmptyString Then
|
||||
Dim j As EContainer = JsonDocument.Parse(r)
|
||||
If Not j Is Nothing Then
|
||||
@@ -126,7 +126,7 @@ Namespace API.RedGifs
|
||||
End Function
|
||||
Friend Overrides Function GetSpecialData(ByVal URL As String, ByVal Path As String, ByVal AskForPath As Boolean) As IEnumerable
|
||||
If BaseAuthExists() Then
|
||||
Using resp As Response = Responser.Copy
|
||||
Using resp As Responser = Responser.Copy
|
||||
Dim m As UserMedia = UserData.GetDataFromUrlId(URL, False, resp, Settings(RedGifsSiteKey))
|
||||
If Not m.State = UStates.Missing And Not m.State = UserData.DataGone And (m.Type = UTypes.Picture Or m.Type = UTypes.Video) Then
|
||||
Try
|
||||
|
||||
@@ -34,7 +34,7 @@ Namespace API.RedGifs
|
||||
End Sub
|
||||
#End Region
|
||||
#Region "Download functions"
|
||||
Private NoCredentialsResponser As Response
|
||||
Private NoCredentialsResponser As Responser
|
||||
Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken)
|
||||
Try
|
||||
NoCredentialsResponser = MySettings.NoCredentialsResponser.Copy
|
||||
@@ -166,7 +166,7 @@ Namespace API.RedGifs
|
||||
Return String.Empty
|
||||
End If
|
||||
End Function
|
||||
Friend Shared Function GetDataFromUrlId(ByVal Obj As String, ByVal ObjIsID As Boolean, ByVal Responser As Response,
|
||||
Friend Shared Function GetDataFromUrlId(ByVal Obj As String, ByVal ObjIsID As Boolean, ByVal Responser As Responser,
|
||||
ByVal Host As Plugin.Hosts.SettingsHost) As UserMedia
|
||||
Dim URL$ = String.Empty
|
||||
Try
|
||||
|
||||
@@ -52,7 +52,7 @@ Namespace API.TikTok
|
||||
Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken)
|
||||
DownloadContentDefault(Token)
|
||||
End Sub
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal Responser As Response, Optional ByVal e As ErrorsDescriber = Nothing) As IEnumerable(Of UserMedia)
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal Responser As Responser, Optional ByVal e As ErrorsDescriber = Nothing) As IEnumerable(Of UserMedia)
|
||||
Try
|
||||
If Not URL.IsEmptyString Then
|
||||
Dim PostId$ = String.Empty
|
||||
@@ -61,7 +61,7 @@ Namespace API.TikTok
|
||||
Dim r$
|
||||
PostId = RegexEnvir.ExtractPostID(URL)
|
||||
If Not PostId.IsEmptyString Then
|
||||
Using resp As Response = Responser.Copy() : r = resp.GetResponse(URL,, EDP.ThrowException) : End Using
|
||||
Using resp As Responser = Responser.Copy() : r = resp.GetResponse(URL,, EDP.ThrowException) : End Using
|
||||
If Not r.IsEmptyString Then
|
||||
If RegexEnvir.GetVideoData(r, PostId, PostURL, PostDate) Then Return {MediaFromData(PostURL, PostId, PostDate)}
|
||||
End If
|
||||
|
||||
@@ -34,10 +34,10 @@ Namespace API.Twitter
|
||||
Private ReadOnly Property Token As PropertyValue
|
||||
<PropertyOption(ControlText:="Saved posts user", ControlToolTip:="Personal profile username"), PXML>
|
||||
Friend ReadOnly Property SavedPostsUserName As PropertyValue
|
||||
Friend Overrides ReadOnly Property Responser As Response
|
||||
Friend Overrides ReadOnly Property Responser As Responser
|
||||
Friend Sub New()
|
||||
MyBase.New(TwitterSite)
|
||||
Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml")
|
||||
Responser = New Responser($"{SettingsFolderName}\Responser_{Site}.xml")
|
||||
|
||||
Dim a$ = String.Empty
|
||||
Dim t$ = String.Empty
|
||||
@@ -46,8 +46,8 @@ Namespace API.Twitter
|
||||
If .File.Exists Then
|
||||
If EncryptCookies.CookiesEncrypted Then .CookiesEncryptKey = SettingsCLS.CookieEncryptKey
|
||||
.LoadSettings()
|
||||
a = .HeadersValue(Header_Authorization)
|
||||
t = .HeadersValue(Header_Token)
|
||||
a = .Headers.Value(Header_Authorization)
|
||||
t = .Headers.Value(Header_Token)
|
||||
Else
|
||||
.ContentType = "application/json"
|
||||
.Accept = "*/*"
|
||||
@@ -55,15 +55,15 @@ Namespace API.Twitter
|
||||
.Cookies = New CookieKeeper(.CookiesDomain) With {.EncryptKey = SettingsCLS.CookieEncryptKey}
|
||||
.CookiesEncryptKey = SettingsCLS.CookieEncryptKey
|
||||
.Decoders.Add(SymbolsConverter.Converters.Unicode)
|
||||
.HeadersAdd("sec-ch-ua", " Not;A Brand"";v=""99"", ""Google Chrome"";v=""91"", ""Chromium"";v=""91""")
|
||||
.HeadersAdd("sec-ch-ua-mobile", "?0")
|
||||
.HeadersAdd("sec-fetch-dest", "empty")
|
||||
.HeadersAdd("sec-fetch-mode", "cors")
|
||||
.HeadersAdd("sec-fetch-site", "same-origin")
|
||||
.HeadersAdd(Header_Token, String.Empty)
|
||||
.HeadersAdd("x-twitter-active-user", "yes")
|
||||
.HeadersAdd("x-twitter-auth-type", "OAuth2Session")
|
||||
.HeadersAdd(Header_Authorization, String.Empty)
|
||||
.Headers.Add("sec-ch-ua", " Not;A Brand"";v=""99"", ""Google Chrome"";v=""91"", ""Chromium"";v=""91""")
|
||||
.Headers.Add("sec-ch-ua-mobile", "?0")
|
||||
.Headers.Add("sec-fetch-dest", "empty")
|
||||
.Headers.Add("sec-fetch-mode", "cors")
|
||||
.Headers.Add("sec-fetch-site", "same-origin")
|
||||
.Headers.Add(Header_Token, String.Empty)
|
||||
.Headers.Add("x-twitter-active-user", "yes")
|
||||
.Headers.Add("x-twitter-auth-type", "OAuth2Session")
|
||||
.Headers.Add(Header_Authorization, String.Empty)
|
||||
.SaveSettings()
|
||||
End If
|
||||
End With
|
||||
@@ -84,8 +84,8 @@ Namespace API.Twitter
|
||||
Case NameOf(Token) : f = Header_Token
|
||||
End Select
|
||||
If Not f.IsEmptyString Then
|
||||
Responser.HeadersRemove(f)
|
||||
If Not CStr(Value).IsEmptyString Then Responser.HeadersAdd(f, CStr(Value))
|
||||
Responser.Headers.Remove(f)
|
||||
If Not CStr(Value).IsEmptyString Then Responser.Headers.Add(f, CStr(Value))
|
||||
Responser.SaveSettings()
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -263,13 +263,13 @@ Namespace API.Twitter
|
||||
End Sub
|
||||
#End Region
|
||||
#Region "Get video static"
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal resp As Response) As IEnumerable(Of UserMedia)
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal resp As Responser) As IEnumerable(Of UserMedia)
|
||||
Try
|
||||
If URL.Contains("twitter") Then
|
||||
Dim PostID$ = RegexReplace(URL, RParams.DM("(?<=/)\d+", 0))
|
||||
If Not PostID.IsEmptyString Then
|
||||
Dim r$
|
||||
Using rc As Response = resp.Copy() : r = rc.GetResponse(String.Format(SinglePostUrl, PostID),, EDP.ReturnValue) : End Using
|
||||
Using rc As Responser = resp.Copy() : r = rc.GetResponse(String.Format(SinglePostUrl, PostID),, EDP.ReturnValue) : End Using
|
||||
If Not r.IsEmptyString Then
|
||||
Using j As EContainer = JsonDocument.Parse(r)
|
||||
If j.ListExists Then
|
||||
|
||||
@@ -141,7 +141,7 @@ Namespace API.XVIDEOS
|
||||
Dim f As SFile = GetSpecialDataFile(Path, AskForPath, spf)
|
||||
f.Name = "video"
|
||||
f.Extension = "mp4"
|
||||
Using resp As Response = Responser.Copy
|
||||
Using resp As Responser = Responser.Copy
|
||||
Using user As New UserData With {.HOST = Settings(XvideosSiteKey)}
|
||||
DirectCast(user, UserDataBase).User.File = f
|
||||
Dim p As UserMedia = user.Download(URL, resp, DownloadUHD.Value, String.Empty)
|
||||
|
||||
@@ -171,7 +171,7 @@ Namespace API.XVIDEOS
|
||||
ProcessException(ex, Token, $"data downloading error [{URL}]")
|
||||
End Try
|
||||
End Sub
|
||||
Private Function GetVideoData(ByVal Media As UserMedia, ByVal resp As Response, ByVal DownloadUHD As Boolean) As UserMedia
|
||||
Private Function GetVideoData(ByVal Media As UserMedia, ByVal resp As Responser, ByVal DownloadUHD As Boolean) As UserMedia
|
||||
Try
|
||||
If Not Media.URL.IsEmptyString Then
|
||||
Dim r$ = resp.GetResponse(Media.URL)
|
||||
@@ -217,7 +217,7 @@ Namespace API.XVIDEOS
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
Friend Function Download(ByVal URL As String, ByVal resp As Response, ByVal DownloadUHD As Boolean, ByVal ID As String)
|
||||
Friend Function Download(ByVal URL As String, ByVal resp As Responser, ByVal DownloadUHD As Boolean, ByVal ID As String)
|
||||
Dim m As UserMedia = GetVideoData(New UserMedia(URL, UTypes.VideoPre) With {.Post = ID}, resp, DownloadUHD)
|
||||
If Not m.URL.IsEmptyString Then
|
||||
Dim f As SFile = m.File
|
||||
|
||||
@@ -14,7 +14,7 @@ Namespace API.Xhamster
|
||||
Friend NotInheritable Class M3U8
|
||||
Private Sub New()
|
||||
End Sub
|
||||
Private Shared Function ParseFirstM3U8(ByVal URL As String, ByVal Responser As Response, ByVal UHD As Boolean) As String
|
||||
Private Shared Function ParseFirstM3U8(ByVal URL As String, ByVal Responser As Responser, ByVal UHD As Boolean) As String
|
||||
Dim r$, d$
|
||||
Dim _DataObtained As Boolean = False
|
||||
For i% = 0 To 1
|
||||
@@ -38,7 +38,7 @@ Namespace API.Xhamster
|
||||
Next
|
||||
Return String.Empty
|
||||
End Function
|
||||
Private Shared Function ParseSecondM3U8(ByVal URL As String, ByVal Responser As Response, ByVal Appender As String) As List(Of String)
|
||||
Private Shared Function ParseSecondM3U8(ByVal URL As String, ByVal Responser As Responser, ByVal Appender As String) As List(Of String)
|
||||
Dim r$
|
||||
Dim l As List(Of String)
|
||||
For i% = 0 To 1
|
||||
@@ -57,7 +57,7 @@ Namespace API.Xhamster
|
||||
Next
|
||||
Return Nothing
|
||||
End Function
|
||||
Private Shared Function ObtainUrls(ByVal URL As String, ByVal Responser As Response, ByVal UHD As Boolean) As List(Of String)
|
||||
Private Shared Function ObtainUrls(ByVal URL As String, ByVal Responser As Responser, ByVal UHD As Boolean) As List(Of String)
|
||||
Try
|
||||
Dim file$ = ParseFirstM3U8(URL, Responser, UHD)
|
||||
If Not file.IsEmptyString Then
|
||||
@@ -72,7 +72,7 @@ Namespace API.Xhamster
|
||||
Responser.UseGZipStream = False
|
||||
End Try
|
||||
End Function
|
||||
Friend Shared Function Download(ByVal Media As UserMedia, ByVal Responser As Response, ByVal UHD As Boolean) As SFile
|
||||
Friend Shared Function Download(ByVal Media As UserMedia, ByVal Responser As Responser, ByVal UHD As Boolean) As SFile
|
||||
Return M3U8Base.Download(ObtainUrls(Media.URL, Responser, UHD), Media.File, Responser)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -102,7 +102,7 @@ Namespace API.Xhamster
|
||||
End Function
|
||||
Friend Overrides Function GetSpecialData(ByVal URL As String, ByVal Path As String, ByVal AskForPath As Boolean) As IEnumerable
|
||||
If Available(ISiteSettings.Download.Main, True) Then
|
||||
Using resp As Response = Responser.Copy
|
||||
Using resp As Responser = Responser.Copy
|
||||
Dim spf$ = String.Empty
|
||||
Dim f As SFile = GetSpecialDataFile(Path, AskForPath, spf)
|
||||
Dim m As UserMedia = UserData.GetVideoInfo(URL, resp, f)
|
||||
|
||||
@@ -219,7 +219,7 @@ Namespace API.Xhamster
|
||||
End Sub
|
||||
#End Region
|
||||
#Region "GetM3U8"
|
||||
Private Overloads Function GetM3U8(ByRef m As UserMedia, ByVal URL As String, ByVal Responser As Response,
|
||||
Private Overloads Function GetM3U8(ByRef m As UserMedia, ByVal URL As String, ByVal Responser As Responser,
|
||||
Optional ByVal e As ErrorsDescriber = Nothing) As Boolean
|
||||
Try
|
||||
If Not URL.IsEmptyString Then
|
||||
@@ -248,7 +248,7 @@ Namespace API.Xhamster
|
||||
End Function
|
||||
#End Region
|
||||
#Region "Standalone downloader"
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal Responser As Response, ByVal Path As SFile) As UserMedia
|
||||
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal Responser As Responser, ByVal Path As SFile) As UserMedia
|
||||
Try
|
||||
Using u As New UserData With {.Responser = Responser, .HOST = Settings(XhamsterSiteKey)}
|
||||
Dim m As UserMedia = Nothing
|
||||
|
||||
@@ -11,12 +11,12 @@ Imports PersonalUtilities.Tools.Web.Clients
|
||||
Namespace DownloadObjects
|
||||
Friend Class WebClient2 : Implements IDisposable
|
||||
Protected WC As WebClient
|
||||
Protected RC As Response
|
||||
Protected RC As Responser
|
||||
Private ReadOnly RCERROR As New ErrorsDescriber(EDP.ThrowException)
|
||||
Protected UseResponserClient As Boolean
|
||||
Friend Sub New()
|
||||
End Sub
|
||||
Friend Sub New(ByVal Responser As Response)
|
||||
Friend Sub New(ByVal Responser As Responser)
|
||||
If Not Responser Is Nothing Then
|
||||
RC = Responser
|
||||
UseResponserClient = True
|
||||
|
||||
@@ -12,7 +12,6 @@ Imports PersonalUtilities.Forms
|
||||
Imports PersonalUtilities.Forms.Controls
|
||||
Imports PersonalUtilities.Forms.Controls.Base
|
||||
Imports PersonalUtilities.Tools.Web.Cookies
|
||||
Imports CookieControl = PersonalUtilities.Tools.Web.Cookies.CookieListForm.CookieControl
|
||||
Imports ADB = PersonalUtilities.Forms.Controls.Base.ActionButton.DefaultButtons
|
||||
Namespace Editors
|
||||
Friend Class SiteEditorForm
|
||||
@@ -213,12 +212,13 @@ Namespace Editors
|
||||
Select Case Sender.DefaultButton
|
||||
Case ADB.Edit
|
||||
If Not Host.Responser Is Nothing Then
|
||||
Using f As New CookieListForm(Host.Responser) With {
|
||||
.MyDesignXML = Settings.Design,
|
||||
.DisableControls = CookieControl.AddFromInternal + CookieControl.AuthorizeProgram + CookieControl.OpenBrowser
|
||||
}
|
||||
Using f As New CookieListForm With {.DesignXML = Settings.Design, .UseGrid = False}
|
||||
f.SetCollection(Host.Responser.Cookies)
|
||||
f.ShowDialog()
|
||||
MyDefs.MyOkCancel.EnableOK = True
|
||||
If f.DialogResult = DialogResult.OK Then
|
||||
f.GetCollection(Host.Responser)
|
||||
MyDefs.MyOkCancel.EnableOK = True
|
||||
End If
|
||||
End Using
|
||||
SetCookieText()
|
||||
End If
|
||||
|
||||
@@ -10,7 +10,7 @@ Imports PersonalUtilities.Tools.Web.Clients
|
||||
Namespace EncryptCookies
|
||||
Friend Module EncryptFunction
|
||||
Friend CookiesEncrypted As Boolean = False
|
||||
Friend Sub ValidateCookiesEncrypt(ByRef Responser As Response)
|
||||
Friend Sub ValidateCookiesEncrypt(ByRef Responser As Responser)
|
||||
If Not Responser Is Nothing Then
|
||||
Dim b As Boolean = False
|
||||
With Responser
|
||||
|
||||
@@ -80,7 +80,7 @@ Namespace Plugin.Hosts
|
||||
Friend ReadOnly Property HasSpecialOptions As Boolean = False
|
||||
Private ReadOnly _ResponserGetMethod As MethodInfo
|
||||
Private ReadOnly _ResponserIsContainer As Boolean = False
|
||||
Friend ReadOnly Property Responser As Response
|
||||
Friend ReadOnly Property Responser As Responser
|
||||
Get
|
||||
If Not _ResponserGetMethod Is Nothing Then
|
||||
Return _ResponserGetMethod.Invoke(Source, Nothing)
|
||||
@@ -190,7 +190,7 @@ Namespace Plugin.Hosts
|
||||
If m.MemberType = MemberTypes.Property Then
|
||||
PropList.Add(New PropertyValueHost(Source, m))
|
||||
With DirectCast(m, PropertyInfo)
|
||||
If .PropertyType Is GetType(Response) AndAlso m.GetCustomAttribute(Of DoNotUse)() Is Nothing Then _ResponserGetMethod = .GetMethod
|
||||
If .PropertyType Is GetType(Responser) AndAlso m.GetCustomAttribute(Of DoNotUse)() Is Nothing Then _ResponserGetMethod = .GetMethod
|
||||
End With
|
||||
End If
|
||||
With m.GetCustomAttributes()
|
||||
|
||||
Reference in New Issue
Block a user