Skip to content

Commit 0b0933b

Browse files
committed
2024.7.24.0
YT YouTubeSettings: add 'DefaultVideoConvertNonAVC' property; fix 'OpenFolderInOtherProgram' property serialize and reset; add 'MusicPlaylistCreate_CreationMode' property Update the 'CleanFileName' function to remove line breaks Add the ability to convert non-avc codecs to avc Add 'M3U8CreationMode' enum SCrawler API.OnlyFans: fix incorrect delimiter (rules parsing) API.Threads: add saved posts downloading Feed: add the hotkeys 'Esc' and 'Ctrl+W' to close the form; add the ability to search for missing files in special feeds Scheduler: add the ability to execute a script after the scheduler plan is executed Settings: add enable/disable the use of the 'Esc' to close the feed; add 'AutomationScript' and 'AutomationScript_ExcludeManual' properties MainFrame: add the hotkey 'Ctrl+F' to show the feed; change the hotkey from 'Ctrl+F' to 'Alt+F' to show the search form
1 parent 3ce9c55 commit 0b0933b

25 files changed

+721
-338
lines changed

Changelog.md

+23
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
# 2024.7.24.0
2+
3+
*2024-07-24*
4+
5+
- Added
6+
- YouTube (standalone app)
7+
- ability to convert non-`AVC` codecs (eg `VP9`) to `AVC` (`Settings` - `Defaults Video` - `Convert non-AVC codecs to AVC`)
8+
- add the ability to set the playlist creation mode: absolute links, relative links, or both (`Settings` - `Music` - `Create M3U8: creation mode`)
9+
- Threads: **saved posts downloading**
10+
- Feed
11+
- hotkeys `Esc` and `Ctrl+W` to close the form
12+
- the ability to search for missing files in *special feeds*
13+
- Scheduler: the ability to execute a script after the scheduler plan is executed *(`Settings` - `Behavior`)*
14+
- Main window:
15+
- added hotkey `Ctrl+F` to show the feed
16+
- changed the hotkey from `Ctrl+F` to `Alt+F` to show the search form
17+
- Updated
18+
- yt-dlp up to version **2024.07.16**
19+
- Fixed
20+
- YouTube (standalone app): video files with line breaks in the name do not download correctly
21+
- OnlyFans: rules parsing bug
22+
- Minor bugs
23+
124
# 2024.6.25.0
225

326
*2024-06-25*
2.21 KB
Loading
2.29 KB
Loading

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ A program to download photo and video from [any site](#supported-sites) (e.g. Yo
3333
![YouTube application](ProgramScreenshots/AppYouTube.png)
3434

3535
# What can program do:
36-
- Download pictures and videos from users' profiles and subreddits:
36+
- Download pictures and videos from user profiles:
3737
- YouTube videos, shorts, community feeds, users, artists, playlists, music, tracks;
3838
- Reddit images, galleries of images, videos, saved posts;
39-
- Redgifs videos (https://www.redgifs.com/);
39+
- Redgifs images and videos (https://www.redgifs.com/);
4040
- Twitter images and videos, saved (bookmarked) posts, likes, communities;
4141
- OnlyFans images and videos, saved (bookmarked) posts, stories;
4242
- JustForFans images and videos, saved (bookmarked) posts;
4343
- Mastodon images and videos, saved (bookmarked) posts;
4444
- Instagram images and videos, tagged posts, stories, saved posts;
45-
- Threads images and videos;
45+
- Threads images and videos, saved posts;
4646
- Facebook images and videos, stories, saved posts;
4747
- TikTok videos;
4848
- Pinterest boards, users, saved posts;
@@ -57,7 +57,7 @@ A program to download photo and video from [any site](#supported-sites) (e.g. Yo
5757
- Download [saved posts](https://github.com/AAndyProgram/SCrawler/wiki/Home#saved-posts)
5858
- Add users from parsed channel
5959
- **Advanced user management**
60-
- **Automation** ([downloading data automatically](https://github.com/AAndyProgram/SCrawler/wiki/Settings#automation) every ```X``` minutes)
60+
- **Automation** ([downloading data automatically](https://github.com/AAndyProgram/SCrawler/wiki/Settings#automation) every `X` minutes)
6161
- **Feed** ([feed](https://github.com/AAndyProgram/SCrawler/wiki#feed) of downloaded media files and subscriptions posts)
6262
- Multiple accounts support
6363
- Labeling users
@@ -87,7 +87,7 @@ A program to download photo and video from [any site](#supported-sites) (e.g. Yo
8787
- TikTok
8888
- RedGifs
8989
- Pinterest
90-
- Imgur
90+
- Imgur *(out of support)*
9191
- Gfycat
9292
- LPSG
9393
- **PornHub**
@@ -109,7 +109,7 @@ First, the program downloads the full profile. After the program downloads only
109109

110110
# Requirements
111111

112-
- Windows 10, 11 with NET Framework 4.6.1 or higher (v4.6.1 must be installed). You can check version compatibility with this [tool](Tools/NET.FrameworkVersion.ps1).
112+
- **Windows 10, 11** with NET Framework 4.6.1 or higher (v4.6.1 must be installed). You can check version compatibility with this [tool](Tools/NET.FrameworkVersion.ps1).
113113
- **[SITES REQUIREMENTS](https://github.com/AAndyProgram/SCrawler/wiki/Settings#sites-requirements)**
114114

115115
# Guide
@@ -157,7 +157,7 @@ First, the program downloads the full profile. After the program downloads only
157157

158158
**Just download the [latest release](https://github.com/AAndyProgram/SCrawler/releases/latest), unzip the program archive to any folder and enjoy.** :blush:
159159

160-
**Don't put program in the ```Program Files``` system folder (this is portable program and program settings are stored in the program folder)**
160+
**Don't put program in the `Program Files` system folder (this is portable program and program settings are stored in the program folder)**
161161

162162
**I highly doubt you can run SCrawler on Linux or Mac. SCrawler is a program that is heavily dependent on Windows.**
163163

@@ -183,7 +183,7 @@ The program has an intuitive interface.
183183

184184
[![How to configure](https://img.youtube.com/vi/XDn7zG4I700/0.jpg)](https://www.youtube.com/watch?v=XDn7zG4I700)
185185

186-
Just add a user profile and **click the ```Download``` button**.
186+
Just add a user profile and **click the `Download` button**.
187187

188188
```mermaid
189189
stateDiagram

SCrawler.YouTube/Base/Structures.vb

+5
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ Namespace API.YouTube.Base
8484
Before = 1
8585
After = 2
8686
End Enum
87+
Public Enum M3U8CreationMode As Integer
88+
Relative = 0
89+
Absolute = 1
90+
Both = 2
91+
End Enum
8792
Public Structure MediaObject : Implements IIndexable, IComparable(Of MediaObject)
8893
Public Type As Plugin.UserMediaTypes
8994
Public ID As String

SCrawler.YouTube/Base/YouTubeSettings.vb

+16-4
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,28 @@ Namespace API.YouTube.Base
131131
<Browsable(True), GridVisible(False), Category("EnvironmentFolder"), DisplayName("Open folders in another program"), DefaultValue(False)>
132132
Private Property IDownloaderSettings_OpenFolderInOtherProgram As Boolean Implements IDownloaderSettings.OpenFolderInOtherProgram
133133
Get
134-
Return OpenFolderInOtherProgram.Use
134+
Return OpenFolderInOtherProgram.Attribute.ValueTemp
135135
End Get
136136
Set(ByVal use As Boolean)
137-
OpenFolderInOtherProgram.Use = use
137+
OpenFolderInOtherProgram.Attribute.ValueTemp = use
138138
End Set
139139
End Property
140+
Private Function ShouldSerializeIDownloaderSettings_OpenFolderInOtherProgram() As Boolean
141+
Return DirectCast(OpenFolderInOtherProgram.Attribute, IGridValue).ShouldSerializeValue
142+
End Function
140143
<Browsable(True), GridVisible(False), Category("EnvironmentFolder"), DisplayName("Open folders in another program (command)"),
141144
Description("The command to open a folder."), DefaultValue("")>
142145
Private Property IDownloaderSettings_OpenFolderInOtherProgram_Command As String Implements IDownloaderSettings.OpenFolderInOtherProgram_Command
143146
Get
144-
Return OpenFolderInOtherProgram
147+
Return OpenFolderInOtherProgram.ValueTemp
145148
End Get
146149
Set(ByVal command As String)
147-
OpenFolderInOtherProgram.Value = command
150+
OpenFolderInOtherProgram.ValueTemp = command
148151
End Set
149152
End Property
153+
Private Function ShouldSerializeIDownloaderSettings_OpenFolderInOtherProgram_Command() As Boolean
154+
Return DirectCast(OpenFolderInOtherProgram, IGridValue).ShouldSerializeValue
155+
End Function
150156
<Browsable(True), GridVisible(False), XMLVN({"Environment"}, True), Category("Environment"), DisplayName("Check new version at start")>
151157
Friend ReadOnly Property CheckUpdatesAtStart As XMLValue(Of Boolean)
152158
#End Region
@@ -305,6 +311,9 @@ Namespace API.YouTube.Base
305311
<Browsable(True), GridVisible, XMLVN({"DefaultsVideo"}, 1080), Category("Defaults Video"), DisplayName("Default definition"),
306312
Description("The default maximum video resolution. -1 for max definition")>
307313
Public ReadOnly Property DefaultVideoDefinition As XMLValue(Of Integer)
314+
<Browsable(True), GridVisible, XMLVN({"DefaultsVideo"}), Category("Defaults Video"), DisplayName("Convert non-AVC codecs to AVC"),
315+
Description("Convert non-AVC codecs (eg 'VP9') to AVC. Not recommended due to high CPU usage!")>
316+
Public ReadOnly Property DefaultVideoConvertNonAVC As XMLValue(Of Boolean)
308317
<Browsable(True), GridVisible, XMLVN({"DefaultsVideo"}, False), Category("Defaults Video"), DisplayName("Embed thumbnail (video)"),
309318
Description("Embed thumbnail in the video as cover art. Default: true.")>
310319
Public ReadOnly Property DefaultVideoEmbedThumbnail As XMLValue(Of Boolean)
@@ -432,6 +441,9 @@ Namespace API.YouTube.Base
432441
<Browsable(True), GridVisible, XMLVN({"Playlists"}), Category("Music"), DisplayName("M3U8 Append file number"),
433442
Description("Add file number to file name. Default: false.")>
434443
Public ReadOnly Property MusicPlaylistCreate_M3U8_AppendNumber As XMLValue(Of Boolean)
444+
<Browsable(True), GridVisible, XMLVN({"Playlists"}, M3U8CreationMode.Relative), Category("Music"), DisplayName("Create M3U8: creation mode"),
445+
Description("Set the playlist creation mode: absolute links, relative links, or both. If 'Both' is selected, two playlists will be created. Default: 'Relative'.")>
446+
Public ReadOnly Property MusicPlaylistCreate_CreationMode As XMLValue(Of M3U8CreationMode)
435447
#End Region
436448
#End Region
437449
#Region "Defaults Subtitles"

SCrawler.YouTube/Declarations.vb

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Namespace API.YouTube
6666
If Not f.IsEmptyString And Not f.Name.IsEmptyString Then
6767
Dim ff As SFile = f
6868
ff.Name = ff.Name.StringRemoveWinForbiddenSymbols.StringTrim
69+
ff.Name = ff.Name.StringReplaceSymbols({vbLf, vbCr, vbCrLf}, String.Empty, EDP.ReturnValue)
6970
ff.Name = ff.Name.StringTrimEnd(".")
7071
If Not ff.Name.IsEmptyString And Not MyYouTubeSettings.FileRemoveCharacters.IsEmptyString Then _
7172
ff.Name = ff.Name.StringReplaceSymbols(MyYouTubeSettings.FileRemoveCharacters.Value.AsList.ListCast(Of String).ToArray, String.Empty, EDP.ReturnValue)

SCrawler.YouTube/My Project/AssemblyInfo.vb

+2-2
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("2024.6.25.0")>
36-
<Assembly: AssemblyFileVersion("2024.6.25.0")>
35+
<Assembly: AssemblyVersion("2024.7.24.0")>
36+
<Assembly: AssemblyFileVersion("2024.7.24.0")>
3737
<Assembly: NeutralResourcesLanguage("en")>

SCrawler.YouTube/Objects/YouTubeMediaContainerBase.vb

+63-31
Original file line numberDiff line numberDiff line change
@@ -899,21 +899,21 @@ Namespace API.YouTube.Objects
899899
Return Nothing
900900
End Try
901901
End Function
902-
Private Function GetPlaylistRow(ByVal Element As YouTubeMediaContainerBase, Optional ByVal __file As SFile = Nothing) As String
902+
Private Function GetPlaylistRow(ByVal Element As YouTubeMediaContainerBase, Optional ByVal __file As SFile = Nothing,
903+
Optional ByVal Mode As M3U8CreationMode = M3U8CreationMode.Absolute) As String
903904
Const m3u8DataRow$ = "#EXTINF:{0},{1}" & vbCrLf & "{2}"
904905
With Element
905906
Dim f As SFile = __file.IfNullOrEmpty(.File)
907+
Dim __f$ = SymbolsConverter.ASCII.EncodeSymbolsOnly(If(Mode = M3U8CreationMode.Absolute, f.ToString, f.File))
908+
If Mode = M3U8CreationMode.Absolute Then __f = $"file:///{__f}"
906909
Dim fName$ = .Title.IfNullOrEmpty(f.Name)
907910
If MyYouTubeSettings.MusicPlaylistCreate_M3U8_AppendNumber And .PlaylistIndex > 0 Then fName = $"{ .PlaylistIndex}. {fName}"
908911
If Not .UserTitle.IsEmptyString Then
909912
fName = $"{ .UserTitle} - {fName}"
910913
If MyYouTubeSettings.MusicPlaylistCreate_M3U8_AppendArtist Then fName = $"{ .UserTitle} - {fName}"
911914
End If
912915
If MyYouTubeSettings.MusicPlaylistCreate_M3U8_AppendExt Then fName &= $".{f.Extension}"
913-
Return String.Format(m3u8DataRow,
914-
CInt(.Duration.TotalSeconds),
915-
fName,
916-
$"file:///{SymbolsConverter.ASCII.EncodeSymbolsOnly(f)}")
916+
Return String.Format(m3u8DataRow, CInt(.Duration.TotalSeconds), fName, __f)
917917
End With
918918
End Function
919919
Private ReadOnly DownloadProgressPattern As RParams = RParams.DMS("\[download\]\s*([\d\.,]+)", 1, EDP.ReturnValue)
@@ -954,23 +954,41 @@ Namespace API.YouTube.Objects
954954
Dim t As TextSaver = Nothing
955955
Try
956956
Dim f As SFile
957-
If MyYouTubeSettings.MusicPlaylistCreate_M3U8 Then
958-
t = New TextSaver
959-
t.AppendLine("#EXTM3U")
960-
Elements.ForEach(Sub(e) t.AppendLine(GetPlaylistRow(e)))
961-
f = $"{Elements(0).File.PathWithSeparator}Playlist.m3u8"
962-
t.SaveAs(f, EDP.SendToLog)
963-
If f.Exists Then AddFile(f)
964-
t.Dispose()
965-
End If
966-
If MyYouTubeSettings.MusicPlaylistCreate_M3U Then
967-
t = New TextSaver
968-
Elements.ForEach(Sub(e) t.AppendLine(e.File))
969-
f = $"{Elements(0).File.PathWithSeparator}Playlist.m3u"
970-
t.SaveAs(f, EDP.SendToLog)
971-
If f.Exists Then AddFile(f)
972-
t.Dispose()
973-
End If
957+
Dim arr As M3U8CreationMode() = If(MyYouTubeSettings.MusicPlaylistCreate_CreationMode.Value = M3U8CreationMode.Both,
958+
{M3U8CreationMode.Relative, M3U8CreationMode.Absolute},
959+
{MyYouTubeSettings.MusicPlaylistCreate_CreationMode.Value})
960+
Dim postfix$
961+
Dim added As Boolean
962+
Dim checkFile As Func(Of IYouTubeMediaContainer, Boolean) = Function(ByVal e As IYouTubeMediaContainer) As Boolean
963+
If e.File.Exists Then
964+
added = True
965+
Return True
966+
Else
967+
Return False
968+
End If
969+
End Function
970+
For Each cm As M3U8CreationMode In arr
971+
If arr.Length > 1 AndAlso cm = M3U8CreationMode.Absolute Then postfix = "Abs" Else postfix = String.Empty
972+
added = False
973+
If MyYouTubeSettings.MusicPlaylistCreate_M3U8 Then
974+
t = New TextSaver
975+
t.AppendLine("#EXTM3U")
976+
Elements.ForEach(Sub(e) If checkFile(e) Then t.AppendLine(GetPlaylistRow(e,, cm)))
977+
f = $"{Elements(0).File.PathWithSeparator}Playlist{postfix}.m3u8"
978+
If added Then t.SaveAs(f, EDP.SendToLog)
979+
If f.Exists Then AddFile(f)
980+
t.Dispose()
981+
End If
982+
added = False
983+
If MyYouTubeSettings.MusicPlaylistCreate_M3U Then
984+
t = New TextSaver
985+
Elements.ForEach(Sub(e) If checkFile(e) Then t.AppendLine(If(cm = M3U8CreationMode.Relative, e.File.File, e.File.ToString)))
986+
f = $"{Elements(0).File.PathWithSeparator}Playlist{postfix}.m3u"
987+
If added Then t.SaveAs(f, EDP.SendToLog)
988+
If f.Exists Then AddFile(f)
989+
t.Dispose()
990+
End If
991+
Next
974992
Catch ex As Exception
975993
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[YouTubeMediaContainerBase.Download.CreatePlaylist]")
976994
End Try
@@ -1354,15 +1372,29 @@ Namespace API.YouTube.Objects
13541372
'Delete unrequsted files
13551373
If tempFilesList.Count > 0 Then tempFilesList.ForEach(Sub(tfr) If Not tfr.Requested Then tfr.File.Delete(,, EDP.None)) : tempFilesList.Clear()
13561374

1357-
'Update video FPS
1358-
If SelectedVideoIndex >= 0 AndAlso OutputVideoFPS > 0 AndAlso SelectedVideo.Bitrate <> OutputVideoFPS Then
1359-
f = File
1360-
f.Name &= "tmp00"
1361-
.Execute($"ffmpeg -i ""{File}"" -filter:v fps={OutputVideoFPS.ToString.Replace(",", ".")} -c:a copy ""{f}""")
1362-
If f.Exists Then
1363-
File.Delete()
1364-
SFile.Rename(f, File,, EDP.LogMessageValue)
1365-
End If
1375+
If SelectedVideoIndex >= 0 Then
1376+
Dim reencodeFile As Action(Of String) =
1377+
Sub(ByVal ffmpegCommand As String)
1378+
f = File
1379+
f.Name &= "tmp00"
1380+
.Execute(String.Format(ffmpegCommand, File.ToString, f.ToString))
1381+
If f.Exists Then
1382+
If f.Size > 0 Then
1383+
File.Delete()
1384+
SFile.Rename(f, File,, EDP.LogMessageValue)
1385+
Else
1386+
f.Delete(, SFODelete.DeletePermanently, EDP.None)
1387+
End If
1388+
End If
1389+
End Sub
1390+
'Change video codec to AVC
1391+
If MyYouTubeSettings.DefaultVideoConvertNonAVC.Value AndAlso
1392+
Not SelectedVideo.Codec.IsEmptyString AndAlso Not SelectedVideo.Codec.Trim.ToLower.StartsWith("avc") Then _
1393+
reencodeFile("ffmpeg -i ""{0}"" -c:a copy -c:v libx264 ""{1}""")
1394+
1395+
'Update video FPS
1396+
If OutputVideoFPS > 0 AndAlso SelectedVideo.Bitrate <> OutputVideoFPS Then _
1397+
reencodeFile("ffmpeg -i ""{0}"" -filter:v fps=" & OutputVideoFPS.ToString.Replace(", ", ".") & " -c:a copy ""{1}""")
13661398
End If
13671399
End If
13681400
End If

SCrawler.YouTubeDownloader/My Project/AssemblyInfo.vb

+2-2
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("2024.6.25.0")>
36-
<Assembly: AssemblyFileVersion("2024.6.25.0")>
35+
<Assembly: AssemblyVersion("2024.7.24.0")>
36+
<Assembly: AssemblyFileVersion("2024.7.24.0")>
3737
<Assembly: NeutralResourcesLanguage("en")>

SCrawler/API/Instagram/SiteSettings.vb

+3-2
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,12 @@ Namespace API.Instagram
443443
UserRegex = RParams.DMS(String.Format(UserRegexDefaultPattern, "instagram.com/"), 1)
444444
ImageVideoContains = "instagram.com"
445445
End Sub
446+
Private Const SettingsVersionCurrent As Integer = 2
446447
Friend Overrides Sub EndInit()
447448
Try : MyLastRequests.Add(LastDownloadDate.Value, LastRequestsCount.Value) : Catch : End Try
448449
If Not CBool(HH_IG_WWW_CLAIM_USE.Value) Then Responser.Headers.Remove(Header_IG_WWW_CLAIM)
449-
If CInt(SettingsVersion.Value) < 2 Then
450-
SettingsVersion.Value = 2
450+
If CInt(SettingsVersion.Value) < SettingsVersionCurrent Then
451+
SettingsVersion.Value = SettingsVersionCurrent
451452
HH_IG_WWW_CLAIM_UPDATE_INTERVAL.Value = 120
452453
HH_IG_WWW_CLAIM_ALWAYS_ZERO.Value = False
453454
HH_IG_WWW_CLAIM_RESET_EACH_SESSION.Value = True

0 commit comments

Comments
 (0)