Skip to content

Commit a540ade

Browse files
committed
2023.11.24.0
Scheduler: handle scheduler change error (collection was modified) SchedulerEditorForm: add scheduler name to form title DownloadProgress: fix disposing error when some objects are already null API.Reddit: add special notification for error 429 API.Twitter: handle JSON deserialization error Porn sites: fix incorrect parsing of search queries YouTube: path not set when adding array to download
1 parent 0ec617c commit a540ade

20 files changed

Lines changed: 157 additions & 131 deletions

File tree

Changelog.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# 2023.11.24.0
2+
3+
*2023-11-24*
4+
5+
For those of you who use TikTok, I recommend updating [TikTok plugin](https://github.com/bashonly/yt-dlp-TTUser) to the latest version using [these instructions](https://github.com/AAndyProgram/SCrawler/wiki/Settings#how-to-install-yt-dlp-ttuser-plugin).
6+
7+
- Added
8+
- Automation: manual task option
9+
- Scheduler: add scheduler name to form title
10+
- Feeds: update when users' location and/or basic information changes
11+
- Reddit: special notification for error 429
12+
- TikTok: ID, username and friendly name extraction from data
13+
- TikTok: new option `Use video date as file date`
14+
- YouTube: absolute path for a single playlist
15+
- Updated
16+
- yt-dlp up to version 2023.11.16
17+
- Fixed
18+
- Scheduler: scheduler change error
19+
- Twitter: JSON deserialization error
20+
- xHamster, XVideos, PornHub, ThisVid: incorrect parsing of search queries
21+
- YouTube: the file name is not changed manually
22+
- YouTube: path not set when adding array to download
23+
- Minor bugs
24+
125
# 2023.11.17.0
226

327
*2023-11-17*

SCrawler.PluginProvider/My Project/AssemblyInfo.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
3232
' by using the '*' as shown below:
3333
' <Assembly: AssemblyVersion("1.0.*")>
3434

35-
<Assembly: AssemblyVersion("2023.11.17.0")>
36-
<Assembly: AssemblyFileVersion("2023.11.17.0")>
35+
<Assembly: AssemblyVersion("2023.11.24.0")>
36+
<Assembly: AssemblyFileVersion("2023.11.24.0")>
3737
<Assembly: NeutralResourcesLanguage("en")>

SCrawler.YouTube/Downloader/VideoListForm.vb

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,17 @@ Namespace DownloadObjects.STDownloader
278278
.IsMusic = containers.Any(Function(cc) cc.IsMusic)
279279
}
280280
c.Elements.AddRange(containers)
281+
Dim path$ = c.Elements(0).File.PathWithSeparator
282+
For Each list As List(Of String) In {
283+
c.Elements.Select(Function(cc) cc.UserTitle).ListWithRemove(Function(cc) cc.IsEmptyString).ListIfNothing,
284+
c.Elements.Select(Function(cc) cc.PlaylistTitle).ListWithRemove(Function(cc) cc.IsEmptyString).ListIfNothing
285+
}
286+
If list.Count > 0 AndAlso
287+
(list.Count = 1 OrElse
288+
ListAddList(Nothing, list, LAP.NotContainsOnly, EDP.ReturnValue).ListIfNothing.Count = 1) Then _
289+
path &= $"{list(0)}\"
290+
Next
291+
c.File = path
281292
End If
282293
End If
283294
End With
@@ -450,12 +461,16 @@ Namespace DownloadObjects.STDownloader
450461
UpdateLogButton()
451462
End Sub
452463
Protected Sub AddToDownload(ByRef Item As MediaItem, ByVal RunThread As Boolean)
453-
Dim hc% = Item.MyContainer.GetHashCode
454-
If MyJob.Count = 0 OrElse Not MyJob.Items.Exists(Function(i) i.MyContainer.GetHashCode = hc) Then
455-
MyJob.Add(Item)
456-
Item.AddToQueue()
457-
If RunThread Then StartDownloading()
458-
End If
464+
Try
465+
Dim hc% = Item.MyContainer.GetHashCode
466+
If MyJob.Count = 0 OrElse Not MyJob.Items.Exists(Function(i) i.MyContainer.GetHashCode = hc) Then
467+
MyJob.Add(Item)
468+
Item.AddToQueue()
469+
If RunThread Then StartDownloading()
470+
End If
471+
Catch ex As Exception
472+
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[VideoListForm.AddToDownload]")
473+
End Try
459474
End Sub
460475
Private Sub StartDownloading()
461476
If Not MyJob.Working And MyJob.Count > 0 Then

SCrawler.YouTube/My Project/AssemblyInfo.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
3232
' by using the '*' as shown below:
3333
' <Assembly: AssemblyVersion("1.0.*")>
3434

35-
<Assembly: AssemblyVersion("2023.11.17.0")>
36-
<Assembly: AssemblyFileVersion("2023.11.17.0")>
35+
<Assembly: AssemblyVersion("2023.11.24.0")>
36+
<Assembly: AssemblyFileVersion("2023.11.24.0")>
3737
<Assembly: NeutralResourcesLanguage("en")>

SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
3232
' by using the '*' as shown below:
3333
' <Assembly: AssemblyVersion("1.0.*")>
3434

35-
<Assembly: AssemblyVersion("2023.11.17.0")>
36-
<Assembly: AssemblyFileVersion("2023.11.17.0")>
35+
<Assembly: AssemblyVersion("2023.11.24.0")>
36+
<Assembly: AssemblyFileVersion("2023.11.24.0")>
3737
<Assembly: NeutralResourcesLanguage("en")>

SCrawler/API/Base/UserDataBase.vb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,8 +1729,6 @@ BlockNullPicture:
17291729
DownloadContentDefault_PostProcessing(v, f, Token)
17301730
dCount += 1
17311731
Catch woex As OperationCanceledException When Token.IsCancellationRequested
1732-
'TODELETE: UserDataBase.DownloadContentDefault: remove file when 'OperationCanceledException'
1733-
'If f.Exists Then f.Delete(,, EDP.SendToLog)
17341732
__deleteFile.Invoke(f, v.URL_BASE)
17351733
v.State = UStates.Missing
17361734
v.Attempts += 1

SCrawler/API/JustForFans/M3U8.vb

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -126,70 +126,6 @@ Namespace API.JustForFans
126126
$"API.JustForFans.M3U8.GetFiles({IIf(IsAudio, "audio", "video")}):{vbCr}URL: {URL}{vbCr}File: {File}")
127127
End Try
128128
End Sub
129-
'TODELETE: JFF.M3U8.GetFiles_OLD 20231008
130-
'Private Sub GetFiles_OLD(ByVal URL As String, ByRef File As SFile, ByVal IsAudio As Boolean)
131-
' Try
132-
' Dim r$ = Responser.GetResponse(URL)
133-
' If Not r.IsEmptyString Then
134-
' Dim data As List(Of RegexMatchStruct) = RegexFields(Of RegexMatchStruct)(r, {REGEX_PLS_FILES}, {1, 2}, EDP.ReturnValue)
135-
' If data.ListExists Then
136-
' Dim appender$ = URL.Replace(URL.Split("/").LastOrDefault, String.Empty)
137-
' With (From d As RegexMatchStruct In data
138-
' Where Not d.Arr(0).IfNullOrEmpty(d.Arr(1)).IsEmptyString
139-
' Select M3U8Base.CreateUrl(appender, d.Arr(0).IfNullOrEmpty(d.Arr(1)).Trim)).ToList
140-
' If .ListExists Then
141-
' File = $"{Cache.RootDirectory.PathWithSeparator}{IIf(IsAudio, "AUDIO.aac", "VIDEO.mp4")}"
142-
' Dim tmpCache As CacheKeeper = Cache.NewInstance
143-
' Dim tmpFile As SFile = .Item(0)
144-
' If tmpFile.Extension.IsEmptyString Then tmpFile.Extension = "ts"
145-
' tmpFile.Path = tmpCache.RootDirectory.Path
146-
' tmpFile.Separator = "\"
147-
148-
' Dim cFile As SFile = tmpFile
149-
' cFile.Name = "all"
150-
151-
' tmpCache.Validate()
152-
153-
' Using bat As New TextSaver
154-
' Using b As New BatchExecutor(True) With {.Encoding = Settings.CMDEncoding}
155-
' AddHandler b.OutputDataReceived, AddressOf Batch_OutputDataReceived
156-
' bat.AppendLine($"chcp {BatchExecutor.UnicodeEncoding}")
157-
' bat.AppendLine(BatchExecutor.GetDirectoryCommand(tmpCache))
158-
' ProgressChangeMax(.Count * 2 + 1)
159-
' Using w As New WebClient
160-
' For i = 0 To .Count - 1
161-
' tmpFile.Name = $"ConPart_{i}"
162-
' Thrower.ThrowAny()
163-
' 'Responser.DownloadFile(.Item(i), tmpFile)
164-
' w.DownloadFile(.Item(i), tmpFile)
165-
' ProgressPerform()
166-
' tmpCache.AddFile(tmpFile, True)
167-
' bat.AppendLine($"type {tmpFile.File} >> {cFile.File}")
168-
' Next
169-
' End Using
170-
171-
' bat.AppendLine($"""{Settings.FfmpegFile}"" -i {cFile.File} -c copy ""{File}""")
172-
173-
' Dim batFile As SFile = bat.SaveAs($"{tmpCache.RootDirectory.PathWithSeparator}command.bat")
174-
175-
' b.Execute($"""{batFile}""")
176-
177-
' If Not File.Exists Then File = Nothing
178-
' End Using
179-
' End Using
180-
' End If
181-
' End With
182-
' End If
183-
' End If
184-
' Catch oex As OperationCanceledException
185-
' Throw oex
186-
' Catch dex As ObjectDisposedException
187-
' Throw dex
188-
' Catch ex As Exception
189-
' ErrorsDescriber.Execute(EDP.SendToLog + EDP.ThrowException, ex,
190-
' $"API.JustForFans.M3U8.GetFiles({IIf(IsAudio, "audio", "video")}):{vbCr}URL: {URL}{vbCr}File: {File}")
191-
' End Try
192-
'End Sub
193129
Private Async Sub Batch_OutputDataReceived(ByVal Sender As Object, ByVal e As DataReceivedEventArgs)
194130
Await Task.Run(Sub() If Not e.Data.IsEmptyString AndAlso e.Data.Contains("] Opening") Then ProgressPerform())
195131
End Sub

SCrawler/API/JustForFans/UserData.vb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ Namespace API.JustForFans
168168
#Region "Initializer"
169169
Friend Sub New()
170170
UseInternalM3U8Function = True
171-
'TODELETE: UseResponserClient 20231008
172-
'UseResponserClient = True
173171
End Sub
174172
#End Region
175173
#Region "Download functions"

SCrawler/API/PornHub/UserData.vb

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,30 +423,28 @@ Namespace API.PornHub
423423
newLastPageIDs.Add(uv.ID)
424424
If Not _TempPostsList.Contains(uv.ID) Then
425425
_TempPostsList.Add(uv.ID)
426+
newPostsFound = True
426427
Return False
427428
ElseIf SessionPosts.Count > 0 AndAlso SessionPosts.Contains(uv.id) Then
428429
prevPostsFound = True
429-
If pageRepeatSet Then pageRepeatSet = False : _PageVideosRepeat -= 1
430430
Return True
431431
Else
432-
'TODELETE: PornHub old validating
433-
'If Not SessionPosts.Contains(uv.ID) Then nonLastPageDetected = True
434432
If Not pageRepeatSet And Not newPostsFound Then pageRepeatSet = True : _PageVideosRepeat += 1
435433
'Debug.WriteLine($"[REMOVED]: {uv.Title}")
436434
Return True
437435
End If
438436
End Function)
439437
'Debug.WriteLineIf(l.Count > 0, l.Select(Function(ll) ll.Title).ListToString(vbNewLine))
438+
If prevPostsFound And Not pageRepeatSet And Not newPostsFound Then pageRepeatSet = True : _PageVideosRepeat += 1
439+
If prevPostsFound And newPostsFound And pageRepeatSet Then _PageVideosRepeat -= 1
440440
If l.Count > 0 Then _TempMediaList.ListAddList(l.Select(Function(uv) uv.ToUserMedia(specFolder)))
441441
SessionPosts.ListAddList(newLastPageIDs, LNC)
442442
newLastPageIDs.Clear()
443-
'TODELETE: PornHub old validating
444-
'If l.Count > 0 AndAlso (l.Count = lBefore Or Not nonLastPageDetected) AndAlso
445-
' Not (limit > 0 And _TempMediaList.Count >= limit) Then tryNextPage = True
446443

447444
If limit > 0 And _TempMediaList.Count >= limit Then Exit Sub
448-
If (Not IsUser And prevPostsFound And Not newPostsFound And Page < 1000) Or
449-
(Not cBefore = _TempMediaList.Count And (IsUser Or Page < 1000)) Then tryNextPage = True
445+
If _PageVideosRepeat < 2 And
446+
((Not IsUser And prevPostsFound And Not newPostsFound And Page < 1000) Or
447+
(Not cBefore = _TempMediaList.Count And (IsUser Or Page < 1000))) Then tryNextPage = True
450448

451449
l.Clear()
452450
End If

SCrawler/API/Reddit/SiteSettings.vb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ Namespace API.Reddit
5050
Friend ReadOnly Property UseCookiesForTimelines As PropertyValue
5151
<PropertyOption(ControlText:=DeclaredNames.SavedPostsUserNameCaption, ControlToolTip:=DeclaredNames.SavedPostsUserNameToolTip, IsAuth:=True), PXML, PClonable(Clone:=False)>
5252
Friend ReadOnly Property SavedPostsUserName As PropertyValue
53+
Friend ReadOnly Property CredentialsExists As Boolean
54+
Get
55+
Return {AuthUserName.Value, AuthPassword.Value, ApiClientID.Value, ApiClientSecret.Value}.All(Function(v$) Not v.IsEmptyString)
56+
End Get
57+
End Property
58+
5359
#End Region
5460
#Region "Other"
5561
<PropertyOption(ControlText:="Use M3U8", ControlToolTip:="Use M3U8 or mp4 for Reddit videos", IsAuth:=False), PXML, PClonable>
@@ -238,8 +244,7 @@ Namespace API.Reddit
238244
Return False
239245
End Function
240246
Private Function UpdateTokenIfRequired() As Boolean
241-
If (CBool(UseTokenForTimelines.Value) Or CBool(UseTokenForSavedPosts.Value)) AndAlso
242-
{AuthUserName.Value, AuthPassword.Value, ApiClientID.Value, ApiClientSecret.Value}.All(Function(v$) Not v.IsEmptyString) Then
247+
If (CBool(UseTokenForTimelines.Value) Or CBool(UseTokenForSavedPosts.Value)) AndAlso CredentialsExists Then
243248
If CDate(BearerTokenDateUpdate.Value).AddMinutes(TokenUpdateInterval.Value) <= Now Then Return UpdateToken()
244249
End If
245250
Return True

0 commit comments

Comments
 (0)