Skip to content

Commit

Permalink
2024.6.10.0
Browse files Browse the repository at this point in the history
YT
YouTubeSettings: add 'VideoPlaylist_AddExtractedMP3' property
MediaItem: improve visualization of height and bitrate
YouTubeMediaContainerBase: fix bugs on default post-processing formats; add 'HeightBase' and 'BitrateBase' properties; add extracted MP3 to playlist
VideoListForm: add 'UpdateLogButton' handlers

SCrawler
Feed: add settings to show/hide site name and file type from media title; add move/copy files of a loaded feed/session to another location; add the ability to reset current session
DownloadFeedForm: when moving saved posts files without replacing the profile, some data is lost
FeedVideo: add double-click handler to open video in external player
API.Instagram: update settings
  • Loading branch information
AAndyProgram committed Jun 10, 2024
1 parent 93ea2a5 commit aef4ce1
Show file tree
Hide file tree
Showing 23 changed files with 282 additions and 88 deletions.
13 changes: 13 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 2024.6.10.0

*2024-06-10*

- Added
- YouTube (standalone app): add option to add extracted MP3 to playlist (`Settings` - `Defaults Video` - `Add extracted MP3 to playlist`)
- Feed
- settings to show/hide site name and file type from media title
- ability to move/copy files of a loaded feed/session to another location
- ability to reset current session
- Fixed
- Minor bugs

# 2024.6.6.0

*2024-06-06*
Expand Down
Binary file modified ProgramScreenshots/SettingsGlobalFeed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions SCrawler.YouTube/Base/YouTubeSettings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ Namespace API.YouTube.Base
<Browsable(True), GridVisible, XMLVN({"DefaultsVideo"}, -1), Category("Defaults Video"), DisplayName("Highlight FPS (lower)"),
Description("Highlight frame rates lower than this value." & vbCr & "Default: -1" & vbCr & "-1 to disable")>
Public ReadOnly Property DefaultVideoHighlightFPS_L As XMLValue(Of Integer)
<Browsable(True), GridVisible, XMLVN({"DefaultsVideo"}), Category("Defaults Video"), DisplayName("Add extracted MP3 to playlist"),
Description("If you also extract MP3 when download the video, add the extracted MP3 to the playlist. Default: false.")>
Public ReadOnly Property VideoPlaylist_AddExtractedMP3 As XMLValue(Of Boolean)
#End Region
#Region "Defaults Audio"
<Browsable(True), GridVisible, XMLVN({"DefaultsAudio"}, "AAC"), Category("Defaults Audio"), DisplayName("Default codec"),
Expand Down
15 changes: 11 additions & 4 deletions SCrawler.YouTube/Downloader/MediaItem.vb
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,24 @@ Namespace DownloadObjects.STDownloader
ICON_SITE.Image = .SiteIcon
LBL_TIME.Text = AConvert(Of String)(.Duration, TimeToStringProvider, String.Empty)
LBL_TITLE.Text = $"{If(MyYouTubeSettings.FileAddDateToFileName_VideoList.Value, $"[{ .DateAdded:yyyy-MM-dd}] ", String.Empty)}{ .ToString(True)}"
Dim h%, b%
If .Self.GetType Is GetType(YouTubeMediaContainerBase) OrElse (Not .Self.GetType.BaseType Is Nothing AndAlso .Self.GetType.BaseType Is GetType(YouTubeMediaContainerBase)) Then
With DirectCast(.Self, YouTubeMediaContainerBase) : h = .HeightBase : b = .BitrateBase : End With
Else
h = .Height
b = .Bitrate
End If
If Not .SiteKey = YouTubeSiteKey And .ContentType = Plugin.UserMediaTypes.Picture Then
LBL_INFO.Text = .File.Extension.StringToUpper
ElseIf Not .IsMusic And Not (.MediaType = Plugin.UserMediaTypes.Audio Or .MediaType = Plugin.UserMediaTypes.AudioPre) Then
If .Height > 0 Then
LBL_INFO.Text = $"{ .File.Extension.StringToUpper}{d}{ .Height}p"
If h > 0 Then
LBL_INFO.Text = $"{ .File.Extension.StringToUpper}{d}{h}p"
Else
LBL_INFO.Text = .File.Extension.StringToUpper
End If
Else
If .Bitrate > 0 Then
LBL_INFO.Text = $"{ .File.Extension.StringToUpper}{d}{ .Bitrate}k"
If b > 0 Then
LBL_INFO.Text = $"{ .File.Extension.StringToUpper}{d}{b}k"
Else
LBL_INFO.Text = .File.Extension.StringToUpper
End If
Expand Down
26 changes: 23 additions & 3 deletions SCrawler.YouTube/Downloader/VideoListForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ Namespace DownloadObjects.STDownloader
End If
MyNotificator = New YTNotificator(Me)
MyDownloaderSettings = MyYouTubeSettings
ProgramLogInitialize()
With ProgramLog
AddHandler .TextAdded, AddressOf ProgramLog_TextAdded
AddHandler .TextCleared, AddressOf ProgramLog_TextCleared
End With
UpdateLogButton()
End If

With MyView : .Import() : .SetFormSize() : End With
Expand Down Expand Up @@ -157,7 +163,7 @@ Namespace DownloadObjects.STDownloader
If PerformClick Then cnt.PerformClick()
If Not DisableDownload And MyDownloaderSettings.DownloadAutomatically Then AddToDownload(cnt, True)
End With
End Sub, EDP.None)
End Sub, EDP.SendToLog)
End Sub
#Region "Controls rendering"
Private Overloads Sub OffsetControls()
Expand Down Expand Up @@ -449,12 +455,26 @@ Namespace DownloadObjects.STDownloader
End Try
End Sub
#End Region
#Region "LOG"
Private Sub BTT_LOG_Click(sender As Object, e As EventArgs) Handles BTT_LOG.Click
MyMainLOG_ShowForm(DesignXML,,,, AddressOf UpdateLogButton)
End Sub
Friend Sub UpdateLogButton()
If AppMode Then MyMainLOG_UpdateLogButton(BTT_LOG, TOOLBAR_TOP)
Private Sub UpdateLogButton()
If AppMode Then
Try : MyMainLOG_UpdateLogButton(BTT_LOG, TOOLBAR_TOP) : Catch : End Try
End If
End Sub
Private _LogUpdateButtonSuspended As Boolean = False
Private Sub ProgramLog_TextAdded(ByVal Sender As Object, ByVal e As EventArgs)
If Not _LogUpdateButtonSuspended Then
_LogUpdateButtonSuspended = True
Try : ControlInvokeFast(TOOLBAR_TOP, BTT_LOG, AddressOf UpdateLogButton, EDP.None) : Catch : End Try
End If
End Sub
Private Sub ProgramLog_TextCleared(ByVal Sender As Object, ByVal e As EventArgs)
_LogUpdateButtonSuspended = False
End Sub
#End Region
Private Sub BTT_BUG_REPORT_Click(sender As Object, e As EventArgs) Handles BTT_BUG_REPORT.Click
Try
With MyYouTubeSettings
Expand Down
4 changes: 2 additions & 2 deletions SCrawler.YouTube/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2024.6.6.0")>
<Assembly: AssemblyFileVersion("2024.6.6.0")>
<Assembly: AssemblyVersion("2024.6.10.0")>
<Assembly: AssemblyFileVersion("2024.6.10.0")>
<Assembly: NeutralResourcesLanguage("en")>
67 changes: 46 additions & 21 deletions SCrawler.YouTube/Objects/YouTubeMediaContainerBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,11 @@ Namespace API.YouTube.Objects
<XMLEC(CollectionMode:=CollectionModes.String)>
Friend ReadOnly Property PostProcessing_OutputAudioFormats As List(Of String)
Friend Sub PostProcessing_OutputAudioFormats_Reset()
PostProcessing_OutputAudioFormats.Clear()
PostProcessing_OutputAudioFormats.ListAddList(MyYouTubeSettings.DefaultAudioCodecAddit)
If PostProcessing_OutputAudioFormats.Count > 0 Then
PostProcessing_OutputAudioFormats.Sort()
PostProcessing_OutputAudioFormats.RemoveAll(Function(s) s = -1)
End If
With PostProcessing_OutputAudioFormats
.Clear()
.ListAddList(MyYouTubeSettings.DefaultAudioCodecAddit)
If .Count > 0 Then .Sort()
End With
End Sub
<XMLEC("OutputAudioBitrate")> Protected _OutputAudioBitrate As Integer = -1
Friend Property OutputAudioBitrate As Integer
Expand Down Expand Up @@ -322,21 +321,19 @@ Namespace API.YouTube.Objects
<XMLEC(CollectionMode:=CollectionModes.String)>
Friend ReadOnly Property PostProcessing_OutputSubtitlesFormats As List(Of String)
Friend Sub PostProcessing_OutputSubtitlesFormats_Reset()
PostProcessing_OutputSubtitlesFormats.Clear()
PostProcessing_OutputSubtitlesFormats.ListAddList(MyYouTubeSettings.DefaultSubtitlesFormatAddit)
If PostProcessing_OutputSubtitlesFormats.Count > 0 Then
PostProcessing_OutputSubtitlesFormats.Sort()
PostProcessing_OutputSubtitlesFormats.RemoveAll(Function(s) s = -1)
End If
With PostProcessing_OutputSubtitlesFormats
.Clear()
.ListAddList(MyYouTubeSettings.DefaultSubtitlesFormatAddit)
If .Count > 0 Then .Sort()
End With
End Sub
Friend Sub SubtitlesSelectedIndexesReset()
SubtitlesSelectedIndexes.Clear()
Dim subs As List(Of Subtitles) = Subtitles
SubtitlesSelectedIndexes.ListAddList(MyYouTubeSettings.DefaultSubtitles.Select(Function(s) subs.FindIndex(Function(ss) ss.ID = s)))
If SubtitlesSelectedIndexes.Count > 0 Then
SubtitlesSelectedIndexes.Sort()
SubtitlesSelectedIndexes.RemoveAll(Function(s) s = -1)
End If
With SubtitlesSelectedIndexes
.Clear()
Dim subs As List(Of Subtitles) = Subtitles
.ListAddList(MyYouTubeSettings.DefaultSubtitles.Select(Function(s) subs.FindIndex(Function(ss) ss.ID = s)))
If .Count > 0 Then .Sort() : .RemoveAll(Function(s) s = -1)
End With
End Sub
Private Sub SetElementsSubtitles(ByVal Source As YouTubeMediaContainerBase)
If Not Source Is Nothing And HasElements Then
Expand Down Expand Up @@ -442,6 +439,19 @@ Namespace API.YouTube.Objects
End Get
End Property
<XMLEC> Public Property Height As Integer Implements IYouTubeMediaContainer.Height
Friend ReadOnly Property HeightBase As Integer
Get
If Height > 0 Then
Return Height
ElseIf SelectedVideoIndex.ValueBetween(0, MediaObjects.Count - 1) Then
Return SelectedVideo.Height
ElseIf SelectedAudioIndex.ValueBetween(0, MediaObjects.Count - 1) Then
Return SelectedAudio.Height
Else
Return 0
End If
End Get
End Property
Protected _Bitrate As Integer = 0
<XMLEC> Public Overridable Property Bitrate As Integer Implements IYouTubeMediaContainer.Bitrate
Get
Expand All @@ -459,6 +469,20 @@ Namespace API.YouTube.Objects
Me._Bitrate = _Bitrate
End Set
End Property
Friend ReadOnly Property BitrateBase As Integer
Get
If Bitrate > 0 Then
Return Bitrate
ElseIf OutputAudioBitrate > 0 Then
Return OutputAudioBitrate
ElseIf HasElements Then
Try : Return Elements.Average(Function(e) DirectCast(e, YouTubeMediaContainerBase).BitrateBase) : Catch : End Try
ElseIf SelectedAudioIndex.ValueBetween(0, MediaObjects.Count - 1) Then
Return SelectedAudio.Bitrate
End If
Return 0
End Get
End Property
<XMLEC> Public Property DateCreated As Date = Now Implements IYouTubeMediaContainer.DateCreated
<XMLEC> Public Property DateAdded As Date Implements IYouTubeMediaContainer.DateAdded
Private Property IUserMedia_PostDate As Date? Implements IUserMedia.PostDate
Expand Down Expand Up @@ -975,7 +999,7 @@ Namespace API.YouTube.Objects
.Visible = True
.Value = 0
.Maximum = DownloadGetElemCountSingle()
.Information = $"Download {ObjectType}"
.Information = "Downloading"
End With
End If

Expand Down Expand Up @@ -1120,7 +1144,7 @@ Namespace API.YouTube.Objects
.Value = 0
.Maximum = 100
.Provider = ProgressProvider
.Information = $"Download {MediaType}"
.Information = "Downloading"
End With
End If
.MainProcessName = MyYouTubeSettings.YTDLP.Name '"yt-dlp"
Expand Down Expand Up @@ -1305,6 +1329,7 @@ Namespace API.YouTube.Objects
If format = mp3 And Not mp3ThumbEmbedded And MyYouTubeSettings.DefaultAudioEmbedThumbnail_ExtractedFiles Then _
embedThumbTo.Invoke(f) : mp3ThumbEmbedded = True
If Not M3U8_PlaylistFiles.ListExists AndAlso f.Exists Then M3U8_Append(f)
If format = mp3 AndAlso f.Exists AndAlso MyYouTubeSettings.VideoPlaylist_AddExtractedMP3.Value Then M3U8_Append(f)
End If
Next
End If
Expand Down
4 changes: 2 additions & 2 deletions SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("2024.6.6.0")>
<Assembly: AssemblyFileVersion("2024.6.6.0")>
<Assembly: AssemblyVersion("2024.6.10.0")>
<Assembly: AssemblyFileVersion("2024.6.10.0")>
<Assembly: NeutralResourcesLanguage("en")>
9 changes: 5 additions & 4 deletions SCrawler/API/Instagram/SiteSettings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,11 @@ Namespace API.Instagram
Friend Overrides Sub EndInit()
Try : MyLastRequests.Add(LastDownloadDate.Value, LastRequestsCount.Value) : Catch : End Try
If Not CBool(HH_IG_WWW_CLAIM_USE.Value) Then Responser.Headers.Remove(Header_IG_WWW_CLAIM)
If CInt(SettingsVersion.Value) < 1 Then
SettingsVersion.Value = 1
HH_IG_WWW_CLAIM_UPDATE_INTERVAL.Value = 59
HH_IG_WWW_CLAIM_USE_DEFAULT_ALGO.Value = 0
If CInt(SettingsVersion.Value) < 2 Then
SettingsVersion.Value = 2
HH_IG_WWW_CLAIM_UPDATE_INTERVAL.Value = 120
HH_IG_WWW_CLAIM_USE_DEFAULT_ALGO.Value = 1
HH_IG_WWW_CLAIM_RESET_EACH_TARGET.Value = 0
End If
MyBase.EndInit()
End Sub
Expand Down
2 changes: 1 addition & 1 deletion SCrawler/API/OnlyFans/SiteSettings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Namespace API.OnlyFans
Friend Overrides Sub Update()
If _SiteEditorFormOpened Then
If Not __UseOldAuthRules = CBool(UseOldAuthRules.Value) Or Not AEquals(Of String)(__DynamicRules, DynamicRules.Value) Then _
LastDateUpdated = LastDateUpdated.AddYears(-1)
LastDateUpdated = Now.AddYears(-1)
Responser.Cookies.Changed = False
End If
MyBase.Update()
Expand Down
2 changes: 1 addition & 1 deletion SCrawler/API/OnlyFans/UserData.vb
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ Namespace API.OnlyFans
Dim checkFormat As Func(Of EContainer, Boolean) =
Function(jj) Not jj.Value("format").IsEmptyString OrElse
(Not jj.Value("prefix").IsEmptyString And Not jj.Value("suffix").IsEmptyString) OrElse
(Not jj.Value("start").IsEmptyString And Not jj.Value("start").IsEmptyString)
(Not jj.Value("start").IsEmptyString And Not jj.Value("end").IsEmptyString)
If Not r.IsEmptyString Then
Using j As EContainer = JsonDocument.Parse(r, EDP.ReturnValue)
If j.ListExists Then
Expand Down
Loading

0 comments on commit aef4ce1

Please sign in to comment.