mirror of
https://github.com/AAndyProgram/SCrawler.git
synced 2026-03-14 15:52:18 +00:00
2023.8.6.0
Plugins.Attributes: add 'DependentFields' attribute Plugins.IPluginContentProvider: add 'Options' and 'IsSubscription' properties Plugins.ISiteSettings: add 'SubscriptionsAllowed' property Plugins.ExchangeOptions: add 'Options' field Plugins.Attributes.PropertyUpdater: replace 'Dependencies' with 'Arguments' YT: add 'OutputPathAskForName' and 'OutputPathAutoAddPaths' properties; add the ability to store download locations; add 'DownloadLocation' and 'DownloadLocationsCollection' objects YT.IDownloaderSettings: add 'OutputPathAskForName' and 'OutputPathAutoAddPaths' properties YT.Downloader: fixed bug with re-saving elements when loading a video list; fixed bug when files were not deleted when clicking on the delete button; fixed a bug that caused the video to redownload; download job removes elements at wrong indexes; added skipping of downloaded elements in the job; fixed a bug, pending option did not change after download complete YT.YouTubeMediaContainerBase: add '_MediaStateOnLoad' field and 'NeedToSave' function; update the 'Save' function to prevent saving a file when a download is complete and the file has already been saved; update code for new yt-dlp version Fixed cache deletion errors Add user queue Add global locations API.Base.SiteSettingsBase: implement 'SubscriptionsAllowed' property; remove request headers with null values on save; add '_AllowUserAgentUpdate' parameter API.Base.Structures: add 'SiteModes' enum API.Base.UserDataBase: add 'Erase' button; implement 'Options' and 'IsSubscription' properties; add 'SpecialLabels' property; update 'LVIKey'; update 'FitToAddParams' function; add 'EraseData' function; user colors; Not UserExists notification, UserQueue support API.Base: add 'DeclaredNames' API.Instagram: remove default values for headers; disable updating UserAgent from global; check for a new username for non-existent users API.Mastodon: bypass new inherited twitter options; update names and headers API.OnlyFans: make 'HH_BROWSER' property nullable; remove 'HH_BROWSER' from required; fix username bug (dots); handling of 504 and 429 errors; add 'DownloadHighlights' and 'DownloadChatMedia' options; add 'UserExchangeOptions'; fixed incorrect error handler API.PathPlugin: fixed incorrect detection of path existence API.Pinterest: add 'SpecialLabels' API.PornHub: add new video regex; remove old regex; added 'DownloadUploaded', 'DownloadTagged', 'DownloadPrivate' and 'DownloadFavorite' properties to 'SiteSettings', 'UserData' and 'UserExchangeOptions'; update regex to define user; added downloading search queries; update 'GetUserUrl' function; hide unnecessary 'RegexFieldsTextBecameNullException' errors; add subscriptions API.Reddit: add 'SpecialLabels'; add bearer token and its refresh interval; add OAuth; add additional options API.RedGifs: add 'DependentFields' for 'Token' API.ThisVid: add 'DownloadFavourite' option; add downloading search queries, tags, categories; add 'SpecialLabels'; add subscriptions; updating cookies issue API.TikTok: rewrite algorithms API.Twitter: add 'UseAppropriateModel', 'UseNewEndPointSearch', 'UseNewEndPointProfiles', 'AbortOnLimit', 'DownloadAlreadyParsed', 'MediaModelAllowNonUserTweets' properties; remove old commented code; remove 'TwitterPic_400' and replace with 'TwitterIcon_32.ToBitmap'; add 'DownloadModelForceApply' user option; update environment to GDL 1.25.8; fixed gifs downloading; fix typo in 'ReparseMissing'; update names API.UserDataBind: prevent adding site-specific labels when adding to a collection API.Xhamster: add downloading search queries, tags, categories; add 'SpecialLabels'; add additional nodes for channels; add subscriptions API.XVIDEOS: add downloading search queries, tags, categories; add 'SpecialLabels'; add subscriptions; changed users creation method; add subscriptions API.YouTube: add subscriptions AutoDownloader: add new group subscription options; update predicates; fixed excluded labels and sites in default mode; update notifications; add an additional skip options, add 'Force start' option DownloadedInfoForm: add subscriptions; fixed size/location bug; hide unnecessary error (refill) Feed: add subscriptions; update filters; add 'Ctrl+G' shortcut FeedMedia: add subscriptions; fixed 'webm' bug; add title for subscription media; add site icon to post; user colors; always using 'FriendlyName' instead of 'UserName' if it exists DownloadGroup, GroupDefaults, GroupParameters: add subscription and 'UsersCount' options MissingPostsForm: add 'BTT_DELETE_ALL' VideoDownloaderForm, DownloaderUrlForm, DownloaderUrlsArrForm: add download locations support VideoDownloaderForm: add subscriptions support GlobalSettingsForm: add new properties UserCreatorForm: add subscriptions; add 'Options' support (of 'ExchangeOptions'); user colors ListImagesLoader: add subscription colors; user colors MainFrame: add subscriptions; add filters by subscription and user; update predicates NuGet: update 'LibVLCSharp', 'LibVLCSharp.WinForms', 'VideoLAN.LibVLC.Windows' DownloadableMediaHost: update 'Save' function PropertyValueHost: fix 'CaptionWidth' bug; add 'Dependents' SettingsHost: add 'Dependents' UserDataHost: add 'Options' and 'IsSubscription' properties SettingsCLS: implement new 'IDownloaderSettings' properties; add 'CacheSnapshots'; add 'DownloadLocations'; add new properties UserInfo, UserFinder: add subscriptions UserSearchForm: fixed search by name bug
This commit is contained in:
@@ -65,6 +65,7 @@ Namespace API.YouTube.Objects
|
||||
End Set
|
||||
End Property
|
||||
Protected _MediaState As UMStates = UMStates.Unknown
|
||||
Protected _MediaStateOnLoad As UMStates = UMStates.Unknown
|
||||
<XMLEC> Public Property MediaState As UMStates Implements IYouTubeMediaContainer.MediaState, IUserMedia.DownloadState
|
||||
Get
|
||||
If _MediaState = UMStates.Unknown And HasElements Then
|
||||
@@ -591,7 +592,9 @@ Namespace API.YouTube.Objects
|
||||
Bitrate = 0
|
||||
_MediaType = UMTypes.Undefined
|
||||
If SelectedVideoIndex >= 0 Then
|
||||
cmd.StringAppend($"bv*[format_id={SelectedVideo.ID}]")
|
||||
'URGENT: 2023.3.4 -> 2023.7.6
|
||||
'cmd.StringAppend($"bv*[format_id={SelectedVideo.ID}]")
|
||||
cmd.StringAppend(SelectedVideo.ID)
|
||||
_Size = SelectedVideo.Size
|
||||
_MediaType = UMTypes.Video
|
||||
Height = SelectedVideo.Height
|
||||
@@ -602,7 +605,9 @@ Namespace API.YouTube.Objects
|
||||
End If
|
||||
If SelectedAudioIndex >= 0 Then
|
||||
Dim atCodec$
|
||||
cmd.StringAppend($"ba*[format_id={SelectedAudio.ID}]", "+")
|
||||
'URGENT: 2023.3.4 -> 2023.7.6
|
||||
'cmd.StringAppend($"ba*[format_id={SelectedAudio.ID}]", "+")
|
||||
cmd.StringAppend(SelectedAudio.ID, "+")
|
||||
If OutputAudioCodec.StringToLower = ac3 Then
|
||||
PostProcessing_AudioAC3 = True
|
||||
formats.StringAppend($"--audio-format {aac}", " ")
|
||||
@@ -633,7 +638,9 @@ Namespace API.YouTube.Objects
|
||||
subs = $"--write-subs --write-auto-subs --sub-format {OutputSubtitlesFormat.StringToLower} --sub-langs ""{subs}"" --convert-subs {OutputSubtitlesFormat.StringToLower}"
|
||||
End If
|
||||
If Not cmd.IsEmptyString Then
|
||||
cmd = $"yt-dlp -f ""{cmd}"""
|
||||
'URGENT: 2023.3.4 -> 2023.7.6
|
||||
'cmd = $"yt-dlp -f ""{cmd}"""
|
||||
cmd = $"yt-dlp -f {cmd}"
|
||||
If Not MyYouTubeSettings.ReplaceModificationDate Then cmd &= " --no-mtime"
|
||||
cmd.StringAppend(formats, " ")
|
||||
cmd.StringAppend(subs, " ")
|
||||
@@ -1017,6 +1024,7 @@ Namespace API.YouTube.Objects
|
||||
Dim fc As SFile = x.Value(Name_CachePath).CSFileP
|
||||
If fc.Exists(SFO.Path, False) AndAlso SFile.GetFiles(fc, "*.json",, EDP.ReturnValue).Count > 0 Then Parse(Nothing, fc, IsMusic)
|
||||
XMLPopulateData(Me, x)
|
||||
_MediaStateOnLoad = _MediaState
|
||||
_Exists = True
|
||||
If If(x(Name_CheckedElements)?.Count, 0) > 0 Then ApplyElementCheckedValue(x(Name_CheckedElements))
|
||||
If ArrayMaxResolution <> -10 Then SetMaxResolution(ArrayMaxResolution)
|
||||
@@ -1031,6 +1039,9 @@ Namespace API.YouTube.Objects
|
||||
End Sub
|
||||
#End Region
|
||||
#Region "Save"
|
||||
Protected Function NeedToSave() As Boolean
|
||||
Return Not _MediaStateOnLoad = _MediaState And Not FileSettings.Exists
|
||||
End Function
|
||||
Private Function GetThumbnails() As IEnumerable(Of SFile)
|
||||
If HasElements Then
|
||||
Return ListAddList(Of SFile)(New List(Of SFile)({ThumbnailFile}),
|
||||
@@ -1041,46 +1052,50 @@ Namespace API.YouTube.Objects
|
||||
End Function
|
||||
Public Overridable Sub Save() Implements IDownloadableMedia.Save
|
||||
Try
|
||||
Dim fSettings As SFile = FileSettings
|
||||
If fSettings.IsEmptyString Then fSettings = MyCacheSettings.NewFile
|
||||
Dim f As SFile = fSettings
|
||||
If NeedToSave() Then
|
||||
Dim fSettings As SFile = FileSettings
|
||||
If fSettings.IsEmptyString Then fSettings = MyCacheSettings.NewFile
|
||||
Dim f As SFile = fSettings
|
||||
|
||||
If Not MediaState = UMStates.Downloaded Then
|
||||
If CachePath.Exists(SFO.Path, False) AndAlso Not CachePath.Path.Contains(MyCacheSettings.RootDirectory.Path) Then
|
||||
f = $"{f.PathWithSeparator}{f.Name}\"
|
||||
If f.Exists(SFO.Path) Then
|
||||
Dim files As List(Of SFile) = SFile.GetFiles(CachePath, "*.json", IO.SearchOption.AllDirectories, EDP.ReturnValue)
|
||||
If files.ListExists Then
|
||||
CachePath = f
|
||||
Dim fd As SFile = f
|
||||
fd.Extension = "json"
|
||||
For Each f In files
|
||||
fd.Name = f.Name
|
||||
SFile.Move(f, fd)
|
||||
Next
|
||||
Else
|
||||
If CachePath.Exists(SFO.Path, False) Then CachePath.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.None)
|
||||
CachePath = Nothing
|
||||
If Not MediaState = UMStates.Downloaded Then
|
||||
If CachePath.Exists(SFO.Path, False) AndAlso Not CachePath.Path.Contains(MyCacheSettings.RootDirectory.Path) Then
|
||||
f = $"{f.PathWithSeparator}{f.Name}\"
|
||||
If f.Exists(SFO.Path) Then
|
||||
Dim files As List(Of SFile) = SFile.GetFiles(CachePath, "*.json", IO.SearchOption.AllDirectories, EDP.ReturnValue)
|
||||
If files.ListExists Then
|
||||
CachePath = f
|
||||
Dim fd As SFile = f
|
||||
fd.Extension = "json"
|
||||
For Each f In files
|
||||
fd.Name = f.Name
|
||||
SFile.Move(f, fd)
|
||||
Next
|
||||
Else
|
||||
If CachePath.Exists(SFO.Path, False) Then CachePath.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.None)
|
||||
CachePath = Nothing
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If CachePath.Exists(SFO.Path, False) Then CachePath.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.None)
|
||||
CachePath = Nothing
|
||||
If ThumbnailFile.IsEmptyString And HasElements Then
|
||||
With ListAddList(Nothing, GetThumbnails, LAP.NotContainsOnly).ListWithRemove(Function(tf) tf.IsEmptyString)
|
||||
If .ListExists Then _ThumbnailFile = .FirstOrDefault(Function(tf) tf.Exists)
|
||||
End With
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If CachePath.Exists(SFO.Path, False) Then CachePath.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.None)
|
||||
CachePath = Nothing
|
||||
If ThumbnailFile.IsEmptyString And HasElements Then
|
||||
With ListAddList(Nothing, GetThumbnails, LAP.NotContainsOnly).ListWithRemove(Function(tf) tf.IsEmptyString)
|
||||
If .ListExists Then _ThumbnailFile = .FirstOrDefault(Function(tf) tf.Exists)
|
||||
End With
|
||||
End If
|
||||
End If
|
||||
|
||||
Using x As New XmlFile With {.AllowSameNames = True}
|
||||
fSettings.Extension = "xml"
|
||||
FileSettings = fSettings
|
||||
x.AddRange(ToEContainer.Elements)
|
||||
x.Name = "MediaContainer"
|
||||
x.Save(fSettings)
|
||||
End Using
|
||||
Using x As New XmlFile With {.AllowSameNames = True}
|
||||
fSettings.Extension = "xml"
|
||||
FileSettings = fSettings
|
||||
If NeedToSave() Then
|
||||
x.AddRange(ToEContainer.Elements)
|
||||
x.Name = "MediaContainer"
|
||||
x.Save(fSettings)
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ErrorsDescriber.Execute(EDP.SendToLog, ex, $"YouTubeMediaContainerBase.Save({FileSettings})")
|
||||
End Try
|
||||
@@ -1244,25 +1259,27 @@ Namespace API.YouTube.Objects
|
||||
obj.Height = AConvert(Of Integer)(ee.Value("height"), NumberProvider, -1)
|
||||
obj.FPS = AConvert(Of Double)(ee.Value("fps"), NumberProvider, -1)
|
||||
obj.Bitrate = AConvert(Of Double)(ee.Value("tbr"), NumberProvider, -1)
|
||||
obj.Protocol = ee.Value("protocol")
|
||||
If Not obj.Protocol.IsEmptyString Then obj.Protocol = obj.Protocol.Split("_").FirstOrDefault
|
||||
nValue = AConvert(Of Double)(ee.Value("filesize"), NumberProvider, -1)
|
||||
If nValue > 0 Then obj.Size = (nValue / 1024).RoundVal(2)
|
||||
If obj.Size <= 0 Then
|
||||
nValue = AConvert(Of Double)(ee.Value("filesize_approx"), NumberProvider, -1)
|
||||
If nValue > 0 Then obj.Size = (nValue / 1024).RoundVal(2)
|
||||
End If
|
||||
If obj.Size <= 0 And obj.Bitrate > 0 And Duration.TotalSeconds > 0 Then _
|
||||
obj.Size = (obj.Bitrate / 8 * Duration.TotalSeconds).RoundVal(2)
|
||||
|
||||
sValue = ee.Value("vcodec")
|
||||
If validCodecValue(sValue) Then
|
||||
obj.Type = UMTypes.Video
|
||||
obj.Codec = sValue.Split(".").First
|
||||
If validCodecValue(ee.Value("acodec")) Then
|
||||
obj.Type = av
|
||||
If obj.Size <= 0 Then
|
||||
nValue = AConvert(Of Double)(ee.Value("filesize_approx"), NumberProvider, -1)
|
||||
If nValue > 0 Then obj.Size = (nValue / 1024).RoundVal(2)
|
||||
End If
|
||||
End If
|
||||
If validCodecValue(ee.Value("acodec")) Then obj.Type = av
|
||||
Else
|
||||
sValue = ee.Value("acodec")
|
||||
If validCodecValue(sValue) Then
|
||||
obj.Type = UMTypes.Audio
|
||||
obj.Codec = sValue.Split(".").First
|
||||
obj.Bitrate = AConvert(Of Double)(ee.Value("tbr"), NumberProvider, -1)
|
||||
Else
|
||||
Continue For
|
||||
End If
|
||||
@@ -1292,6 +1309,7 @@ Namespace API.YouTube.Objects
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
If MediaObjects.Count > 0 And Not MyYouTubeSettings.DefaultVideoIncludeNullSize Then MediaObjects.RemoveAll(Function(mo) mo.Size <= 0)
|
||||
If MediaObjects.Count > 0 Then DupRemover.Invoke(UMTypes.Audio)
|
||||
If MediaObjects.Count > 0 Then DupRemover.Invoke(UMTypes.Video)
|
||||
If MediaObjects.Count > 0 Then
|
||||
|
||||
Reference in New Issue
Block a user