@@ -50,6 +50,7 @@ Namespace API.PornHub
5050 Friend URL As String
5151 Friend ID As String
5252 Friend Title As String
53+ Friend UserRef As String
5354 Friend Type As VideoTypes
5455 Friend Function ToUserMedia( Optional ByVal SpecialFolder As String = Nothing ) As UserMedia
5556 Return New UserMedia(URL, UTypes.VideoPre) With {
@@ -66,14 +67,16 @@ Namespace API.PornHub
6667 URL = String .Empty
6768 Else
6869 URL = String .Format(UrlPattern, URL.TrimStart( "/" ))
70+
6971 Title = TitleHtmlConverter(ParamsArray( 1 ))
7072 If Not ParamsArray( 2 ).IsEmptyString Then
7173 Type = VideoTypes.Private
72- ElseIf Not ParamsArray( 3 ).IsEmptyString Then
73- Type = VideoTypes.Tagged
74+ ' ElseIf Not ParamsArray(3).IsEmptyString Then
75+ ' Type = VideoTypes.Tagged
7476 Else
7577 Type = VideoTypes.Uploaded
7678 End If
79+ If Not ParamsArray( 3 ).IsEmptyString Then UserRef = ParamsArray( 3 ).StringTrim
7780 End If
7881 End If
7982 Return Me
@@ -338,10 +341,13 @@ Namespace API.PornHub
338341 Dim tryNextPage As Boolean = False
339342 Dim limit% = If (DownloadTopCount, - 1 )
340343 Dim cBefore% = _TempMediaList.Count
344+ Dim usrRef$ = String .Empty
345+ Dim npd$ = "?"
341346 If IsUser Then
342347 URL = $"https://www.pornhub.com/{PersonType}/{NameTrue}"
348+ usrRef = $"/{PersonType}/{NameTrue}"
343349 If Type = VideoTypes.Uploaded Then
344- URL &= "/videos/upload"
350+ If Not PersonType = PersonTypeCannel Then URL &= "/videos/upload?o=mr" : npd = "& "
345351 ElseIf Type = VideoTypes.Tagged Then
346352 If Not SecondMode Then URL &= "/videos"
347353 specFolder = "Tagged"
@@ -354,7 +360,7 @@ Namespace API.PornHub
354360 Else
355361 Throw New ArgumentException( $"Type '{Type}' is not implemented in the video download function" , "Type" )
356362 End If
357- If Page > 1 Then URL &= $"? page={Page}"
363+ If Page > 1 Then URL &= $"{npd} page={Page}"
358364 ElseIf SiteMode = SiteModes.Playlists Then
359365 If PlaylistToken.IsEmptyString Then Throw New ArgumentNullException( "PlaylistToken" , "Unable to get 'PlaylistToken'" )
360366 URL = String .Format(PlayListUrlPattern, NameTrue, PlaylistToken, Page)
@@ -367,12 +373,21 @@ Namespace API.PornHub
367373 'Debug.WriteLine(URL)
368374 Dim r$ = Responser.GetResponse(URL)
369375 If Not r.IsEmptyString Then
370- Dim l As List( Of UserVideo) = RegexFields( Of UserVideo)(r, {RegexUserVideos}, { 6 , 7 , 3 , 10 })
376+ Dim l As List( Of UserVideo) = RegexFields( Of UserVideo)(r, {RegexUserVideos}, { 6 , 7 , 3 , 11 })
371377 'If l.ListExists And Not SiteMode = SiteModes.Playlists Then l = l.ListTake(3, l.Count).ToList
372- If l.ListExists And Not SiteMode = SiteModes.Playlists Then l = l.ListTake( 1 , l.Count).ToList
378+ If l.ListExists And Not SiteMode = SiteModes.Playlists And Not IsUser Then l = l.ListTake( 1 , l.Count).ToList
373379 If l.ListExists Then
374380 If IsUser Then
375- If Type = VideoTypes.Favorite Then
381+ If Type = VideoTypes.Tagged Then
382+ l = l.ListTake( 4 , l.Count)
383+ If l.ListExists Then l.RemoveAll( Function (uv) Not uv.UserRef.IsEmptyString AndAlso uv.UserRef = usrRef)
384+ ElseIf Type = VideoTypes.Uploaded Then
385+ If PersonType = PersonTypeCannel Then
386+ l = l.ListTake( 4 , l.Count)
387+ Else
388+ l.RemoveAll( Function (uv) uv.UserRef.IsEmptyString OrElse Not uv.UserRef = usrRef)
389+ End If
390+ ElseIf Type = VideoTypes.Favorite Then
376391 l.RemoveAll( Function (uv) uv.Type = VideoTypes.Private)
377392 ElseIf Not PersonType = PersonTypeCannel Then
378393 l.RemoveAll( Function (uv) Not uv.Type = Type)
0 commit comments