From 22c59b41f09c340cea3cad045b991fe03634c162 Mon Sep 17 00:00:00 2001 From: Andy <88590076+AAndyProgram@users.noreply.github.com> Date: Sun, 19 May 2024 22:29:16 +0300 Subject: [PATCH] 2024.5.19.0 YT YouTubeSettings: add 'CreateDescriptionFiles_AddUploadDate' and 'CreateDescriptionFiles_CreateWithNoDescription' properties YouTubeMediaContainerBase: add upload date to description SCrawler API.YouTube: 'YTSettings_Internal' is not saved when changed --- Changelog.md | 9 ++++++++ SCrawler.YouTube/Base/YouTubeSettings.vb | 6 +++++ SCrawler.YouTube/My Project/AssemblyInfo.vb | 4 ++-- .../Objects/YouTubeMediaContainerBase.vb | 22 ++++++++++++++----- .../My Project/AssemblyInfo.vb | 4 ++-- SCrawler/API/Twitter/UserData.vb | 3 +-- SCrawler/API/YouTube/SiteSettings.vb | 2 +- SCrawler/My Project/AssemblyInfo.vb | 4 ++-- 8 files changed, 39 insertions(+), 15 deletions(-) diff --git a/Changelog.md b/Changelog.md index f87378f..fe94de6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,12 @@ +# 2024.5.19.0 + +*2024-05-19* + +- Added + - YouTube (standalone app): add upload date to description (request #192) (`Settings` - `Info` - `Create description files: add upload date`, `Create description files: create without description`). +- Fixed + - YouTube (SCrawler): advanced settings are not saved when changed + # 2024.5.18.0 *2024-05-18* diff --git a/SCrawler.YouTube/Base/YouTubeSettings.vb b/SCrawler.YouTube/Base/YouTubeSettings.vb index a70091d..c715aaa 100644 --- a/SCrawler.YouTube/Base/YouTubeSettings.vb +++ b/SCrawler.YouTube/Base/YouTubeSettings.vb @@ -162,6 +162,12 @@ Namespace API.YouTube.Base Public ReadOnly Property CreateDescriptionFiles As XMLValue(Of Boolean) + + Public ReadOnly Property CreateDescriptionFiles_AddUploadDate As XMLValue(Of Boolean) + + Public ReadOnly Property CreateDescriptionFiles_CreateWithNoDescription As XMLValue(Of Boolean) Public ReadOnly Property CreateThumbnails_Video As XMLValue(Of Boolean) diff --git a/SCrawler.YouTube/My Project/AssemblyInfo.vb b/SCrawler.YouTube/My Project/AssemblyInfo.vb index 8dce322..47e54e6 100644 --- a/SCrawler.YouTube/My Project/AssemblyInfo.vb +++ b/SCrawler.YouTube/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/SCrawler.YouTube/Objects/YouTubeMediaContainerBase.vb b/SCrawler.YouTube/Objects/YouTubeMediaContainerBase.vb index 5226a6c..a0a917a 100644 --- a/SCrawler.YouTube/Objects/YouTubeMediaContainerBase.vb +++ b/SCrawler.YouTube/Objects/YouTubeMediaContainerBase.vb @@ -1143,12 +1143,22 @@ Namespace API.YouTube.Objects If fileUrl.Exists Then AddFile(fileUrl) End If - If MyYouTubeSettings.CreateDescriptionFiles And Not Description.IsEmptyString Then - Dim fileDesr As SFile = File - fileDesr.Extension = "txt" - TextSaver.SaveTextToFile(Description, fileDesr,,, EDP.None) - If fileDesr.Exists Then AddFile(fileDesr) - End If + With MyYouTubeSettings + If .CreateDescriptionFiles And (Not Description.IsEmptyString Or + (.CreateDescriptionFiles_CreateWithNoDescription And .CreateDescriptionFiles_AddUploadDate)) Then + Dim fileDesr As SFile = File + fileDesr.Extension = "txt" + Using fileDesrText As New TextSaver(fileDesr) + If .CreateDescriptionFiles_AddUploadDate Then fileDesrText.Append($"Uploaded: {DateAdded:yyyy-MM-dd HH:mm:ss}") + If Not Description.IsEmptyString Then + If Not fileDesrText.IsEmptyString Then fileDesrText.AppendLine.AppendLine() + fileDesrText.Append(Description) + End If + fileDesrText.Save(EDP.None) + End Using + If fileDesr.Exists Then AddFile(fileDesr) + End If + End With If PlaylistCount > 0 And Not CoverDownloaded And Not PlaylistID.IsEmptyString Then DownloadPlaylistCover(PlaylistID, File, UseCookies) If prExists Then Progress.InformationTemporary = $"Download {MediaType}: post processing" diff --git a/SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb b/SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb index f2c11fa..272d70b 100644 --- a/SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb +++ b/SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/SCrawler/API/Twitter/UserData.vb b/SCrawler/API/Twitter/UserData.vb index a732213..44ad357 100644 --- a/SCrawler/API/Twitter/UserData.vb +++ b/SCrawler/API/Twitter/UserData.vb @@ -666,8 +666,7 @@ Namespace API.Twitter .AutoClear = True, .AutoReset = True, .CommandPermanent = $"chcp {BatchExecutor.UnicodeEncoding}", - .FileExchanger = confCache, - .DebugMode = True + .FileExchanger = confCache } tgdl.FileExchanger.DeleteCacheOnDispose = False tgdl.FileExchanger.DeleteRootOnDispose = False diff --git a/SCrawler/API/YouTube/SiteSettings.vb b/SCrawler/API/YouTube/SiteSettings.vb index 02b3657..2cd549f 100644 --- a/SCrawler/API/YouTube/SiteSettings.vb +++ b/SCrawler/API/YouTube/SiteSettings.vb @@ -59,10 +59,10 @@ Namespace API.YouTube .Cookies.Clear() .Cookies.AddRange(Responser.Cookies) .CookiesUpdated = True - .PerformUpdate() End With End If End With + DirectCast(MyYouTubeSettings, YTSettings_Internal).PerformUpdate() End If MyBase.Update() End Sub diff --git a/SCrawler/My Project/AssemblyInfo.vb b/SCrawler/My Project/AssemblyInfo.vb index 7403443..4936e74 100644 --- a/SCrawler/My Project/AssemblyInfo.vb +++ b/SCrawler/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + +