Compare commits

...

6 Commits

Author SHA1 Message Date
Andy
93ea2a55ac 2024.6.6.0
YT
VideoOptionsForm: file path is cleared when the cancel button is clicked (browse button); remove the context menu when the right clicking on browse button; add 'ButtonRC' class

SCrawler
API.OnlyFans: add check config to the SiteSettings; update config; add 'Keydb_Api' property; reset 'LastDateUpdated' when rules change; add support 'prefix/suffix' and 'start/end' to support other rules formats
DownloadFeedForm: update 'BTT_CURR_SESSION_SET_Click' function
TDownloader: update 'FilesLoadLastSession' function
2024-06-06 05:49:50 +03:00
Andy
2ae8c3acfc 2024.6.4.0
API.Twitter: add communities downloading, change post opening URL
Feed: add the ability to select one of the download sessions and set it as the current session
2024-06-04 03:28:05 +03:00
Andy
53dcb3e2c6 2024.6.2.0
YT
Add 'FileAddDateToFileName', 'FileAddDateToFileName_VideoForm' and 'FileAddDateToFileName_VideoList' properties
Update 'YouTubeMediaContainerBase', 'VideoOptionsForm' and 'MediaItem' (new options)

SCrawler
API.Instagram: update settings values
API.Reddit: fix 'ReparseMissing' function (remove bearer token)
2024-06-02 01:19:41 +03:00
Andy
ca384e54d6 2024.5.29.0
YT
Trim urls to get rid of 'cr' & 'lf'
Get the correct 'music' url for 'url' files

SCrawler
Remove the no longer needed 'MainFrameObj.UpdateLogButton' from the classes
ProfileSaved: swap the 'ReadyToDownload' and 'Available' checks; remove the 'DownloadStarted' and 'DownloadDone' calls because they are called in the root function
API.Instagram: improve availability checking
API.Twitter: fix deleting user directory when redownloading missing posts
AutoDownloader: improve statuses; move the check thread to the scheduler; add highlighting of scheduler plans (working, stopped, pending, etc.); replace 'ListBox' with 'ListView'; highlight undownloaded plans in gray
2024-05-29 02:45:37 +03:00
Andy
5a1b5c828a 2024.5.25.0
Move files to another directory
2024-05-25 10:06:50 +03:00
Andy
22c59b41f0 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
2024-05-19 22:29:16 +03:00
59 changed files with 880 additions and 314 deletions

View File

@@ -1,3 +1,47 @@
# 2024.6.6.0
*2024-06-06*
**ATTENTION!**
1. **To support downloading of DRM protected videos (OnlyFans), please update OF-Scraper to version [3.10](https://github.com/datawhores/OF-Scraper/releases/tag/3.10) (download `zip`, not `exe`).**
2. **If there is a `OFScraperConfigPattern.json` file in the SCrawler settings folder, replace the text of the file with [this text](https://github.com/AAndyProgram/SCrawler/blob/main/SCrawler/API/OnlyFans/OFScraperConfigPattern.json).**
3. **Set the value to `Dynamic rules` (in the site settings) = `https://raw.githubusercontent.com/Growik/onlyfans-dynamic-rules/main/rules.json`.**
- Added
- OnlyFans: new OF-Scraper option (`keydb_api`)
- Minor improvements
- Fixed
- OnlyFans: **data is not downloading**
- Minor bugs
# 2024.6.4.0
*2024-06-04*
**If you were using the [`yt-dlp-TTUser`](https://github.com/bashonly/yt-dlp-TTUser) plugin, you should remove it because this plugin was added to yt-dlp itself! Read more [here](https://github.com/AAndyProgram/SCrawler/wiki/Settings#tiktok-requirements).**
- Added
- Added highlighting of scheduler plans (working, stopped, pending, etc.)
- YouTube (standalone app): add option to add the video upload date before/after the file name (`Settings` - `Defaults` - `Add date to file name`)
- Twitter: **`Communities` downloading**
- Feed: ability to select one of the download sessions and set it as the current session
- Minor improvements
- Updated
- yt-dlp up to version **2024.05.27**
- gallery-dl up to version **1.27.0**
- Fixed
- Twitter: deleting user directory when redownloading missing posts
- Minor bugs
# 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.5.18.0
*2024-05-18* *2024-05-18*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -1,5 +1,5 @@
<!-- # :rainbow_flag: Happy LGBT Pride Month :tada: # 🏳️‍🌈 Happy LGBT Pride Month 🎉
-->
# 🏳️‍🌈 Social networks crawler 🏳️‍🌈 # 🏳️‍🌈 Social networks crawler 🏳️‍🌈
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/AAndyProgram/SCrawler)](https://github.com/AAndyProgram/SCrawler/releases/latest) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/AAndyProgram/SCrawler)](https://github.com/AAndyProgram/SCrawler/releases/latest)
@@ -37,8 +37,8 @@ A program to download photo and video from [any site](#supported-sites) (e.g. Yo
- YouTube videos, shorts, community feeds, users, artists, playlists, music, tracks; - YouTube videos, shorts, community feeds, users, artists, playlists, music, tracks;
- Reddit images, galleries of images, videos, saved posts; - Reddit images, galleries of images, videos, saved posts;
- Redgifs videos (https://www.redgifs.com/); - Redgifs videos (https://www.redgifs.com/);
- Twitter images and videos, saved (bookmarked) posts; - Twitter images and videos, saved (bookmarked) posts, likes, communities;
- OnlyFans images and videos, saved (bookmarked) posts; - OnlyFans images and videos, saved (bookmarked) posts, stories;
- JustForFans images and videos, saved (bookmarked) posts; - JustForFans images and videos, saved (bookmarked) posts;
- Mastodon images and videos, saved (bookmarked) posts; - Mastodon images and videos, saved (bookmarked) posts;
- Instagram images and videos, tagged posts, stories, saved posts; - Instagram images and videos, tagged posts, stories, saved posts;
@@ -79,11 +79,11 @@ A program to download photo and video from [any site](#supported-sites) (e.g. Yo
- **Reddit** - **Reddit**
- **Twitter** - **Twitter**
- **OnlyFans** *(partial support)*[^1] - **OnlyFans** *(partial support)*[^1]
- **Mastodon**
- **Instagram** - **Instagram**
- **Threads** - **Threads**
- **Facebook** - **Facebook**
- JustForFans *(partial support)*[^1] - JustForFans *(partial support)*[^1]
- Mastodon *(out of support)*
- TikTok - TikTok
- RedGifs - RedGifs
- Pinterest - Pinterest

View File

@@ -78,6 +78,12 @@ Namespace API.YouTube.Base
https = 1 https = 1
m3u8 = 2 m3u8 = 2
End Enum End Enum
<Editor(GetType(EnumDropDownEditor), GetType(UITypeEditor))>
Public Enum FileDateMode As Integer
None = 0
Before = 1
After = 2
End Enum
Public Structure MediaObject : Implements IIndexable, IComparable(Of MediaObject) Public Structure MediaObject : Implements IIndexable, IComparable(Of MediaObject)
Public Type As Plugin.UserMediaTypes Public Type As Plugin.UserMediaTypes
Public ID As String Public ID As String

View File

@@ -22,6 +22,7 @@ Namespace API.YouTube.Base
End Sub End Sub
Public Shared Function StandardizeURL(ByVal URL As String) As String Public Shared Function StandardizeURL(ByVal URL As String) As String
Try Try
URL = URL.StringTrim
Dim isMusic As Boolean = False, isShorts As Boolean = False Dim isMusic As Boolean = False, isShorts As Boolean = False
If Info_GetUrlType(URL, isMusic, isShorts) = YouTubeMediaType.Single Then If Info_GetUrlType(URL, isMusic, isShorts) = YouTubeMediaType.Single Then
If Not isMusic And Not isShorts Then If Not isMusic And Not isShorts Then
@@ -45,6 +46,7 @@ Namespace API.YouTube.Base
End Function End Function
Public Shared Function StandardizeURL_Channel(ByVal URL As String, Optional ByVal Process As Boolean = True) As String Public Shared Function StandardizeURL_Channel(ByVal URL As String, Optional ByVal Process As Boolean = True) As String
Try Try
URL = URL.StringTrim
Dim ct As YouTubeChannelTab = YouTubeChannelTab.All Dim ct As YouTubeChannelTab = YouTubeChannelTab.All
Dim isMusic As Boolean = False Dim isMusic As Boolean = False
If Process AndAlso Info_GetUrlType(URL, isMusic,,,, ct) = YouTubeMediaType.Channel AndAlso Not isMusic Then If Process AndAlso Info_GetUrlType(URL, isMusic,,,, ct) = YouTubeMediaType.Channel AndAlso Not isMusic Then
@@ -72,6 +74,7 @@ Namespace API.YouTube.Base
Public Shared Function Info_GetUrlType(ByVal URL As String, Optional ByRef IsMusic As Boolean = False, Optional ByRef IsShorts As Boolean = False, Public Shared Function Info_GetUrlType(ByVal URL As String, Optional ByRef IsMusic As Boolean = False, Optional ByRef IsShorts As Boolean = False,
Optional ByRef IsChannelUser As Boolean = False, Optional ByRef Id As String = Nothing, Optional ByRef IsChannelUser As Boolean = False, Optional ByRef Id As String = Nothing,
Optional ByRef ChannelOptions As YouTubeChannelTab = YouTubeChannelTab.All) As YouTubeMediaType Optional ByRef ChannelOptions As YouTubeChannelTab = YouTubeChannelTab.All) As YouTubeMediaType
URL = URL.StringTrim
If Not URL.IsEmptyString Then If Not URL.IsEmptyString Then
IsMusic = URL.Contains("music.youtube.com") IsMusic = URL.Contains("music.youtube.com")
IsChannelUser = False IsChannelUser = False
@@ -118,6 +121,7 @@ Namespace API.YouTube.Base
Optional ByVal Token As Threading.CancellationToken = Nothing, Optional ByVal Progress As IMyProgress = Nothing, Optional ByVal Token As Threading.CancellationToken = Nothing, Optional ByVal Progress As IMyProgress = Nothing,
Optional ByVal DateAfter As Date? = Nothing, Optional ByVal DateBefore As Date? = Nothing, Optional ByVal DateAfter As Date? = Nothing, Optional ByVal DateBefore As Date? = Nothing,
Optional ByVal ChannelOption As YouTubeChannelTab? = Nothing, Optional ByVal UrlAsIs As Boolean = False) As IYouTubeMediaContainer Optional ByVal ChannelOption As YouTubeChannelTab? = Nothing, Optional ByVal UrlAsIs As Boolean = False) As IYouTubeMediaContainer
URL = URL.StringTrim
If URL.IsEmptyString Then Throw New ArgumentNullException("URL", "URL cannot be null") If URL.IsEmptyString Then Throw New ArgumentNullException("URL", "URL cannot be null")
If Not MyYouTubeSettings.YTDLP.Value.Exists Then Throw New IO.FileNotFoundException("Path to 'yt-dlp.exe' not set or program not found at destination", MyYouTubeSettings.YTDLP.Value.ToString) If Not MyYouTubeSettings.YTDLP.Value.Exists Then Throw New IO.FileNotFoundException("Path to 'yt-dlp.exe' not set or program not found at destination", MyYouTubeSettings.YTDLP.Value.ToString)
Dim urlOrig$ = URL Dim urlOrig$ = URL
@@ -162,7 +166,7 @@ Namespace API.YouTube.Base
If result Then If result Then
container.Parse(Nothing, _CachePathDefault, isMusic, Token, Progress) container.Parse(Nothing, _CachePathDefault, isMusic, Token, Progress)
If Not container.HasError Then container.URL = URL : container.IsShorts = isShorts : Return container If Not container.HasError Then container.URL = URL.ToMusicUrl(isMusic) : container.IsShorts = isShorts : Return container
End If End If
container.Dispose() container.Dispose()
End If End If

View File

@@ -162,6 +162,12 @@ Namespace API.YouTube.Base
<Browsable(True), GridVisible, XMLVN({"Info"}), Category("Info"), DisplayName("Create description files"), <Browsable(True), GridVisible, XMLVN({"Info"}), Category("Info"), DisplayName("Create description files"),
Description("Create video description files. Default: false.")> Description("Create video description files. Default: false.")>
Public ReadOnly Property CreateDescriptionFiles As XMLValue(Of Boolean) Public ReadOnly Property CreateDescriptionFiles As XMLValue(Of Boolean)
<Browsable(True), GridVisible, XMLVN({"Info"}, True), Category("Info"), DisplayName("Create description files: add upload date"),
Description("Add the upload date to the top of the description file. Default: true.")>
Public ReadOnly Property CreateDescriptionFiles_AddUploadDate As XMLValue(Of Boolean)
<Browsable(True), GridVisible, XMLVN({"Info"}, True), Category("Info"), DisplayName("Create description files: create without description"),
Description("Create a description file with the upload date, even if the description does not exist. Default: true.")>
Public ReadOnly Property CreateDescriptionFiles_CreateWithNoDescription As XMLValue(Of Boolean)
<Browsable(True), GridVisible, XMLVN({"Info"}, True), Category("Info"), DisplayName("Create thumbnail files (video)"), <Browsable(True), GridVisible, XMLVN({"Info"}, True), Category("Info"), DisplayName("Create thumbnail files (video)"),
Description("Create video thumbnail files. Default: true.")> Description("Create video thumbnail files. Default: true.")>
Public ReadOnly Property CreateThumbnails_Video As XMLValue(Of Boolean) Public ReadOnly Property CreateThumbnails_Video As XMLValue(Of Boolean)
@@ -243,9 +249,18 @@ Namespace API.YouTube.Base
<Browsable(True), GridVisible(False), XMLVN({"Defaults"}), Category("Defaults"), DisplayName("Program description"), <Browsable(True), GridVisible(False), XMLVN({"Defaults"}), Category("Defaults"), DisplayName("Program description"),
Description("Add some additional info to the program info if you need")> Description("Add some additional info to the program info if you need")>
Friend ReadOnly Property ProgramDescription As XMLValue(Of String) Friend ReadOnly Property ProgramDescription As XMLValue(Of String)
<Browsable(True), GridVisible(False), XMLVN({"Defaults"}, "%"""), Category("Defaults"), DisplayName("Remove characters"), <Browsable(True), GridVisible, XMLVN({"Defaults"}, "%"""), Category("Defaults"), DisplayName("Remove characters"),
Description("Remove specific characters from a file name")> Description("Remove specific characters from a file name")>
Friend ReadOnly Property FileRemoveCharacters As XMLValue(Of String) Public ReadOnly Property FileRemoveCharacters As XMLValue(Of String)
<Browsable(True), GridVisible, XMLVN({"Defaults"}, FileDateMode.None), Category("Defaults"), DisplayName("Add date to file name"),
Description("Add the video upload date before/after the file name")>
Public ReadOnly Property FileAddDateToFileName As XMLValue(Of FileDateMode)
<Browsable(True), GridVisible, XMLVN({"Defaults"}), Category("Defaults"), DisplayName("Add date to title: video form"),
Description("Add video upload date before video title (visual only) in the video form")>
Public ReadOnly Property FileAddDateToFileName_VideoForm As XMLValue(Of Boolean)
<Browsable(True), GridVisible, XMLVN({"Defaults"}), Category("Defaults"), DisplayName("Add date to title: video list"),
Description("Add video upload date before video title (visual only) in the video list")>
Public ReadOnly Property FileAddDateToFileName_VideoList As XMLValue(Of Boolean)
#End Region #End Region
#Region "Defaults ChannelsDownload" #Region "Defaults ChannelsDownload"
<Browsable(True), GridVisible, XMLVN({"Defaults", "Channels"}), Category("Defaults"), DisplayName("Default download tabs for channels"), <Browsable(True), GridVisible, XMLVN({"Defaults", "Channels"}), Category("Defaults"), DisplayName("Default download tabs for channels"),

View File

@@ -0,0 +1,23 @@
' Copyright (C) Andy https://github.com/AAndyProgram
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Namespace API.YouTube.Controls
Public Class ButtonRC : Inherits Button
Private Const WM_CONTEXTMENU As Integer = 123 '&H7B
Private Const WM_CANCELMODE As Integer = 31 '&H1F
Private Const WM_INITMENUPOPUP As Integer = 279 '&H117
Private Const SMTO_NOTIMEOUTIFNOTHUNG As Integer = 8
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_CONTEXTMENU Or m.Msg = WM_CANCELMODE Or m.Msg = WM_INITMENUPOPUP Or m.Msg = SMTO_NOTIMEOUTIFNOTHUNG Then
m.Result = IntPtr.Zero
Else
MyBase.WndProc(m)
End If
End Sub
End Class
End Namespace

View File

@@ -65,11 +65,11 @@ Namespace API.YouTube.Controls
Me.LBL_TIME = New System.Windows.Forms.Label() Me.LBL_TIME = New System.Windows.Forms.Label()
Me.LBL_URL = New System.Windows.Forms.LinkLabel() Me.LBL_URL = New System.Windows.Forms.LinkLabel()
Me.TXT_FILE = New PersonalUtilities.Forms.Controls.ComboBoxExtended() Me.TXT_FILE = New PersonalUtilities.Forms.Controls.ComboBoxExtended()
Me.BTT_BROWSE = New System.Windows.Forms.Button() Me.BTT_BROWSE = New SCrawler.API.YouTube.Controls.ButtonRC()
Me.BTT_DOWN = New System.Windows.Forms.Button() Me.BTT_DOWN = New System.Windows.Forms.Button()
Me.BTT_CANCEL = New System.Windows.Forms.Button() Me.BTT_CANCEL = New System.Windows.Forms.Button()
Me.CMB_PLS = New PersonalUtilities.Forms.Controls.ComboBoxExtended() Me.CMB_PLS = New PersonalUtilities.Forms.Controls.ComboBoxExtended()
Me.BTT_PLS_BROWSE = New System.Windows.Forms.Button() Me.BTT_PLS_BROWSE = New SCrawler.API.YouTube.Controls.ButtonRC()
Me.OPT_VIDEO = New System.Windows.Forms.RadioButton() Me.OPT_VIDEO = New System.Windows.Forms.RadioButton()
Me.OPT_AUDIO = New System.Windows.Forms.RadioButton() Me.OPT_AUDIO = New System.Windows.Forms.RadioButton()
Me.LBL_AUDIO_CODEC = New System.Windows.Forms.Label() Me.LBL_AUDIO_CODEC = New System.Windows.Forms.Label()
@@ -912,13 +912,13 @@ Namespace API.YouTube.Controls
Private WithEvents TXT_SUBS_ADDIT As PersonalUtilities.Forms.Controls.TextBoxExtended Private WithEvents TXT_SUBS_ADDIT As PersonalUtilities.Forms.Controls.TextBoxExtended
Private WithEvents TXT_EXTRA_AUDIO_FORMATS As PersonalUtilities.Forms.Controls.TextBoxExtended Private WithEvents TXT_EXTRA_AUDIO_FORMATS As PersonalUtilities.Forms.Controls.TextBoxExtended
Private WithEvents TXT_FILE As PersonalUtilities.Forms.Controls.ComboBoxExtended Private WithEvents TXT_FILE As PersonalUtilities.Forms.Controls.ComboBoxExtended
Private WithEvents BTT_BROWSE As Button Private WithEvents BTT_BROWSE As SCrawler.API.YouTube.Controls.ButtonRC
Private WithEvents BTT_DOWN As Button Private WithEvents BTT_DOWN As Button
Private WithEvents BTT_CANCEL As Button Private WithEvents BTT_CANCEL As Button
Private WithEvents TP_HEADER_INFO_2 As TableLayoutPanel Private WithEvents TP_HEADER_INFO_2 As TableLayoutPanel
Private WithEvents TXT_FPS As PersonalUtilities.Forms.Controls.TextBoxExtended Private WithEvents TXT_FPS As PersonalUtilities.Forms.Controls.TextBoxExtended
Private WithEvents CMB_PLS As PersonalUtilities.Forms.Controls.ComboBoxExtended Private WithEvents CMB_PLS As PersonalUtilities.Forms.Controls.ComboBoxExtended
Private WithEvents BTT_PLS_BROWSE As Button Private WithEvents BTT_PLS_BROWSE As SCrawler.API.YouTube.Controls.ButtonRC
Private WithEvents TXT_AUDIO_BITRATE As PersonalUtilities.Forms.Controls.TextBoxExtended Private WithEvents TXT_AUDIO_BITRATE As PersonalUtilities.Forms.Controls.TextBoxExtended
End Class End Class
End Namespace End Namespace

View File

@@ -121,7 +121,7 @@ Namespace API.YouTube.Controls
img = ImageRenderer.GetImage(SFile.GetBytesFromNet(imgUrl, EDP.ReturnValue), EDP.ReturnValue) img = ImageRenderer.GetImage(SFile.GetBytesFromNet(imgUrl, EDP.ReturnValue), EDP.ReturnValue)
If Not img Is Nothing Then ICON_VIDEO.Image = img : ICON_VIDEO.InitialImage = img If Not img Is Nothing Then ICON_VIDEO.Image = img : ICON_VIDEO.InitialImage = img
End If End If
LBL_TITLE.Text = .Title LBL_TITLE.Text = $"{If(MyYouTubeSettings.FileAddDateToFileName_VideoForm.Value, $"[{ .DateAdded:yyyy-MM-dd}] ", String.Empty)}{ .Title}"
LBL_TIME.Text = AConvert(Of String)(.Duration, TimeToStringProvider, String.Empty) LBL_TIME.Text = AConvert(Of String)(.Duration, TimeToStringProvider, String.Empty)
TP_HEADER_INFO_2.ColumnStyles(1).Width = MeasureTextDefault(LBL_TIME.Text, LBL_TIME.Font).Width + PaddingE.GetOf({LBL_TIME}).Horizontal TP_HEADER_INFO_2.ColumnStyles(1).Width = MeasureTextDefault(LBL_TIME.Text, LBL_TIME.Font).Width + PaddingE.GetOf({LBL_TIME}).Horizontal
TP_HEADER_INFO_2.Refresh() TP_HEADER_INFO_2.Refresh()
@@ -610,7 +610,7 @@ Namespace API.YouTube.Controls
$"Video|{AvailableVideoFormats.Select(Function(vf) $"*.{vf.ToLower}").ListToString(";")}" & $"Video|{AvailableVideoFormats.Select(Function(vf) $"*.{vf.ToLower}").ListToString(";")}" &
$"|Audio|{AvailableAudioFormats.Select(Function(af) $"*.{af.ToLower}").ListToString(";")}" $"|Audio|{AvailableAudioFormats.Select(Function(af) $"*.{af.ToLower}").ListToString(";")}"
f = SFile.SaveAs(f, "Select the destination of the video file",, ext, sPattern, EDP.ReturnValue) f = SFile.SaveAs(f, "Select the destination of the video file",, ext, sPattern, EDP.ReturnValue)
f.Extension = ext If Not f.IsEmptyString Then f.Extension = ext
End If End If
#Enable Warning #Enable Warning
f = CleanFileName(f) f = CleanFileName(f)

View File

@@ -6,6 +6,7 @@
' '
' This program is distributed in the hope that it will be useful, ' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY ' but WITHOUT ANY WARRANTY
Imports System.Runtime.CompilerServices
Imports PersonalUtilities.Tools Imports PersonalUtilities.Tools
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars
Imports PersonalUtilities.Functions.RegularExpressions Imports PersonalUtilities.Functions.RegularExpressions
@@ -56,6 +57,11 @@ Namespace API.YouTube
Friend ReadOnly TitleHtmlConverter As Func(Of String, String) = Function(Input) Input.StringRemoveWinForbiddenSymbols().StringTrim() Friend ReadOnly TitleHtmlConverter As Func(Of String, String) = Function(Input) Input.StringRemoveWinForbiddenSymbols().StringTrim()
Friend ReadOnly ProgressProvider As IMyProgressNumberProvider = MyProgressNumberProvider.Percentage Friend ReadOnly ProgressProvider As IMyProgressNumberProvider = MyProgressNumberProvider.Percentage
Public ReadOnly TrueUrlRegEx As RParams = RParams.DM(Base.YouTubeFunctions.TrueUrlPattern, 0, EDP.ReturnValue) Public ReadOnly TrueUrlRegEx As RParams = RParams.DM(Base.YouTubeFunctions.TrueUrlPattern, 0, EDP.ReturnValue)
Friend ReadOnly MusicUrlApply As RParams = RParams.DMS("https://([w\.]*)youtube.com.+", 1, RegexReturn.Replace, EDP.ReturnValue,
CType(Function(input$) "music.", Func(Of String, String)), String.Empty)
<Extension> Friend Function ToMusicUrl(ByVal URL As String, ByVal IsMusic As Boolean) As String
Try : Return If(IsMusic And Not URL.IsEmptyString, CStr(RegexReplace(URL, MusicUrlApply)).IfNullOrEmpty(URL), URL) : Catch : Return URL : End Try
End Function
Friend Function CleanFileName(ByVal f As SFile) As SFile Friend Function CleanFileName(ByVal f As SFile) As SFile
If Not f.IsEmptyString And Not f.Name.IsEmptyString Then If Not f.IsEmptyString And Not f.Name.IsEmptyString Then
Dim ff As SFile = f Dim ff As SFile = f

View File

@@ -133,7 +133,7 @@ Namespace DownloadObjects.STDownloader
ICON_SITE.Image = .SiteIcon ICON_SITE.Image = .SiteIcon
LBL_TIME.Text = AConvert(Of String)(.Duration, TimeToStringProvider, String.Empty) LBL_TIME.Text = AConvert(Of String)(.Duration, TimeToStringProvider, String.Empty)
LBL_TITLE.Text = .ToString(True) LBL_TITLE.Text = $"{If(MyYouTubeSettings.FileAddDateToFileName_VideoList.Value, $"[{ .DateAdded:yyyy-MM-dd}] ", String.Empty)}{ .ToString(True)}"
If Not .SiteKey = YouTubeSiteKey And .ContentType = Plugin.UserMediaTypes.Picture Then If Not .SiteKey = YouTubeSiteKey And .ContentType = Plugin.UserMediaTypes.Picture Then
LBL_INFO.Text = .File.Extension.StringToUpper LBL_INFO.Text = .File.Extension.StringToUpper
ElseIf Not .IsMusic And Not (.MediaType = Plugin.UserMediaTypes.Audio Or .MediaType = Plugin.UserMediaTypes.AudioPre) Then ElseIf Not .IsMusic And Not (.MediaType = Plugin.UserMediaTypes.Audio Or .MediaType = Plugin.UserMediaTypes.AudioPre) Then
@@ -221,7 +221,7 @@ Namespace DownloadObjects.STDownloader
t = 0 t = 0
End If End If
LBL_TITLE.Text = MyContainer.ToString(True) LBL_TITLE.Text = $"{If(MyYouTubeSettings.FileAddDateToFileName_VideoList.Value, $"[{ .DateAdded:yyyy-MM-dd}] ", String.Empty)}{ .ToString(True)}"
If Not .SiteKey = YouTubeSiteKey Then BTT_VIEW_SETTINGS.Visible = False If Not .SiteKey = YouTubeSiteKey Then BTT_VIEW_SETTINGS.Visible = False

View File

@@ -247,7 +247,7 @@ Namespace DownloadObjects.STDownloader
Dim useCookiesParse As Boolean? = Nothing Dim useCookiesParse As Boolean? = Nothing
If useCookies Then useCookiesParse = True If useCookies Then useCookiesParse = True
Dim standardizeUrls As Boolean = MyYouTubeSettings.StandardizeURLs Dim standardizeUrls As Boolean = MyYouTubeSettings.StandardizeURLs
Dim standardize As Func(Of String, String) = Function(input) If(standardizeUrls, YouTubeFunctions.StandardizeURL(input), input) Dim standardize As Func(Of String, String) = Function(input) If(standardizeUrls, YouTubeFunctions.StandardizeURL(input), input.StringTrim)
Dim c As IYouTubeMediaContainer = Nothing Dim c As IYouTubeMediaContainer = Nothing
Dim url$ = String.Empty Dim url$ = String.Empty

View File

@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2024.5.18.0")> <Assembly: AssemblyVersion("2024.6.6.0")>
<Assembly: AssemblyFileVersion("2024.5.18.0")> <Assembly: AssemblyFileVersion("2024.6.6.0")>
<Assembly: NeutralResourcesLanguage("en")> <Assembly: NeutralResourcesLanguage("en")>

View File

@@ -656,6 +656,15 @@ Namespace API.YouTube.Objects
End If End If
End Set End Set
End Property End Property
Friend Sub FileDateUpdate()
Dim n$ = _File.Name.StringTrim
Dim s$ = IIf(n.IsEmptyString, String.Empty, " ")
Select Case MyYouTubeSettings.FileAddDateToFileName.Value
Case FileDateMode.Before : n = $"[{DateAdded:yyyy-MM-dd}]{s}{n}"
Case FileDateMode.After : n = $"{n}{s}[{DateAdded:yyyy-MM-dd}]"
End Select
_File.Name = n
End Sub
Public Property FileSettings As SFile Public Property FileSettings As SFile
Private Property IUserMedia_File As String Implements IUserMedia.File Private Property IUserMedia_File As String Implements IUserMedia.File
Get Get
@@ -1143,12 +1152,22 @@ Namespace API.YouTube.Objects
If fileUrl.Exists Then AddFile(fileUrl) If fileUrl.Exists Then AddFile(fileUrl)
End If End If
If MyYouTubeSettings.CreateDescriptionFiles And Not Description.IsEmptyString Then With MyYouTubeSettings
Dim fileDesr As SFile = File If .CreateDescriptionFiles And (Not Description.IsEmptyString Or
fileDesr.Extension = "txt" (.CreateDescriptionFiles_CreateWithNoDescription And .CreateDescriptionFiles_AddUploadDate)) Then
TextSaver.SaveTextToFile(Description, fileDesr,,, EDP.None) Dim fileDesr As SFile = File
If fileDesr.Exists Then AddFile(fileDesr) fileDesr.Extension = "txt"
End If 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 PlaylistCount > 0 And Not CoverDownloaded And Not PlaylistID.IsEmptyString Then DownloadPlaylistCover(PlaylistID, File, UseCookies)
If prExists Then Progress.InformationTemporary = $"Download {MediaType}: post processing" If prExists Then Progress.InformationTemporary = $"Download {MediaType}: post processing"
@@ -1534,7 +1553,7 @@ Namespace API.YouTube.Objects
ID = .Value("id") ID = .Value("id")
Title = TitleHtmlConverter.Invoke(.Value("title")) Title = TitleHtmlConverter.Invoke(.Value("title"))
Description = .Value("description") Description = .Value("description")
URL = .Value("webpage_url") URL = .Value("webpage_url").ToMusicUrl(IsMusic)
PlaylistID = .Value("playlist_id") PlaylistID = .Value("playlist_id")
PlaylistCount = .Value("n_entries").IfNullOrEmpty(.Value("playlist_count")).FromXML(Of Integer)(0) PlaylistCount = .Value("n_entries").IfNullOrEmpty(.Value("playlist_count")).FromXML(Of Integer)(0)
@@ -1572,6 +1591,7 @@ Namespace API.YouTube.Objects
If tValue.HasValue Then Duration = TimeSpan.FromSeconds(tValue.Value) If tValue.HasValue Then Duration = TimeSpan.FromSeconds(tValue.Value)
End If End If
DateAdded = AConvert(Of Date)(.Value("release_date").IfNullOrEmpty(.Value("upload_date")), DateAddedProvider, New Date) DateAdded = AConvert(Of Date)(.Value("release_date").IfNullOrEmpty(.Value("upload_date")), DateAddedProvider, New Date)
If Not IsMusic Then FileDateUpdate()
ParseFormats(.Self) ParseFormats(.Self)

View File

@@ -115,6 +115,9 @@
<ItemGroup> <ItemGroup>
<Compile Include="Attributes\GridVisibleAttribute.vb" /> <Compile Include="Attributes\GridVisibleAttribute.vb" />
<Compile Include="Base\TableControlsProcessor.vb" /> <Compile Include="Base\TableControlsProcessor.vb" />
<Compile Include="Controls\ButtonRC.vb">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ChannelTabsChooserForm.Designer.vb"> <Compile Include="Controls\ChannelTabsChooserForm.Designer.vb">
<DependentUpon>ChannelTabsChooserForm.vb</DependentUpon> <DependentUpon>ChannelTabsChooserForm.vb</DependentUpon>
</Compile> </Compile>

View File

@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2024.5.18.0")> <Assembly: AssemblyVersion("2024.6.6.0")>
<Assembly: AssemblyFileVersion("2024.5.18.0")> <Assembly: AssemblyFileVersion("2024.6.6.0")>
<Assembly: NeutralResourcesLanguage("en")> <Assembly: NeutralResourcesLanguage("en")>

View File

@@ -54,9 +54,8 @@ Namespace API.Base
Dim aStr$ = String.Empty Dim aStr$ = String.Empty
If Count > 1 Then aStr = $" ({Number}/{Count})" If Count > 1 Then aStr = $" ({Number}/{Count})"
Try Try
If Host.Source.ReadyToDownload(PDownload.SavedPosts) Then If Host.Available(PDownload.SavedPosts, Multiple Or Count > 1) Then
If Host.Available(PDownload.SavedPosts, Multiple Or Count > 1) Then If Host.Source.ReadyToDownload(PDownload.SavedPosts) Then
Host.DownloadStarted(PDownload.SavedPosts)
If Count > 1 Then Progress.Information = $"{Host.Name} - {Host.AccountName.IfNullOrEmpty(SettingsHost.NameAccountNameDefault)}" If Count > 1 Then Progress.Information = $"{Host.Name} - {Host.AccountName.IfNullOrEmpty(SettingsHost.NameAccountNameDefault)}"
Using user As IUserData = Host.GetInstance(PDownload.SavedPosts, Nothing, False, False) Using user As IUserData = Host.GetInstance(PDownload.SavedPosts, Nothing, False, False)
If Not user Is Nothing Then If Not user Is Nothing Then
@@ -83,11 +82,11 @@ Namespace API.Base
End Using End Using
Else Else
_Unavailable += 1 _Unavailable += 1
Progress.InformationTemporary = $"Host [{Host.Name}{aStr}] is unavailable" Progress.InformationTemporary = $"Host [{Host.Name}{aStr}] is not ready"
End If End If
Else Else
_NotReady += 1 _NotReady += 1
Progress.InformationTemporary = $"Host [{Host.Name}{aStr}] is not ready" Progress.InformationTemporary = $"Host [{Host.Name}{aStr}] is unavailable"
End If End If
Catch oex As OperationCanceledException When Token.IsCancellationRequested Catch oex As OperationCanceledException When Token.IsCancellationRequested
_ErrorCount += 1 _ErrorCount += 1
@@ -96,9 +95,6 @@ Namespace API.Base
_ErrorCount += 1 _ErrorCount += 1
Progress.InformationTemporary = $"{Host.Name}{aStr} downloading error" Progress.InformationTemporary = $"{Host.Name}{aStr} downloading error"
ErrorsDescriber.Execute(EDP.SendToLog, ex, $"[API.Base.ProfileSaved.Download({Host.Key}{aStr})]") ErrorsDescriber.Execute(EDP.SendToLog, ex, $"[API.Base.ProfileSaved.Download({Host.Key}{aStr})]")
Finally
Host.DownloadDone(PDownload.SavedPosts)
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
End Class End Class

View File

@@ -143,7 +143,7 @@ Namespace API.Base
Protected Const Name_UserID As String = "UserID" Protected Const Name_UserID As String = "UserID"
Protected Const Name_Options As String = "Options" Protected Const Name_Options As String = "Options"
Protected Const Name_Description As String = "Description" Protected Const Name_Description As String = "Description"
Private Const Name_ParseUserMediaOnly As String = "ParseUserMediaOnly" Protected Const Name_ParseUserMediaOnly As String = "ParseUserMediaOnly"
Private Const Name_IsSubscription As String = UserInfo.Name_IsSubscription Private Const Name_IsSubscription As String = UserInfo.Name_IsSubscription
Private Const Name_Temporary As String = "Temporary" Private Const Name_Temporary As String = "Temporary"
Private Const Name_Favorite As String = "Favorite" Private Const Name_Favorite As String = "Favorite"

View File

@@ -446,6 +446,11 @@ Namespace API.Instagram
Friend Overrides Sub EndInit() Friend Overrides Sub EndInit()
Try : MyLastRequests.Add(LastDownloadDate.Value, LastRequestsCount.Value) : Catch : End Try 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 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
End If
MyBase.EndInit() MyBase.EndInit()
End Sub End Sub
#End Region #End Region
@@ -480,8 +485,24 @@ Namespace API.Instagram
Private ____AvailableSilent As Boolean = True Private ____AvailableSilent As Boolean = True
Private ____AvailableChecked As Boolean = False Private ____AvailableChecked As Boolean = False
Private ____AvailableResult As Boolean = False Private ____AvailableResult As Boolean = False
Private Sub ResetDownloadOptions()
If ActiveJobs < 1 Then
____DownloadStarted = False
____AvailableRequested = False
____AvailableChecked = False
____AvailableSilent = True
____AvailableResult = False
If ActiveSessionRequestsExists Then RefreshMyLastRequests(Now)
ActiveSessionRequestsExists = False
_NextWNM = UserData.WNM.Notify
_NextTagged = True
SkipUntilNextSession = False
AvailableText = String.Empty
ActiveJobs = 0
End If
End Sub
Friend Overrides Function Available(ByVal What As Download, ByVal Silent As Boolean) As Boolean Friend Overrides Function Available(ByVal What As Download, ByVal Silent As Boolean) As Boolean
If MyBase.Available(What, Silent) Then If MyBase.Available(What, Silent) And ActiveJobs < 2 Then
If CInt(DownDetectorValue.Value) >= 0 Then If CInt(DownDetectorValue.Value) >= 0 Then
If ____DownloadStarted Then If ____DownloadStarted Then
____AvailableRequested = True ____AvailableRequested = True
@@ -551,10 +572,9 @@ Namespace API.Instagram
Private _NextWNM As UserData.WNM = UserData.WNM.Notify Private _NextWNM As UserData.WNM = UserData.WNM.Notify
Private _NextTagged As Boolean = True Private _NextTagged As Boolean = True
Friend Overrides Sub DownloadStarted(ByVal What As Download) Friend Overrides Sub DownloadStarted(ByVal What As Download)
If ActiveJobs = 0 Then ActiveSessionRequestsExists = False ResetDownloadOptions()
ActiveJobs += 1 ActiveJobs += 1
If What = Download.Main Then ____DownloadStarted = True If ActiveJobs = 1 Then ____DownloadStarted = True : ActiveSessionDate = Now
If ActiveJobs = 1 Then ActiveSessionDate = Now
If Not HH_IG_WWW_CLAIM_IS_ZERO AndAlso If Not HH_IG_WWW_CLAIM_IS_ZERO AndAlso
( (
(CBool(HH_IG_WWW_CLAIM_USE_DEFAULT_ALGO.Value) AndAlso MyLastRequestsDate.AddMinutes(HH_IG_WWW_CLAIM_UPDATE_INTERVAL.Value) < Now) Or (CBool(HH_IG_WWW_CLAIM_USE_DEFAULT_ALGO.Value) AndAlso MyLastRequestsDate.AddMinutes(HH_IG_WWW_CLAIM_UPDATE_INTERVAL.Value) < Now) Or
@@ -594,18 +614,8 @@ Namespace API.Instagram
End With End With
End Sub End Sub
Friend Overrides Sub DownloadDone(ByVal What As Download) Friend Overrides Sub DownloadDone(ByVal What As Download)
_NextWNM = UserData.WNM.Notify
_NextTagged = True
If ActiveSessionRequestsExists Then RefreshMyLastRequests(Now)
ActiveJobs -= 1 ActiveJobs -= 1
SkipUntilNextSession = False ResetDownloadOptions()
If What = Download.Main Then ____DownloadStarted = False
If ActiveJobs = 0 Then
____AvailableRequested = False
____AvailableChecked = False
____AvailableSilent = True
____AvailableResult = False
End If
End Sub End Sub
#End Region #End Region
#Region "Settings" #Region "Settings"

View File

@@ -11,5 +11,15 @@ Namespace API.OnlyFans
Friend Module Declarations Friend Module Declarations
Friend ReadOnly DateProvider As New ADateTime("O") Friend ReadOnly DateProvider As New ADateTime("O")
Friend ReadOnly RegExPostID As RParams = RParams.DM("(?<=onlyfans\.com/)(\d+)", 0, EDP.ReturnValue) Friend ReadOnly RegExPostID As RParams = RParams.DM("(?<=onlyfans\.com/)(\d+)", 0, EDP.ReturnValue)
Friend ReadOnly OFScraperConfigPatternFile As SFile = $"{SettingsFolderName}\OFScraperConfigPattern.json"
Friend Function CheckOFSConfig() As Boolean
If Not OFScraperConfigPatternFile.Exists Then
Dim t$ = Text.Encoding.UTF8.GetString(My.Resources.OFResources.OFScraperConfigPattern)
TextSaver.SaveTextToFile(t, OFScraperConfigPatternFile, True)
Return OFScraperConfigPatternFile.Exists
Else
Return True
End If
End Function
End Module End Module
End Namespace End Namespace

View File

@@ -38,14 +38,18 @@
}, },
"advanced_options": { "advanced_options": {
"code-execution": false, "code-execution": false,
"dynamic-mode-default": "deviint", "dynamic-mode-default": "sneaky",
"backend": "aio", "backend": "aio",
"downloadbars": false, "downloadbars": false,
"cache-mode": "sqlite", "cache-mode": "sqlite",
"appendlog": true, "appendlog": true,
"custom": null, "custom": null,
"sanitize_text": false, "sanitize_text": false,
"avatar": true "avatar": true,
"custom_values": {
"SNEAKY": "https://raw.githubusercontent.com/Growik/onlyfans-dynamic-rules/main/rules.json",
"CDRM": "https://old.cdrm-project.com/wv"
}
}, },
"responsetype": { "responsetype": {
"timeline": "Posts", "timeline": "Posts",

View File

@@ -133,12 +133,25 @@ Namespace API.OnlyFans
End If End If
End Get End Get
End Property End Property
<PClonable, PXML("keydb_api")> Private ReadOnly Property Keydb_Api_XML As PropertyValue
<PropertyOption(ControlText:="keydb_api", Category:=CAT_OFS)>
Friend ReadOnly Property Keydb_Api As PropertyValue
Get
If Not DefaultInstance Is Nothing Then
Return DirectCast(DefaultInstance, SiteSettings).Keydb_Api_XML
Else
Return Keydb_Api_XML
End If
End Get
End Property
#End Region #End Region
#End Region #End Region
#Region "Initializer" #Region "Initializer"
Friend Sub New(ByVal AccName As String, ByVal Temp As Boolean) Friend Sub New(ByVal AccName As String, ByVal Temp As Boolean)
MyBase.New("OnlyFans", ".onlyfans.com", AccName, Temp, My.Resources.SiteResources.OnlyFansIcon_32, My.Resources.SiteResources.OnlyFansPic_32) MyBase.New("OnlyFans", ".onlyfans.com", AccName, Temp, My.Resources.SiteResources.OnlyFansIcon_32, My.Resources.SiteResources.OnlyFansPic_32)
CheckOFSConfig()
_AllowUserAgentUpdate = False _AllowUserAgentUpdate = False
With Responser With Responser
@@ -192,6 +205,7 @@ Namespace API.OnlyFans
End If End If
OFScraperMP4decrypt_XML = New PropertyValue(String.Empty, GetType(String)) OFScraperMP4decrypt_XML = New PropertyValue(String.Empty, GetType(String))
KeyModeDefault_XML = New PropertyValue(KeyModeDefault_Default) KeyModeDefault_XML = New PropertyValue(KeyModeDefault_Default)
Keydb_Api_XML = New PropertyValue(String.Empty, GetType(String))
UserRegex = RParams.DMS(String.Format(UserRegexDefaultPattern, "onlyfans.com/"), 1, EDP.ReturnValue) UserRegex = RParams.DMS(String.Format(UserRegexDefaultPattern, "onlyfans.com/"), 1, EDP.ReturnValue)
UrlPatternUser = "https://onlyfans.com/{0}" UrlPatternUser = "https://onlyfans.com/{0}"
@@ -204,8 +218,19 @@ Namespace API.OnlyFans
End Function End Function
#End Region #End Region
#Region "Update" #Region "Update"
Private __UseOldAuthRules As Boolean = True
Private __DynamicRules As String = String.Empty
Friend Overrides Sub BeginUpdate()
__UseOldAuthRules = UseOldAuthRules.Value
__DynamicRules = AConvert(Of String)(DynamicRules.Value, String.Empty)
MyBase.BeginUpdate()
End Sub
Friend Overrides Sub Update() Friend Overrides Sub Update()
If _SiteEditorFormOpened Then Responser.Cookies.Changed = False If _SiteEditorFormOpened Then
If Not __UseOldAuthRules = CBool(UseOldAuthRules.Value) Or Not AEquals(Of String)(__DynamicRules, DynamicRules.Value) Then _
LastDateUpdated = LastDateUpdated.AddYears(-1)
Responser.Cookies.Changed = False
End If
MyBase.Update() MyBase.Update()
End Sub End Sub
#End Region #End Region

View File

@@ -549,7 +549,8 @@ Namespace API.OnlyFans
Optional ByVal Round As Integer = 0) As Boolean Optional ByVal Round As Integer = 0) As Boolean
Try Try
If UpdateAuthFile(ForceUpdateAuth) Then If UpdateAuthFile(ForceUpdateAuth) Then
Const nullMsg$ = "The auth parameter is null" Const nullMsg$ = "The auth parameter(s) is null"
Const formatMidPart$ = ":{0}:{1:x}:"
Dim j As EContainer Dim j As EContainer
Try Try
j = JsonDocument.Parse(AuthFile.GetText) j = JsonDocument.Parse(AuthFile.GetText)
@@ -565,8 +566,16 @@ Namespace API.OnlyFans
End Try End Try
If Not j Is Nothing Then If Not j Is Nothing Then
Dim pattern$ = j.Value("format") Dim pattern$ = j.Value("format")
If pattern.IsEmptyString Then Throw New ArgumentNullException("format", nullMsg)
pattern = pattern.Replace("{}", "{0}").Replace("{:x}", "{1:x}") If Not pattern.IsEmptyString Then
pattern = pattern.Replace("{}", "{0}").Replace("{:x}", "{1:x}")
ElseIf Not j.Value("prefix").IsEmptyString And Not j.Value("suffix").IsEmptyString Then
pattern = j.Value("prefix") & formatMidPart & j.Value("suffix")
ElseIf Not j.Value("start").IsEmptyString And Not j.Value("end").IsEmptyString Then
pattern = j.Value("start") & formatMidPart & j.Value("end")
Else
Throw New ArgumentNullException("format", nullMsg)
End If
Dim li%() = j("checksum_indexes").Select(Function(e) CInt(e(0).Value)).ToArray Dim li%() = j("checksum_indexes").Select(Function(e) CInt(e(0).Value)).ToArray
@@ -607,10 +616,14 @@ Namespace API.OnlyFans
Dim r$ = GetWebString(If(ACheck(Of String)(MySettings.DynamicRules.Value), Dim r$ = GetWebString(If(ACheck(Of String)(MySettings.DynamicRules.Value),
CStr(MySettings.DynamicRules.Value), CStr(MySettings.DynamicRules.Value),
IIf(MySettings.UseOldAuthRules.Value, urlOld, urlNew)),, EDP.ReturnValue) IIf(MySettings.UseOldAuthRules.Value, urlOld, urlNew)),, EDP.ReturnValue)
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)
If Not r.IsEmptyString Then If Not r.IsEmptyString Then
Using j As EContainer = JsonDocument.Parse(r, EDP.ReturnValue) Using j As EContainer = JsonDocument.Parse(r, EDP.ReturnValue)
If j.ListExists Then If j.ListExists Then
If Not j.Value("format").IsEmptyString And j("checksum_indexes").ListExists And If checkFormat(j) And j("checksum_indexes").ListExists And
Not j.Value("static_param").IsEmptyString And Not j.Value("checksum_constant").IsEmptyString Then _ Not j.Value("static_param").IsEmptyString And Not j.Value("checksum_constant").IsEmptyString Then _
TextSaver.SaveTextToFile(r, AuthFile, True, False, EDP.ThrowException) : MySettings.LastDateUpdated = Now TextSaver.SaveTextToFile(r, AuthFile, True, False, EDP.ThrowException) : MySettings.LastDateUpdated = Now
End If End If
@@ -658,12 +671,9 @@ Namespace API.OnlyFans
currentCache.Validate() currentCache.Validate()
Dim cacheRoot As SFile = currentCache.NewPath Dim cacheRoot As SFile = currentCache.NewPath
cacheRoot.Exists(SFO.Path, True, EDP.ThrowException) cacheRoot.Exists(SFO.Path, True, EDP.ThrowException)
Dim f As SFile = $"{SettingsFolderName}\OFScraperConfigPattern.json" Dim f As SFile = OFScraperConfigPatternFile
Dim configText$ Dim configText$
If Not f.Exists Then CheckOFSConfig()
configText = Text.Encoding.UTF8.GetString(My.Resources.OFResources.OFScraperConfigPattern)
TextSaver.SaveTextToFile(configText, f, True)
End If
If f.Exists Then If f.Exists Then
Dim replaceValue$ = String.Empty Dim replaceValue$ = String.Empty
Dim rp As RParams = RParams.DMS(String.Empty, 1, RegexReturn.Replace, RegexOptions.IgnoreCase, Dim rp As RParams = RParams.DMS(String.Empty, 1, RegexReturn.Replace, RegexOptions.IgnoreCase,
@@ -684,6 +694,7 @@ Namespace API.OnlyFans
End If End If
If Settings.FfmpegFile.Exists Then updateConf("ffmpeg", Settings.FfmpegFile.File.ToString.Replace("\", "/")) If Settings.FfmpegFile.Exists Then updateConf("ffmpeg", Settings.FfmpegFile.File.ToString.Replace("\", "/"))
updateConf("key-mode-default", CStr(MySettings.KeyModeDefault.Value).IfNullOrEmpty(SiteSettings.KeyModeDefault_Default)) updateConf("key-mode-default", CStr(MySettings.KeyModeDefault.Value).IfNullOrEmpty(SiteSettings.KeyModeDefault_Default))
updateConf("keydb_api", CStr(MySettings.Keydb_Api.Value))
f = currentCache f = currentCache
f.Name = "config" f.Name = "config"
f.Extension = "json" f.Extension = "json"

View File

@@ -914,19 +914,24 @@ Namespace API.Reddit
Dim RedGifsHost As SettingsHost = Settings(RedGifs.RedGifsSiteKey, RedGifsAccount) Dim RedGifsHost As SettingsHost = Settings(RedGifs.RedGifsSiteKey, RedGifsAccount)
If RedGifsHost Is Nothing Then RedGifsHost = Settings(RedGifs.RedGifsSiteKey).Default If RedGifsHost Is Nothing Then RedGifsHost = Settings(RedGifs.RedGifsSiteKey).Default
RedGifsResponser = RedGifsHost.Responser.Copy RedGifsResponser = RedGifsHost.Responser.Copy
Dim respNoHeaders As Responser = Responser.Copy
Dim m As UserMedia, m2 As UserMedia Dim m As UserMedia, m2 As UserMedia
Dim r$ Dim r$, url$
Dim j As EContainer Dim j As EContainer
Dim lastCount%, li% Dim lastCount%, li%
Dim rv As New ErrorsDescriber(EDP.ReturnValue)
respNoHeaders.Headers.Clear()
ProgressPre.ChangeMax(_ContentList.Count) ProgressPre.ChangeMax(_ContentList.Count)
For i% = 0 To _ContentList.Count - 1 For i% = 0 To _ContentList.Count - 1
m = _ContentList(i) m = _ContentList(i)
ProgressPre.Perform() ProgressPre.Perform()
If m.State = UStates.Missing AndAlso Not m.Post.ID.IsEmptyString Then If m.State = UStates.Missing AndAlso Not m.Post.ID.IsEmptyString Then
ThrowAny(Token) ThrowAny(Token)
r = Responser.GetResponse($"https://www.reddit.com/comments/{m.Post.ID.Split("_").LastOrDefault}/.json",, EDP.ReturnValue) url = $"https://www.reddit.com/comments/{m.Post.ID.Split("_").LastOrDefault}/.json"
r = Responser.GetResponse(url,, rv)
If r.IsEmptyString Then r = respNoHeaders.GetResponse(url,, rv)
If Not r.IsEmptyString Then If Not r.IsEmptyString Then
j = JsonDocument.Parse(r, EDP.ReturnValue) j = JsonDocument.Parse(r, rv)
If Not j Is Nothing Then If Not j Is Nothing Then
If j.Count > 0 Then If j.Count > 0 Then
lastCount = _TempMediaList.Count lastCount = _TempMediaList.Count

View File

@@ -101,7 +101,7 @@ Namespace API.Twitter
ConcurrentDownloads = New PropertyValue(1) ConcurrentDownloads = New PropertyValue(1)
MyConcurrentDownloadsProvider = New ConcurrentDownloadsProvider MyConcurrentDownloadsProvider = New ConcurrentDownloadsProvider
UserRegex = RParams.DMS(String.Format(UserRegexDefaultPattern, "/(twitter|x).com/"), 2) UserRegex = RParams.DMS(String.Format(UserRegexDefaultPattern, $"/(twitter|x).com({CommunitiesUser}|)/"), 3)
UrlPatternUser = "https://x.com/{0}" UrlPatternUser = "https://x.com/{0}"
ImageVideoContains = "twitter" ImageVideoContains = "twitter"
CheckNetscapeCookiesOnEndInit = True CheckNetscapeCookiesOnEndInit = True
@@ -110,8 +110,9 @@ Namespace API.Twitter
Friend Overrides Function GetInstance(ByVal What As ISiteSettings.Download) As IPluginContentProvider Friend Overrides Function GetInstance(ByVal What As ISiteSettings.Download) As IPluginContentProvider
Return New UserData Return New UserData
End Function End Function
Friend Const SinglePostPattern As String = "https://x.com/i/web/status/{0}"
Friend Overrides Function GetUserPostUrl(ByVal User As UserDataBase, ByVal Media As UserMedia) As String Friend Overrides Function GetUserPostUrl(ByVal User As UserDataBase, ByVal Media As UserMedia) As String
Return $"https://x.com/{User.Name}/status/{Media.Post.ID}" Return String.Format(SinglePostPattern, Media.Post.ID)
End Function End Function
Friend Overrides Function BaseAuthExists() As Boolean Friend Overrides Function BaseAuthExists() As Boolean
Return Responser.CookiesExists Return Responser.CookiesExists
@@ -151,5 +152,18 @@ Namespace API.Twitter
End If End If
MyBase.Update() MyBase.Update()
End Sub End Sub
Friend Const CommunitiesUser As String = "/i/communities"
Friend Overrides Function IsMyUser(ByVal UserURL As String) As ExchangeOptions
Dim e As ExchangeOptions = MyBase.IsMyUser(UserURL)
If Not e.UserName.IsEmptyString Then
If UserURL.Contains(CommunitiesUser) Then e.Options = CommunitiesUser : e.UserName &= "@c"
Return e
Else
Return Nothing
End If
End Function
Friend Overrides Function GetUserUrl(ByVal User As IPluginContentProvider) As String
Return DirectCast(User, UserData).GetUserUrl
End Function
End Class End Class
End Namespace End Namespace

View File

@@ -26,8 +26,24 @@ Namespace API.Twitter
Private Const Name_GifsDownload As String = "GifsDownload" Private Const Name_GifsDownload As String = "GifsDownload"
Private Const Name_GifsSpecialFolder As String = "GifsSpecialFolder" Private Const Name_GifsSpecialFolder As String = "GifsSpecialFolder"
Private Const Name_GifsPrefix As String = "GifsPrefix" Private Const Name_GifsPrefix As String = "GifsPrefix"
Private Const Name_IsCommunity As String = "IsCommunity"
#End Region #End Region
#Region "Declarations" #Region "Declarations"
Private Const Label_Community As String = "Community"
Private _NameTrue As String = String.Empty
Friend Property NameTrue As String
Get
Return _NameTrue.IfNullOrEmpty(Name)
End Get
Set(ByVal NewName As String)
_NameTrue = NewName
End Set
End Property
Friend Overrides ReadOnly Property SpecialLabels As IEnumerable(Of String)
Get
Return {Label_Community}
End Get
End Property
Friend Enum DownloadModels As Integer Friend Enum DownloadModels As Integer
Undefined = 0 Undefined = 0
Media = 1 Media = 1
@@ -42,6 +58,7 @@ Namespace API.Twitter
Friend Property GifsDownload As Boolean = True Friend Property GifsDownload As Boolean = True
Friend Property GifsSpecialFolder As String = String.Empty Friend Property GifsSpecialFolder As String = String.Empty
Friend Property GifsPrefix As String = String.Empty Friend Property GifsPrefix As String = String.Empty
Friend Property IsCommunity As Boolean = False
Private ReadOnly LikesPosts As List(Of String) Private ReadOnly LikesPosts As List(Of String)
Private ReadOnly _DataNames As List(Of String) Private ReadOnly _DataNames As List(Of String)
Private ReadOnly Property MySettings As SiteSettings Private ReadOnly Property MySettings As SiteSettings
@@ -57,6 +74,9 @@ Namespace API.Twitter
Private Function RenameGdlFile(ByVal Input As SFile, ByVal i As Integer) As SFile Private Function RenameGdlFile(ByVal Input As SFile, ByVal i As Integer) As SFile
Return SFile.Rename(Input, $"{Input.PathWithSeparator}{i.NumToString(FileNameProvider)}.{Input.Extension}",, EDP.ThrowException) Return SFile.Rename(Input, $"{Input.PathWithSeparator}{i.NumToString(FileNameProvider)}.{Input.Extension}",, EDP.ThrowException)
End Function End Function
Friend Function GetUserUrl() As String
Return $"https://x.com{IIf(IsCommunity, SiteSettings.CommunitiesUser, String.Empty)}/{NameTrue}"
End Function
#End Region #End Region
#Region "Exchange options" #Region "Exchange options"
Friend Overrides Function ExchangeOptionsGet() As Object Friend Overrides Function ExchangeOptionsGet() As Object
@@ -121,7 +141,20 @@ Namespace API.Twitter
RemoveExistingDuplicates = .Value(Name_RemoveExistingDuplicates).FromXML(Of Boolean)(False) RemoveExistingDuplicates = .Value(Name_RemoveExistingDuplicates).FromXML(Of Boolean)(False)
StartMD5Checked = .Value(Name_StartMD5Checked).FromXML(Of Boolean)(False) StartMD5Checked = .Value(Name_StartMD5Checked).FromXML(Of Boolean)(False)
MediaModelAllowNonUserTweets = .Value(Name_MediaModelAllowNonUserTweets).FromXML(Of Boolean)(False) MediaModelAllowNonUserTweets = .Value(Name_MediaModelAllowNonUserTweets).FromXML(Of Boolean)(False)
IsCommunity = .Value(Name_IsCommunity).FromXML(Of Boolean)(False)
_NameTrue = .Value(Name_TrueName)
Else Else
If Name.Contains("@") And Not IsCommunity Then
IsCommunity = True
_NameTrue = Name.Split("@")(0)
ID = _NameTrue
ParseUserMediaOnly = False
Labels.ListAddValue(Label_Community, LNC)
Labels.Sort()
.Add(Name_UserID, ID)
.Add(Name_LabelsName, LabelsString)
.Add(Name_ParseUserMediaOnly, ParseUserMediaOnly.BoolToInteger)
End If
.Add(Name_FirstDownloadComplete, FirstDownloadComplete.BoolToInteger) .Add(Name_FirstDownloadComplete, FirstDownloadComplete.BoolToInteger)
.Add(Name_DownloadModelForceApply, DownloadModelForceApply.BoolToInteger) .Add(Name_DownloadModelForceApply, DownloadModelForceApply.BoolToInteger)
.Add(Name_DownloadModel, CInt(DownloadModel)) .Add(Name_DownloadModel, CInt(DownloadModel))
@@ -132,6 +165,8 @@ Namespace API.Twitter
.Add(Name_RemoveExistingDuplicates, RemoveExistingDuplicates.BoolToInteger) .Add(Name_RemoveExistingDuplicates, RemoveExistingDuplicates.BoolToInteger)
.Add(Name_StartMD5Checked, StartMD5Checked.BoolToInteger) .Add(Name_StartMD5Checked, StartMD5Checked.BoolToInteger)
.Add(Name_MediaModelAllowNonUserTweets, MediaModelAllowNonUserTweets.BoolToInteger) .Add(Name_MediaModelAllowNonUserTweets, MediaModelAllowNonUserTweets.BoolToInteger)
.Add(Name_IsCommunity, IsCommunity.BoolToInteger)
.Add(Name_TrueName, _NameTrue)
End If End If
End With End With
End Sub End Sub
@@ -188,14 +223,15 @@ Namespace API.Twitter
Dim newTwitterNodes() As Object = {0, "content", "items"} Dim newTwitterNodes() As Object = {0, "content", "items"}
Dim p As Predicate(Of EContainer) Dim p As Predicate(Of EContainer)
Dim pIndx% Dim pIndx%
Dim indxChanged As Boolean = False
Dim isOneNode As Boolean, isPins As Boolean, ExistsDetected As Boolean, userInfoParsed As Boolean = False Dim isOneNode As Boolean, isPins As Boolean, ExistsDetected As Boolean, userInfoParsed As Boolean = False
Dim j As EContainer, rootNode As EContainer, optionalNode As EContainer, workingNode As EContainer, tmpNode As EContainer, nn As EContainer = Nothing Dim j As EContainer, rootNode As EContainer, optionalNode As EContainer, workingNode As EContainer, tmpNode As EContainer, nn As EContainer = Nothing
Dim __parseContainer As Func(Of EContainer, Boolean) = Dim __parseContainer As Func(Of EContainer, Boolean) =
Function(ByVal ee As EContainer) As Boolean Function(ByVal ee As EContainer) As Boolean
nn = Nothing nn = Nothing
If dirIndx > 1 Then nn = ee If dirIndx > 1 Or IsCommunity Then nn = ee
If Not nn.ListExists Then If Not nn.ListExists Or IsCommunity Then
For Each node In nodes For Each node In nodes
nn = ee(node) nn = ee(node)
If nn.ListExists Then Exit For If nn.ListExists Then Exit For
@@ -269,10 +305,22 @@ Namespace API.Twitter
For i = 0 To timelineFiles.Count - 1 For i = 0 To timelineFiles.Count - 1
j = JsonDocument.Parse(timelineFiles(i).GetText) j = JsonDocument.Parse(timelineFiles(i).GetText)
If Not j Is Nothing Then If Not j Is Nothing Then
If i = 0 Then If i = 0 And Not indxChanged Then
If Not userInfoParsed Then If Not userInfoParsed Then
userInfoParsed = True userInfoParsed = True
Dim resValue$ = j.Value({"data", "user", "result"}, "__typename").StringTrim.StringToLower Dim resValue$ = j.Value({"data", IIf(IsCommunity, "communityResults", "user"), "result"}, "__typename").StringTrim.StringToLower
Dim icon$
Dim __getImage As Action(Of String) = Sub(ByVal img As String)
If Not img.IsEmptyString Then
Dim __imgFile As SFile = UrlFile(img, True)
If Not __imgFile.Name.IsEmptyString Then
If __imgFile.Extension.IsEmptyString Then __imgFile.Extension = "jpg"
__imgFile.Path = MyFile.CutPath.Path
If Not __imgFile.Exists Then GetWebFile(img, __imgFile, EDP.None)
If __imgFile.Exists Then IconBannerDownloaded = True
End If
End If
End Sub
If resValue.IsEmptyString Then If resValue.IsEmptyString Then
UserExists = False UserExists = False
j.Dispose() j.Dispose()
@@ -281,6 +329,29 @@ Namespace API.Twitter
UserSuspended = True UserSuspended = True
j.Dispose() j.Dispose()
Exit Sub Exit Sub
ElseIf IsCommunity Then
With j({"data", "communityResults", "result", "community_media_timeline", "timeline", "instructions"})
If .ListExists Then
With .Find(entriesNode, True)
If .ListExists Then
With .ItemF({0, "content", "items", 0, "item", "itemContent", "tweet_results", "result", "tweet", "community_results", "result"})
If .ListExists Then
If ID = .Value("id_str") Then
UserSiteNameUpdate(.Value("name"))
UserDescriptionUpdate(.Value("description"))
icon = .Value({"custom_banner_media", "media_info"}, "original_img_url").
IfNullOrEmpty(.Value({"default_banner_media", "media_info"}, "original_img_url"))
If Not icon.IsEmptyString And DownloadIconBanner Then __getImage.Invoke(icon)
End If
End If
End With
End If
End With
End If
End With
i = -1
indxChanged = True
Else Else
With j({"data", "user", "result"}) With j({"data", "user", "result"})
If .ListExists Then If .ListExists Then
@@ -290,21 +361,11 @@ Namespace API.Twitter
End If End If
With .Item({"legacy"}) With .Item({"legacy"})
If .ListExists Then If .ListExists Then
If .Value("screen_name").StringToLower = Name.ToLower Then If .Value("screen_name").StringToLower = NameTrue.ToLower Then
UserSiteNameUpdate(.Value("name")) UserSiteNameUpdate(.Value("name"))
UserDescriptionUpdate(.Value("description")) UserDescriptionUpdate(.Value("description"))
Dim __getImage As Action(Of String) = Sub(ByVal img As String)
If Not img.IsEmptyString Then icon = .Value("profile_image_url_https")
Dim __imgFile As SFile = UrlFile(img, True)
If Not __imgFile.Name.IsEmptyString Then
If __imgFile.Extension.IsEmptyString Then __imgFile.Extension = "jpg"
__imgFile.Path = MyFile.CutPath.Path
If Not __imgFile.Exists Then GetWebFile(img, __imgFile, EDP.None)
If __imgFile.Exists Then IconBannerDownloaded = True
End If
End If
End Sub
Dim icon$ = .Value("profile_image_url_https")
If Not icon.IsEmptyString Then icon = icon.Replace("_normal", String.Empty) If Not icon.IsEmptyString Then icon = icon.Replace("_normal", String.Empty)
If DownloadIconBanner Then If DownloadIconBanner Then
__getImage.Invoke(.Value("profile_banner_url")) __getImage.Invoke(.Value("profile_banner_url"))
@@ -316,34 +377,55 @@ Namespace API.Twitter
End If End If
End With End With
End If End If
ElseIf IsCommunity Then
i = -1
indxChanged = True
End If End If
Else Else
For pIndx = 0 To IIf(dirIndx < 2 Or dirIndx = 3, 1, 0) For pIndx = 0 To IIf(dirIndx < 2 Or dirIndx = 3, 1, 0)
optionalNode = Nothing optionalNode = Nothing
Select Case dirIndx rootNode = Nothing
Case 0, 1, 3 If IsCommunity Then
rootNode = j({"data", "user", "result", "timeline_v2", "timeline", "instructions"}) With j({"data", "communityResults", "result", "community_media_timeline", "timeline", "instructions"})
If rootNode.ListExists Then If .ListExists Then
If dirIndx = 3 Then If i = 0 Then
p = entriesNode rootNode = .Find(entriesNode, True)
isPins = False
Else Else
p = If(pIndx = 0, pinNode, timelineNode) rootNode = .Find(moduleItemsPredicate, True)
isPins = pIndx = 0
End If End If
optionalNode = rootNode optionalNode = rootNode
rootNode = rootNode.Find(p, dirIndx = 3)
If dirIndx <> 3 And rootNode.ListExists Then rootNode = rootNode.Find(entriesNode, dirIndx = 3)
End If End If
Case Else End With
isPins = False Else
rootNode = j({"globalObjects", "tweets"}) Select Case dirIndx
optionalNode = rootNode Case 0, 1, 3
End Select rootNode = j({"data", "user", "result", "timeline_v2", "timeline", "instructions"})
If rootNode.ListExists Then
If dirIndx = 3 Then
p = entriesNode
isPins = False
Else
p = If(pIndx = 0, pinNode, timelineNode)
isPins = pIndx = 0
End If
optionalNode = rootNode
rootNode = rootNode.Find(p, dirIndx = 3)
If dirIndx <> 3 And rootNode.ListExists Then rootNode = rootNode.Find(entriesNode, dirIndx = 3)
End If
Case Else
isPins = False
rootNode = j({"globalObjects", "tweets"})
optionalNode = rootNode
End Select
End If
If rootNode.ListExists Then If rootNode.ListExists Then
With rootNode With rootNode
isOneNode = dirIndx < 2 AndAlso .Name = entry If IsCommunity Then
isOneNode = pIndx = 0
Else
isOneNode = dirIndx < 2 AndAlso .Name = entry
End If
ProgressPre.ChangeMax(If(isOneNode, 1, .Count)) ProgressPre.ChangeMax(If(isOneNode, 1, .Count))
If isOneNode Then If isOneNode Then
ProgressPre.Perform() ProgressPre.Perform()
@@ -660,18 +742,18 @@ Namespace API.Twitter
Dim dir As SFile Dim dir As SFile
Dim dm As List(Of DownloadModels) = EnumExtract(Of DownloadModels)(DownloadModel).ListIfNothing Dim dm As List(Of DownloadModels) = EnumExtract(Of DownloadModels)(DownloadModel).ListIfNothing
Dim process As Boolean Dim process As Boolean
Dim urlPrePattern$ = $"https://x.com{IIf(IsCommunity, SiteSettings.CommunitiesUser, String.Empty)}/"
Using tgdl As New TwitterGDL(Nothing, Token, MySettings.AbortOnLimit.Value) With { Using tgdl As New TwitterGDL(Nothing, Token, MySettings.AbortOnLimit.Value) With {
.TempPostsList = _TempPostsList, .TempPostsList = _TempPostsList,
.AutoClear = True, .AutoClear = True,
.AutoReset = True, .AutoReset = True,
.CommandPermanent = $"chcp {BatchExecutor.UnicodeEncoding}", .CommandPermanent = $"chcp {BatchExecutor.UnicodeEncoding}",
.FileExchanger = confCache, .FileExchanger = confCache
.DebugMode = True
} }
tgdl.FileExchanger.DeleteCacheOnDispose = False tgdl.FileExchanger.DeleteCacheOnDispose = False
tgdl.FileExchanger.DeleteRootOnDispose = False tgdl.FileExchanger.DeleteRootOnDispose = False
For i As Byte = 0 To 3 For i As Byte = 0 To IIf(IsCommunity, 0, 3)
dir = rootDir.NewPath dir = rootDir.NewPath
dir.Exists(SFO.Path, True, EDP.ThrowException) dir.Exists(SFO.Path, True, EDP.ThrowException)
outList.Add(dir) outList.Add(dir)
@@ -679,10 +761,10 @@ Namespace API.Twitter
command = $"""{Settings.GalleryDLFile}"" --verbose --no-download --no-skip --config ""{conf}"" --write-pages " command = $"""{Settings.GalleryDLFile}"" --verbose --no-download --no-skip --config ""{conf}"" --write-pages "
command &= GdlGetIdFilterString() command &= GdlGetIdFilterString()
Select Case i Select Case i
Case 0 : command &= $"https://x.com/{Name}/media" : process = dm.Contains(DownloadModels.Media) Case 0 : command &= $"{urlPrePattern}{NameTrue}/media" : process = dm.Contains(DownloadModels.Media) Or IsCommunity
Case 1 : command &= $"https://x.com/{Name}" : process = dm.Contains(DownloadModels.Profile) Case 1 : command &= $"{urlPrePattern}{NameTrue}" : process = dm.Contains(DownloadModels.Profile)
Case 2 : command &= $"-o search-endpoint=graphql https://x.com/search?q=from:{Name}+include:nativeretweets" : process = dm.Contains(DownloadModels.Search) Case 2 : command &= $"-o search-endpoint=graphql https://x.com/search?q=from:{NameTrue}+include:nativeretweets" : process = dm.Contains(DownloadModels.Search) And Not IsCommunity
Case 3 : command &= $"https://x.com/{Name}/likes" : process = dm.Contains(DownloadModels.Likes) Case 3 : command &= $"{urlPrePattern}{NameTrue}/likes" : process = dm.Contains(DownloadModels.Likes)
Case Else : process = False Case Else : process = False
End Select End Select
'#If DEBUG Then '#If DEBUG Then
@@ -736,7 +818,6 @@ Namespace API.Twitter
#Region "ReparseMissing" #Region "ReparseMissing"
Private _ReparseLikes As Boolean = False Private _ReparseLikes As Boolean = False
Protected Overrides Sub ReparseMissing(ByVal Token As CancellationToken) Protected Overrides Sub ReparseMissing(ByVal Token As CancellationToken)
Const SinglePostPattern$ = "https://x.com/{0}/status/{1}"
Dim rList As New List(Of Integer) Dim rList As New List(Of Integer)
Dim URL$ = String.Empty Dim URL$ = String.Empty
Dim cache As CacheKeeper = Nothing Dim cache As CacheKeeper = Nothing
@@ -753,14 +834,7 @@ Namespace API.Twitter
Dim lim% Dim lim%
Dim specFolder$ = IIf(_ReparseLikes, "Likes", String.Empty) Dim specFolder$ = IIf(_ReparseLikes, "Likes", String.Empty)
ResetFileNameProvider() ResetFileNameProvider()
If IsSingleObjectDownload Then cache = If(IsSingleObjectDownload, Settings.Cache, CreateCache())
cache = Settings.Cache
ElseIf _ReparseLikes Then
cache = CreateCache()
Else
cache = New CacheKeeper(DownloadContentDefault_GetRootDir.CSFilePS)
cache.CacheDeleteError = CacheDeletionError(cache)
End If
If _ReparseLikes Then lim = LikesPosts.Count Else lim = _ContentList.Count If _ReparseLikes Then lim = LikesPosts.Count Else lim = _ContentList.Count
ProgressPre.ChangeMax(lim) ProgressPre.ChangeMax(lim)
For i = 0 To lim - 1 For i = 0 To lim - 1
@@ -774,7 +848,7 @@ Namespace API.Twitter
ElseIf _ReparseLikes Then ElseIf _ReparseLikes Then
URL = LikesPosts(i) URL = LikesPosts(i)
Else Else
URL = String.Format(SinglePostPattern, Name, m.Post.ID) URL = String.Format(SiteSettings.SinglePostPattern, m.Post.ID)
End If End If
f = GetDataFromGalleryDL(URL, cache, False, Token) f = GetDataFromGalleryDL(URL, cache, False, Token)
If Not f.IsEmptyString Then If Not f.IsEmptyString Then

View File

@@ -59,10 +59,10 @@ Namespace API.YouTube
.Cookies.Clear() .Cookies.Clear()
.Cookies.AddRange(Responser.Cookies) .Cookies.AddRange(Responser.Cookies)
.CookiesUpdated = True .CookiesUpdated = True
.PerformUpdate()
End With End With
End If End If
End With End With
DirectCast(MyYouTubeSettings, YTSettings_Internal).PerformUpdate()
End If End If
MyBase.Update() MyBase.Update()
End Sub End Sub

View File

@@ -58,7 +58,6 @@ Namespace DownloadObjects
End If End If
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "Change 'ActiveDownloadingProgress' size") ErrorsDescriber.Execute(EDP.SendToLog, ex, "Change 'ActiveDownloadingProgress' size")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
Private Sub Downloader_Reconfigured() Private Sub Downloader_Reconfigured()

View File

@@ -16,6 +16,7 @@ Imports PersonalUtilities.Tools.Notifications
Namespace DownloadObjects Namespace DownloadObjects
Friend Class AutoDownloader : Inherits GroupParameters : Implements IIndexable, IEContainerProvider, IComparable(Of AutoDownloader) Friend Class AutoDownloader : Inherits GroupParameters : Implements IIndexable, IEContainerProvider, IComparable(Of AutoDownloader)
Friend Event PauseChanged(ByVal Value As PauseModes) Friend Event PauseChanged(ByVal Value As PauseModes)
Friend Event PlanChanged As Scheduler.PlanChangedEventHandler
Friend Enum Modes As Integer Friend Enum Modes As Integer
None = 0 None = 0
Specified = 3 Specified = 3
@@ -199,6 +200,52 @@ Namespace DownloadObjects
Private Const Name_ShowSimpleNotification As String = "ShowSimpleNotification" Private Const Name_ShowSimpleNotification As String = "ShowSimpleNotification"
#End Region #End Region
#Region "Declarations" #Region "Declarations"
Private _LVIState As Integer = 0
Friend Function LVIStateChanged() As Boolean
Dim ____LVIState%
Dim result As Boolean
If Downloading Then
____LVIState = 1
ElseIf DownloadReady(True, True) Or ForceStartRequested Then
____LVIState = 2
ElseIf Not Working And Not IsManual Then
____LVIState = 3
ElseIf IsPaused Then
____LVIState = 4
ElseIf Settings.AutomationBrushUndownloadedPlansMinutes.Value > 0 AndAlso
LastDownloadDate.AddMinutes(Settings.AutomationBrushUndownloadedPlansMinutes.Value) < Now Then
____LVIState = 5
Else
____LVIState = 0
End If
result = Not _LVIState = ____LVIState
_LVIState = ____LVIState
Return result
End Function
Friend ReadOnly Property LVI As ListViewItem
Get
Dim l As New ListViewItem(ToString)
If Downloading Then
l.BackColor = MyColor.OkBack
l.ForeColor = MyColor.OkFore
ElseIf DownloadReady(True, True) Or ForceStartRequested Then
l.BackColor = MyColor.EditBack
l.ForeColor = MyColor.EditFore
ElseIf Not Working And Not IsManual Then
l.BackColor = MyColor.DeleteBack
l.ForeColor = MyColor.DeleteFore
ElseIf Working And IsPaused And Not IsManual Then
l.BackColor = MyColor.UpdateBack
l.ForeColor = MyColor.UpdateFore
ElseIf Settings.AutomationBrushUndownloadedPlansMinutes.Value > 0 AndAlso
LastDownloadDate.AddMinutes(Settings.AutomationBrushUndownloadedPlansMinutes.Value) < Now Then
l.BackColor = Color.FromArgb(224, 224, 224)
l.ForeColor = Color.FromArgb(64, 64, 64)
End If
LVIStateChanged()
Return l
End Get
End Property
Friend Property Source As Scheduler Friend Property Source As Scheduler
Private _Mode As Modes = Modes.None Private _Mode As Modes = Modes.None
Friend Property Mode As Modes Friend Property Mode As Modes
@@ -267,11 +314,15 @@ Namespace DownloadObjects
End Property End Property
Private Function GetWorkingState() As String Private Function GetWorkingState() As String
Dim OutStr$ Dim OutStr$
If Working Then If Working And Not IsManual Then
If StartupDelay > 0 And _StartTime.AddMinutes(StartupDelay) > Now Then If _Downloading Then
OutStr = $"delayed until {_StartTime.AddMinutes(StartupDelay).ToStringDate(ADateTime.Formats.BaseDateTime)}" OutStr = "downloading"
ElseIf _ForceStartRequested Then
OutStr = "force start pending"
ElseIf _StopRequested Then ElseIf _StopRequested Then
OutStr = "stopping" OutStr = "stopping"
ElseIf StartupDelay > 0 And _StartTime.AddMinutes(StartupDelay) > Now Then
OutStr = $"delayed ({StartupDelay}) until {_StartTime.AddMinutes(StartupDelay).ToStringDate(ADateTime.Formats.BaseDateTime)}"
Else Else
OutStr = "working" OutStr = "working"
End If End If
@@ -282,14 +333,26 @@ Namespace DownloadObjects
Case Else : OutStr &= $", paused ([{Pause}] until {AConvert(Of String)(_PauseValue, ADateTime.Formats.BaseDateTime, "?")})" Case Else : OutStr &= $", paused ([{Pause}] until {AConvert(Of String)(_PauseValue, ADateTime.Formats.BaseDateTime, "?")})"
End Select End Select
End If End If
ElseIf IsManual Then
If _Downloading Then
OutStr = "downloading"
ElseIf _ForceStartRequested Then
OutStr = "force start pending"
Else
OutStr = String.Empty
End If
Else Else
OutStr = "stopped" OutStr = "stopped"
End If End If
Return OutStr Return OutStr
End Function End Function
Private Function GetWorkingState_Manual() As String
Dim OutStr$ = GetWorkingState()
If Not OutStr.IsEmptyString Then Return $" ({OutStr})" Else Return String.Empty
End Function
Public Overrides Function ToString() As String Public Overrides Function ToString() As String
If IsManual Then If IsManual Then
Return $"{Name} (manual): last download date: {GetLastDateString()}" Return $"{Name} (manual{GetWorkingState_Manual()}): last download date: {GetLastDateString()}"
Else Else
Return $"{Name} ({GetWorkingState()}): last download date: {GetLastDateString()}; next run: {GetNextDateString()}" Return $"{Name} ({GetWorkingState()}): last download date: {GetLastDateString()}; next run: {GetNextDateString()}"
End If End If
@@ -316,6 +379,7 @@ Namespace DownloadObjects
Friend Sub New(ByVal x As EContainer) Friend Sub New(ByVal x As EContainer)
Me.New Me.New
Initialization = True Initialization = True
'URGENT: replace this line
Dim m% = x.Value(Name_Mode).FromXML(Of Integer)(Modes.None) Dim m% = x.Value(Name_Mode).FromXML(Of Integer)(Modes.None)
If m = 1 Or m = 2 Then m = Modes.Specified If m = 1 Or m = 2 Then m = Modes.Specified
Mode = m Mode = m
@@ -395,10 +459,10 @@ Namespace DownloadObjects
End Function End Function
#End Region #End Region
#Region "Execution" #Region "Execution"
Private AThread As Thread Private _Working As Boolean = False
Friend ReadOnly Property Working As Boolean Friend ReadOnly Property Working As Boolean
Get Get
Return If(AThread?.IsAlive, False) Return _Working
End Get End Get
End Property End Property
Private _StartTime As Date = Now Private _StartTime As Date = Now
@@ -406,11 +470,8 @@ Namespace DownloadObjects
If Not IsManual Or Force Then If Not IsManual Or Force Then
If Init Then _StartTime = Now If Init Then _StartTime = Now
_IsNewPlan = False _IsNewPlan = False
If Not Working And Not Mode = Modes.None Then If Not Working And Not Mode = Modes.None Then _Working = True
AThread = New Thread(New ThreadStart(AddressOf Checker)) RaiseEvent PlanChanged(Me)
AThread.SetApartmentState(ApartmentState.MTA)
AThread.Start()
End If
End If End If
End Sub End Sub
Private _StopRequested As Boolean = False Private _StopRequested As Boolean = False
@@ -434,6 +495,7 @@ Namespace DownloadObjects
Case Else : _PauseValue = Nothing Case Else : _PauseValue = Nothing
End Select End Select
RaiseEvent PauseChanged(p) RaiseEvent PauseChanged(p)
RaiseEvent PlanChanged(Me)
End Set End Set
End Property End Property
Private ReadOnly Property IsPaused As Boolean Private ReadOnly Property IsPaused As Boolean
@@ -457,7 +519,10 @@ Namespace DownloadObjects
End Get End Get
End Property End Property
Friend Sub [Stop]() Friend Sub [Stop]()
If Working Then _StopRequested = True If Working Then
If Downloading Then _StopRequested = True Else _Working = False
RaiseEvent PlanChanged(Me)
End If
End Sub End Sub
Friend Overloads Sub Skip() Friend Overloads Sub Skip()
If LastDownloadDate.AddMinutes(Timer) <= Now Then If LastDownloadDate.AddMinutes(Timer) <= Now Then
@@ -465,65 +530,59 @@ Namespace DownloadObjects
Else Else
_LastDownloadDateSkip = LastDownloadDate.AddMinutes(Timer) _LastDownloadDateSkip = LastDownloadDate.AddMinutes(Timer)
End If End If
RaiseEvent PlanChanged(Me)
End Sub End Sub
Friend Overloads Sub Skip(ByVal Minutes As Integer) Friend Overloads Sub Skip(ByVal Minutes As Integer)
_LastDownloadDateSkip = If(_LastDownloadDateSkip, Now).AddMinutes(Minutes) _LastDownloadDateSkip = If(_LastDownloadDateSkip, Now).AddMinutes(Minutes)
RaiseEvent PlanChanged(Me)
End Sub End Sub
Friend Overloads Sub Skip(ByVal ToDate As Date) Friend Overloads Sub Skip(ByVal ToDate As Date)
_LastDownloadDateSkip = ToDate _LastDownloadDateSkip = ToDate
RaiseEvent PlanChanged(Me)
End Sub End Sub
Friend Sub SkipReset() Friend Sub SkipReset()
_LastDownloadDateSkip = Nothing _LastDownloadDateSkip = Nothing
RaiseEvent PlanChanged(Me)
End Sub End Sub
Friend Sub ForceStart() Friend Sub ForceStart()
_ForceStartRequested = True _ForceStartRequested = True
If IsManual Then Start(False, True) If IsManual Then Start(False, True)
RaiseEvent PlanChanged(Me)
End Sub End Sub
Private _ForceStartRequested As Boolean = False Private _ForceStartRequested As Boolean = False
Private _SpecialDelayUse As Boolean = False Friend ReadOnly Property ForceStartRequested As Boolean
Private _SpecialDelayTime As Date? = Nothing Get
Private Sub Checker() Return _ForceStartRequested
Try End Get
Dim _StartDownload As Boolean End Property
While (Not _StopRequested Or Downloader.Working) And Not Mode = Modes.None Friend ReadOnly Property DownloadReady(Optional ByVal IgnorePause As Boolean = False, Optional ByVal IgnoreDownloaderWorking As Boolean = False) As Boolean
If ((IsManual And _ForceStartRequested) Or (NextExecutionDate < Now And Not IsPaused) Or _ForceStartRequested) And Get
Not _StopRequested And Not Mode = Modes.None Then If _StopRequested Then _Working = False
If Downloader.Working Then Return (Working Or IsManual) And ((IsManual And _ForceStartRequested) Or (Not IsManual And NextExecutionDate < Now And (Not IsPaused Or IgnorePause)) Or _ForceStartRequested) And
_SpecialDelayUse = True Not _StopRequested And Not Mode = Modes.None And (Not Downloader.Working Or IgnoreDownloaderWorking)
Else End Get
If _SpecialDelayUse And Not _SpecialDelayTime.HasValue Then _SpecialDelayTime = Now.AddSeconds(10) End Property
If Not _SpecialDelayUse OrElse (_SpecialDelayTime.HasValue AndAlso _SpecialDelayTime.Value < Now) Then Friend ReadOnly Property NextDate As Date?
_SpecialDelayUse = False Get
_SpecialDelayTime = Nothing If Not _StopRequested And Not Mode = Modes.None Then
_StartDownload = False If IsManual Or _ForceStartRequested Then
If Settings.Automation.Count = 1 Or _ForceStartRequested Or Index = -1 Then Return Now.AddYears(-10)
_StartDownload = True ElseIf Not IsPaused And Not IsManual And Working Then
Else Return NextExecutionDate
_StartDownload = NextExecutionDate.AddMilliseconds(1000 * (Index + 1)).Ticks <= Now.Ticks
End If
If _StartDownload Then
Download()
If IsManual Then Exit While
End If
End If
End If
End If End If
Thread.Sleep(500) End If
End While Return Nothing
Catch ex As Exception End Get
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[AutoDownloader.Checker]") End Property
Finally
_StopRequested = False
End Try
End Sub
Private _Downloading As Boolean = False Private _Downloading As Boolean = False
Friend ReadOnly Property Downloading As Boolean Friend ReadOnly Property Downloading As Boolean
Get Get
Return _Downloading Return _Downloading
End Get End Get
End Property End Property
Private Sub Download() Friend Sub Download()
_Downloading = True _Downloading = True
RaiseEvent PlanChanged(Me)
Dim Keys As New List(Of String) Dim Keys As New List(Of String)
Try Try
Dim users As New List(Of IUserData) Dim users As New List(Of IUserData)
@@ -589,7 +648,7 @@ Namespace DownloadObjects
While .Working Or .Count > 0 : notify.Invoke() : Thread.Sleep(200) : End While While .Working Or .Count > 0 : notify.Invoke() : Thread.Sleep(200) : End While
.AutoDownloaderWorking = False .AutoDownloaderWorking = False
notify.Invoke notify.Invoke
If simple And DownloadedUsersCount + DownloadedSubscriptionsCount > 0 Then If simple And (DownloadedUsersCount + DownloadedSubscriptionsCount) > 0 Then
Dim msg$ = String.Empty Dim msg$ = String.Empty
If DownloadedUsersCount > 0 Then msg = $"{DownloadedUsersCount} user(s) " If DownloadedUsersCount > 0 Then msg = $"{DownloadedUsersCount} user(s) "
If DownloadedSubscriptionsCount > 0 Then msg &= $"{IIf(DownloadedUsersCount > 0, "and ", String.Empty)}{DownloadedSubscriptionsCount} subscription(s) " If DownloadedSubscriptionsCount > 0 Then msg &= $"{IIf(DownloadedUsersCount > 0, "and ", String.Empty)}{DownloadedSubscriptionsCount} subscription(s) "
@@ -607,6 +666,8 @@ Namespace DownloadObjects
_Downloading = False _Downloading = False
_ForceStartRequested = False _ForceStartRequested = False
_LastDownloadDateSkip = Nothing _LastDownloadDateSkip = Nothing
If _StopRequested Then _Working = False
RaiseEvent PlanChanged(Me)
End Try End Try
End Sub End Sub
Private Sub ShowNotification(ByVal u As IUserData) Private Sub ShowNotification(ByVal u As IUserData)

View File

@@ -14,15 +14,19 @@ Imports PauseModes = SCrawler.DownloadObjects.AutoDownloader.PauseModes
Namespace DownloadObjects Namespace DownloadObjects
Friend Class Scheduler : Implements IEnumerable(Of AutoDownloader), IMyEnumerator(Of AutoDownloader), IDisposable Friend Class Scheduler : Implements IEnumerable(Of AutoDownloader), IMyEnumerator(Of AutoDownloader), IDisposable
Friend Const Name_Plan As String = "Plan" Friend Const Name_Plan As String = "Plan"
Friend Delegate Sub PlanChangedEventHandler(ByVal Plan As AutoDownloader)
Friend Event PauseChanged As AutoDownloader.PauseChangedEventHandler Friend Event PauseChanged As AutoDownloader.PauseChangedEventHandler
Private Sub OnPauseChanged(ByVal Value As PauseModes) Private Sub OnPauseChanged(ByVal Value As PauseModes)
RaiseEvent PauseChanged(Pause) RaiseEvent PauseChanged(Pause)
End Sub End Sub
Friend Event PlanChanged As PlanChangedEventHandler
Private Sub OnPlanChanged(ByVal Plan As AutoDownloader)
Try : RaiseEvent PlanChanged(Plan) : Catch : End Try
End Sub
Private ReadOnly Plans As List(Of AutoDownloader) Private ReadOnly Plans As List(Of AutoDownloader)
Friend Const FileNameDefault As String = "AutoDownload" Friend Const FileNameDefault As String = "AutoDownload"
Friend ReadOnly FileDefault As SFile = $"{SettingsFolderName}\{FileNameDefault}.xml" Friend ReadOnly FileDefault As SFile = $"{SettingsFolderName}\{FileNameDefault}.xml"
Friend File As SFile = Nothing Friend File As SFile = Nothing
Private ReadOnly PlanWorking As Predicate(Of AutoDownloader) = Function(Plan) Plan.Working
Private ReadOnly PlanDownloading As Predicate(Of AutoDownloader) = Function(Plan) Plan.Downloading Private ReadOnly PlanDownloading As Predicate(Of AutoDownloader) = Function(Plan) Plan.Downloading
Private ReadOnly PlansWaiter As Action(Of Predicate(Of AutoDownloader)) = Sub(ByVal Predicate As Predicate(Of AutoDownloader)) Private ReadOnly PlansWaiter As Action(Of Predicate(Of AutoDownloader)) = Sub(ByVal Predicate As Predicate(Of AutoDownloader))
While Plans.Exists(Predicate) : Thread.Sleep(200) : End While While Plans.Exists(Predicate) : Thread.Sleep(200) : End While
@@ -69,6 +73,7 @@ Namespace DownloadObjects
Friend Sub Add(ByVal Plan As AutoDownloader) Friend Sub Add(ByVal Plan As AutoDownloader)
Plan.Source = Me Plan.Source = Me
AddHandler Plan.PauseChanged, AddressOf OnPauseChanged AddHandler Plan.PauseChanged, AddressOf OnPauseChanged
AddHandler Plan.PlanChanged, AddressOf OnPlanChanged
Plans.Add(Plan) Plans.Add(Plan)
Plans.ListReindex Plans.ListReindex
Update() Update()
@@ -77,9 +82,9 @@ Namespace DownloadObjects
If Index.ValueBetween(0, Count - 1) Then If Index.ValueBetween(0, Count - 1) Then
With Plans(Index) With Plans(Index)
.Stop() .Stop()
If .Working Then If .Downloading Then
Await Task.Run(Sub() Await Task.Run(Sub()
While .Working : Thread.Sleep(510) : End While While .Downloading : Thread.Sleep(510) : End While
End Sub) End Sub)
End If End If
.Dispose() .Dispose()
@@ -103,10 +108,10 @@ Namespace DownloadObjects
End Try End Try
End Sub End Sub
Friend Function Reset(ByVal f As SFile, ByVal IsInit As Boolean) As Boolean Friend Function Reset(ByVal f As SFile, ByVal IsInit As Boolean) As Boolean
If Plans.Count > 0 Then If Count > 0 Then
If Not Plans.Exists(PlanWorking) Then If Not Plans.Exists(PlanDownloading) Then
Pause = PauseModes.Unlimited Pause = PauseModes.Unlimited
If Plans.Exists(PlanWorking) Then If Plans.Exists(PlanDownloading) Then
MsgBoxE({$"Some plans are already being worked.{vbCr}Wait for the plans to complete their work and try again.", MsgBoxE({$"Some plans are already being worked.{vbCr}Wait for the plans to complete their work and try again.",
"Change scheduler"}, vbCritical) "Change scheduler"}, vbCritical)
Pause = PauseModes.Unlimited Pause = PauseModes.Unlimited
@@ -114,6 +119,7 @@ Namespace DownloadObjects
End If End If
End If End If
[Stop]() [Stop]()
While Working : Thread.Sleep(200) : End While
If _UpdateRequired Then Update() If _UpdateRequired Then Update()
Plans.ListClearDispose(,, EDP.LogMessageValue) Plans.ListClearDispose(,, EDP.LogMessageValue)
End If End If
@@ -127,11 +133,12 @@ Namespace DownloadObjects
Plans.Add(New AutoDownloader(x)) Plans.Add(New AutoDownloader(x))
End If End If
End Using End Using
If Plans.Count > 0 Then Plans.ForEach(Sub(ByVal p As AutoDownloader) If Count > 0 Then Plans.ForEach(Sub(ByVal p As AutoDownloader)
p.Source = Me p.Source = Me
If Not IsInit Then p.Pause = PauseModes.Unlimited If Not IsInit Then p.Pause = PauseModes.Unlimited
AddHandler p.PauseChanged, AddressOf OnPauseChanged AddHandler p.PauseChanged, AddressOf OnPauseChanged
End Sub) : Plans.ListReindex AddHandler p.PlanChanged, AddressOf OnPlanChanged
End Sub) : Plans.ListReindex
End If End If
Return True Return True
End Function End Function
@@ -163,38 +170,94 @@ Namespace DownloadObjects
End Sub End Sub
#End Region #End Region
#Region "Execution" #Region "Execution"
Private AThread As Thread = Nothing
Private _StopRequested As Boolean = False
Friend ReadOnly Property Working As Boolean
Get
Return If(AThread?.IsAlive, False)
End Get
End Property
Friend Async Function Start(ByVal Init As Boolean) As Task Friend Async Function Start(ByVal Init As Boolean) As Task
Try Try
_StopRequested = False
Await Task.Run(Sub() Await Task.Run(Sub()
Dim r% = 0 Dim r% = 0
Do Do
r += 1 r += 1
Try Try
If Count > 0 Then If Count > 0 Then PlansWaiter(PlanDownloading) : Plans.ForEach(Sub(p) p.Start(Init))
If Plans.Exists(PlanDownloading) Then PlansWaiter(PlanDownloading)
For Each Plan In Plans
Plan.Start(Init)
PlansWaiter(PlanDownloading)
Thread.Sleep(1000)
Next
End If
Exit Do Exit Do
Catch io_ex As InvalidOperationException 'Collection was modified; enumeration operation may not execute Catch io_ex As InvalidOperationException 'Collection was modified; enumeration operation may not execute
End Try End Try
Loop While r < 10 Loop While r < 10
End Sub) End Sub)
If Not Working Then
AThread = New Thread(New ThreadStart(AddressOf Checker))
AThread.SetApartmentState(ApartmentState.MTA)
AThread.Start()
End If
Catch ex As Exception Catch ex As Exception
If Init Then If Init Then
ErrorsDescriber.Execute(EDP.SendToLog, ex, "Start automation") ErrorsDescriber.Execute(EDP.SendToLog, ex, "Start automation")
MainFrameObj.UpdateLogButton()
Else Else
Throw ex Throw ex
End If End If
End Try End Try
End Function End Function
Friend Sub [Stop]() Friend Sub [Stop]()
If Working Then _StopRequested = True
If Count > 0 Then Plans.ForEach(Sub(p) p.Stop()) If Count > 0 Then Plans.ForEach(Sub(p) p.Stop())
End Sub End Sub
Private Sub Checker()
Do
Try
If Count = 0 Or _StopRequested Then Exit Sub
PlansWaiter.Invoke(PlanDownloading)
Dim i% = Checker_GetNextPlanIndex()
If i >= 0 Then Checker_DownloadPlan(i)
Thread.Sleep(500)
Catch dex As ArgumentOutOfRangeException When disposedValue Or _StopRequested
Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[Scheduler.Checker]")
End Try
Loop While Not _StopRequested
_StopRequested = False
End Sub
Private Sub Checker_DownloadPlan(ByVal PlanIndex As Integer)
While Downloader.Working : Thread.Sleep(200) : End While
With Plans(PlanIndex)
If .Downloading Then
PlansWaiter.Invoke(PlanDownloading)
ElseIf .DownloadReady Then
.Download()
End If
End With
End Sub
Private Function Checker_GetNextPlanIndex() As Integer
Try
Dim result% = -1
Dim l As New List(Of KeyValuePair(Of Integer, Date))
Dim d As Date?
If Count > 0 Then
For i% = 0 To Count - 1
With Plans(i)
If .DownloadReady Then
d = .NextDate
If d.HasValue Then l.Add(New KeyValuePair(Of Integer, Date)(i, d.Value))
End If
End With
Next
End If
If l.Count > 0 Then
Dim md As Date = l.Min(Function(p) p.Value)
result = l.Find(Function(p) p.Value = md).Key
l.Clear()
End If
Return result
Catch
Return -1
End Try
End Function
Friend Property Pause(Optional ByVal LimitDate As Date? = Nothing) As PauseModes Friend Property Pause(Optional ByVal LimitDate As Date? = Nothing) As PauseModes
Get Get
If Count > 0 Then Return Plans.FirstOrDefault(Function(p) p.Pause >= PauseModes.Disabled).Pause Else Return PauseModes.Disabled If Count > 0 Then Return Plans.FirstOrDefault(Function(p) p.Pause >= PauseModes.Disabled).Pause Else Return PauseModes.Disabled
@@ -218,7 +281,8 @@ Namespace DownloadObjects
If Not disposedValue Then If Not disposedValue Then
If disposing Then If disposing Then
[Stop]() [Stop]()
If Plans.Exists(PlanWorking) Then Task.WaitAll(Task.Run(Sub() PlansWaiter(PlanWorking))) If Plans.Exists(PlanDownloading) Then Task.WaitAll(Task.Run(Sub() PlansWaiter(PlanDownloading)))
While Working : Thread.Sleep(200) : End While
If _UpdateRequired Then Update() If _UpdateRequired Then Update()
Plans.ListClearDispose Plans.ListClearDispose
End If End If

View File

@@ -23,7 +23,8 @@ Namespace DownloadObjects
<System.Diagnostics.DebuggerStepThrough()> <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
Me.LIST_PLANS = New System.Windows.Forms.ListBox() Me.LIST_PLANS = New System.Windows.Forms.ListView()
Me.COL_MAIN = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer() CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
CONTAINER_MAIN.ContentPanel.SuspendLayout() CONTAINER_MAIN.ContentPanel.SuspendLayout()
CONTAINER_MAIN.SuspendLayout() CONTAINER_MAIN.SuspendLayout()
@@ -47,12 +48,25 @@ Namespace DownloadObjects
' '
'LIST_PLANS 'LIST_PLANS
' '
Me.LIST_PLANS.Alignment = System.Windows.Forms.ListViewAlignment.Left
Me.LIST_PLANS.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.COL_MAIN})
Me.LIST_PLANS.Dock = System.Windows.Forms.DockStyle.Fill Me.LIST_PLANS.Dock = System.Windows.Forms.DockStyle.Fill
Me.LIST_PLANS.FormattingEnabled = True Me.LIST_PLANS.FullRowSelect = True
Me.LIST_PLANS.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None
Me.LIST_PLANS.HideSelection = False
Me.LIST_PLANS.Location = New System.Drawing.Point(0, 0) Me.LIST_PLANS.Location = New System.Drawing.Point(0, 0)
Me.LIST_PLANS.MultiSelect = False
Me.LIST_PLANS.Name = "LIST_PLANS" Me.LIST_PLANS.Name = "LIST_PLANS"
Me.LIST_PLANS.ShowGroups = False
Me.LIST_PLANS.Size = New System.Drawing.Size(414, 316) Me.LIST_PLANS.Size = New System.Drawing.Size(414, 316)
Me.LIST_PLANS.TabIndex = 0 Me.LIST_PLANS.TabIndex = 0
Me.LIST_PLANS.UseCompatibleStateImageBehavior = False
Me.LIST_PLANS.View = System.Windows.Forms.View.Details
'
'COL_MAIN
'
Me.COL_MAIN.Text = "Task"
Me.COL_MAIN.Width = 410
' '
'SchedulerEditorForm 'SchedulerEditorForm
' '
@@ -63,7 +77,6 @@ Namespace DownloadObjects
Me.KeyPreview = True Me.KeyPreview = True
Me.MinimumSize = New System.Drawing.Size(430, 380) Me.MinimumSize = New System.Drawing.Size(430, 380)
Me.Name = "SchedulerEditorForm" Me.Name = "SchedulerEditorForm"
Me.ShowIcon = True
Me.ShowInTaskbar = False Me.ShowInTaskbar = False
Me.Text = "Scheduler" Me.Text = "Scheduler"
CONTAINER_MAIN.ContentPanel.ResumeLayout(False) CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
@@ -72,6 +85,7 @@ Namespace DownloadObjects
Me.ResumeLayout(False) Me.ResumeLayout(False)
End Sub End Sub
Private WithEvents LIST_PLANS As ListBox Private WithEvents LIST_PLANS As ListView
Private WithEvents COL_MAIN As ColumnHeader
End Class End Class
End Namespace End Namespace

View File

@@ -6,6 +6,8 @@
' '
' This program is distributed in the hope that it will be useful, ' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY ' but WITHOUT ANY WARRANTY
Imports System.Threading
Imports System.ComponentModel
Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Toolbars Imports PersonalUtilities.Forms.Toolbars
Imports PersonalUtilities.Forms.Controls.Base Imports PersonalUtilities.Forms.Controls.Base
@@ -131,6 +133,16 @@ Namespace DownloadObjects
SetTitle() SetTitle()
.EndLoaderOperations(False) .EndLoaderOperations(False)
End With End With
SchedulerCheckerThread = New Thread(New ThreadStart(AddressOf SchedulerChecker))
SchedulerCheckerThread.SetApartmentState(ApartmentState.MTA)
SchedulerCheckerThread.Start()
Try : AddHandler Settings.Automation.PlanChanged, AddressOf Scheduler_PauseChanged : Catch : End Try
End Sub
Private _CloseRequested As Boolean = False
Private Sub SchedulerEditorForm_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
_CloseRequested = True
While If(SchedulerCheckerThread?.IsAlive, False) : Thread.Sleep(200) : End While
Try : RemoveHandler Settings.Automation.PlanChanged, AddressOf Scheduler_PauseChanged : Catch : End Try
End Sub End Sub
Private Sub SchedulerEditorForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown Private Sub SchedulerEditorForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.Escape Then If e.KeyCode = Keys.Escape Then
@@ -143,21 +155,48 @@ Namespace DownloadObjects
Private Sub SchedulerEditorForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed Private Sub SchedulerEditorForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
PauseArr.Dispose() PauseArr.Dispose()
End Sub End Sub
Private Sub SchedulerEditorForm_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged
Try : ControlInvokeFast(LIST_PLANS, Sub()
COL_MAIN.Width = -2
LIST_PLANS.Refresh()
End Sub, EDP.None) : Catch : End Try
End Sub
#End Region #End Region
Private Property ListSelectedIndex As Integer
Get
Return If(LIST_PLANS.SelectedIndices.Count > 0, LIST_PLANS.SelectedIndices(0), -1)
End Get
Set(ByVal indx As Integer)
Try : ControlInvokeFast(LIST_PLANS, Sub()
With LIST_PLANS
.SelectedItems.Clear()
.Items(indx).Selected = True
.FocusedItem = .Items(indx)
.Refresh()
.EnsureVisible(indx)
End With
End Sub, EDP.None) : Catch : End Try
End Set
End Property
Private _RefillInProgress As Boolean = False Private _RefillInProgress As Boolean = False
Private Sub Refill() Handles MyDefs.ButtonUpdateClick Private Sub Refill() Handles MyDefs.ButtonUpdateClick
Try Try
If Not _RefillInProgress Then ControlInvokeFast(LIST_PLANS,
_RefillInProgress = True Sub()
LIST_PLANS.Items.Clear() If Not _RefillInProgress Then
If Settings.Automation.Count > 0 Then _RefillInProgress = True
LIST_PLANS.Items.AddRange(Settings.Automation.Select(Function(a) a.ToString()).Cast(Of Object).ToArray) With LIST_PLANS.Items
If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then LIST_PLANS.SelectedIndex = _LatestSelected .Clear()
Else If Settings.Automation.Count > 0 Then
_LatestSelected = -1 .AddRange(Settings.Automation.Select(Function(a) a.LVI).ToArray)
If _LatestSelected.ValueBetween(0, .Count - 1) Then ListSelectedIndex = _LatestSelected
Else
_LatestSelected = -1
End If
End With
_RefillInProgress = False
End If End If
_RefillInProgress = False End Sub)
End If
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[DownloadObjects.SchedulerEditorForm.Refill]") ErrorsDescriber.Execute(EDP.SendToLog, ex, "[DownloadObjects.SchedulerEditorForm.Refill]")
End Try End Try
@@ -196,7 +235,7 @@ Namespace DownloadObjects
Private Sub Edit() Handles MyDefs.ButtonEditClick Private Sub Edit() Handles MyDefs.ButtonEditClick
If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then
Using f As New AutoDownloaderEditorForm(Settings.Automation(_LatestSelected)) : f.ShowDialog() : End Using Using f As New AutoDownloaderEditorForm(Settings.Automation(_LatestSelected)) : f.ShowDialog() : End Using
Refill() LIST_PLANS_Refresh(_LatestSelected)
Else Else
MsgBoxE("You have not selected a plan to edit.", vbExclamation) MsgBoxE("You have not selected a plan to edit.", vbExclamation)
End If End If
@@ -224,14 +263,59 @@ Namespace DownloadObjects
#End Region #End Region
#Region "List handlers" #Region "List handlers"
Private _LatestSelected As Integer = -1 Private _LatestSelected As Integer = -1
Private _LatestSelectedChangeEnabled As Boolean = True
Private Sub LIST_PLANS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LIST_PLANS.SelectedIndexChanged Private Sub LIST_PLANS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles LIST_PLANS.SelectedIndexChanged
_LatestSelected = LIST_PLANS.SelectedIndex If _LatestSelectedChangeEnabled Then
PauseArr.PlanIndex = _LatestSelected _LatestSelected = ListSelectedIndex
PauseArr.UpdatePauseButtons(False) PauseArr.PlanIndex = _LatestSelected
PauseArr.UpdatePauseButtons(False)
End If
End Sub End Sub
Private Sub LIST_PLANS_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles LIST_PLANS.MouseDoubleClick Private Sub LIST_PLANS_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles LIST_PLANS.MouseDoubleClick
Edit() Edit()
End Sub End Sub
Private Sub LIST_PLANS_Refresh(Optional ByVal PlanIndex As Integer = -1)
_LatestSelectedChangeEnabled = False
Try
ControlInvokeFast(LIST_PLANS,
Sub()
Dim indx% = If(PlanIndex >= 0, PlanIndex, ListSelectedIndex)
If indx = -1 And PlanIndex = -1 Then indx = _LatestSelected
If indx.ValueBetween(0, Settings.Automation.Count - 1) Then _
LIST_PLANS.Items(indx) = Settings.Automation(indx).LVI
If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then ListSelectedIndex = _LatestSelected
End Sub, EDP.None)
Catch
Finally
_LatestSelectedChangeEnabled = True
End Try
End Sub
Private Sub Scheduler_PauseChanged(ByVal Plan As AutoDownloader)
LIST_PLANS_Refresh(Plan.Index)
End Sub
Private SchedulerCheckerThread As Thread
Private Sub SchedulerChecker()
Try
While Not _CloseRequested
Try
With Settings.Automation
If .Count > 0 Then
For i% = 0 To .Count - 1
If .Item(i).LVIStateChanged Then LIST_PLANS_Refresh(i)
If _CloseRequested Then Exit Sub
Thread.Sleep(200)
Next
Else
If _CloseRequested Then Exit Sub
Thread.Sleep(200)
End If
End With
Catch
End Try
End While
Catch
End Try
End Sub
#End Region #End Region
#Region "Settings, Start, Skip, Pause" #Region "Settings, Start, Skip, Pause"
Private Function GetSchedulerFiles() As List(Of SFile) Private Function GetSchedulerFiles() As List(Of SFile)
@@ -372,13 +456,13 @@ Namespace DownloadObjects
Private Sub BTT_START_Click(sender As Object, e As EventArgs) Handles BTT_START.Click Private Sub BTT_START_Click(sender As Object, e As EventArgs) Handles BTT_START.Click
If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then
With Settings.Automation(_LatestSelected) : .Start(.IsNewPlan) : End With With Settings.Automation(_LatestSelected) : .Start(.IsNewPlan) : End With
Refill() LIST_PLANS_Refresh(_LatestSelected)
End If End If
End Sub End Sub
Private Sub BTT_START_FORCE_Click(sender As Object, e As EventArgs) Handles BTT_START_FORCE.Click Private Sub BTT_START_FORCE_Click(sender As Object, e As EventArgs) Handles BTT_START_FORCE.Click
If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then
With Settings.Automation(_LatestSelected) With Settings.Automation(_LatestSelected)
If .Working Or .IsManual Then .ForceStart() : Refill() If .Working Or .IsManual Then .ForceStart() : LIST_PLANS_Refresh(_LatestSelected)
End With End With
End If End If
End Sub End Sub
@@ -388,10 +472,10 @@ Namespace DownloadObjects
Select Case mode Select Case mode
Case String.Empty Case String.Empty
Settings.Automation(_LatestSelected).Skip() Settings.Automation(_LatestSelected).Skip()
Refill() LIST_PLANS_Refresh(_LatestSelected)
Case "m" Case "m"
Dim mins% = AConvert(Of Integer)(InputBoxE("Enter a number of minutes you want to delay:", Sender.Text, 60), -1) Dim mins% = AConvert(Of Integer)(InputBoxE("Enter a number of minutes you want to delay:", Sender.Text, 60), -1)
If mins > 0 Then Settings.Automation(_LatestSelected).Skip(mins) : Refill() If mins > 0 Then Settings.Automation(_LatestSelected).Skip(mins) : LIST_PLANS_Refresh(_LatestSelected)
Case "d" Case "d"
Dim d As Date? = Nothing Dim d As Date? = Nothing
Using f As New DateTimeSelectionForm(DateTimeSelectionForm.Modes.Date + Using f As New DateTimeSelectionForm(DateTimeSelectionForm.Modes.Date +
@@ -402,16 +486,13 @@ Namespace DownloadObjects
f.ShowDialog() f.ShowDialog()
If f.DialogResult = DialogResult.OK Then d = f.MyDateStart If f.DialogResult = DialogResult.OK Then d = f.MyDateStart
End Using End Using
If d.HasValue Then Settings.Automation(_LatestSelected).Skip(d.Value) : Refill() If d.HasValue Then Settings.Automation(_LatestSelected).Skip(d.Value) : LIST_PLANS_Refresh(_LatestSelected)
Case "r" Case "r"
Settings.Automation(_LatestSelected).SkipReset() Settings.Automation(_LatestSelected).SkipReset()
Refill() LIST_PLANS_Refresh(_LatestSelected)
End Select End Select
End If End If
End Sub End Sub
Private Sub PauseArr_Updating() Handles PauseArr.Updating
Refill()
End Sub
#End Region #End Region
#Region "Move" #Region "Move"
Private Sub BTT_MOVE_UP_DOWN_Click(sender As Object, e As EventArgs) Handles BTT_MOVE_UP.Click, BTT_MOVE_DOWN.Click Private Sub BTT_MOVE_UP_DOWN_Click(sender As Object, e As EventArgs) Handles BTT_MOVE_UP.Click, BTT_MOVE_DOWN.Click

View File

@@ -62,14 +62,15 @@ Namespace DownloadObjects
Me.BTT_MERGE_FEEDS = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_MERGE_FEEDS = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CHECK_ALL = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CHECK_ALL = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CHECK_NONE = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CHECK_NONE = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_VIEW_SAVE = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_VIEW_LOAD = New System.Windows.Forms.ToolStripMenuItem()
Me.SEP_0 = New System.Windows.Forms.ToolStripSeparator() Me.SEP_0 = New System.Windows.Forms.ToolStripSeparator()
Me.MENU_DOWN = New System.Windows.Forms.ToolStripDropDownButton() Me.MENU_DOWN = New System.Windows.Forms.ToolStripDropDownButton()
Me.BTT_DOWN_ALL = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_DOWN_ALL = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_DOWN_SELECTED = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_DOWN_SELECTED = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_REFRESH = New System.Windows.Forms.ToolStripButton() Me.BTT_REFRESH = New System.Windows.Forms.ToolStripButton()
Me.TP_DATA = New System.Windows.Forms.TableLayoutPanel() Me.TP_DATA = New System.Windows.Forms.TableLayoutPanel()
Me.BTT_VIEW_SAVE = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CURR_SESSION_SET = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_VIEW_LOAD = New System.Windows.Forms.ToolStripMenuItem()
SEP_1 = New System.Windows.Forms.ToolStripSeparator() SEP_1 = New System.Windows.Forms.ToolStripSeparator()
SEP_2 = New System.Windows.Forms.ToolStripSeparator() SEP_2 = New System.Windows.Forms.ToolStripSeparator()
MENU_VIEW = New System.Windows.Forms.ToolStripDropDownButton() MENU_VIEW = New System.Windows.Forms.ToolStripDropDownButton()
@@ -157,6 +158,11 @@ Namespace DownloadObjects
MENU_LOAD_SEP_0.Name = "MENU_LOAD_SEP_0" MENU_LOAD_SEP_0.Name = "MENU_LOAD_SEP_0"
MENU_LOAD_SEP_0.Size = New System.Drawing.Size(349, 6) MENU_LOAD_SEP_0.Size = New System.Drawing.Size(349, 6)
' '
'MENU_LOAD_SEP_8
'
MENU_LOAD_SEP_8.Name = "MENU_LOAD_SEP_8"
MENU_LOAD_SEP_8.Size = New System.Drawing.Size(349, 6)
'
'ToolbarTOP 'ToolbarTOP
' '
Me.ToolbarTOP.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden Me.ToolbarTOP.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden
@@ -170,7 +176,7 @@ Namespace DownloadObjects
' '
Me.MENU_LOAD_SESSION.AutoToolTip = False Me.MENU_LOAD_SESSION.AutoToolTip = False
Me.MENU_LOAD_SESSION.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image Me.MENU_LOAD_SESSION.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.MENU_LOAD_SESSION.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_LOAD_SESSION_CURRENT, Me.BTT_LOAD_SESSION_LAST, Me.BTT_LOAD_SESSION_CHOOSE, MENU_LOAD_SEP_0, Me.BTT_COPY_TO, Me.BTT_MOVE_TO, MENU_LOAD_SEP_1, Me.BTT_LOAD_FAV, Me.BTT_LOAD_SPEC, MENU_LOAD_SEP_2, Me.BTT_FEED_ADD_FAV, Me.BTT_FEED_ADD_FAV_REMOVE, Me.BTT_FEED_REMOVE_FAV, MENU_LOAD_SEP_3, Me.BTT_FEED_ADD_SPEC, Me.BTT_FEED_ADD_SPEC_REMOVE, Me.BTT_FEED_REMOVE_SPEC, MENU_LOAD_SEP_4, Me.BTT_FEED_CLEAR_FAV, Me.BTT_FEED_CLEAR_SPEC, Me.BTT_FEED_DELETE_SPEC, Me.BTT_FEED_DELETE_DAILY_LIST, Me.BTT_FEED_DELETE_DAILY_DATE, MENU_LOAD_SEP_5, Me.BTT_MERGE_SESSIONS, Me.BTT_CLEAR_DAILY, MENU_LOAD_SEP_6, Me.BTT_MERGE_FEEDS, MENU_LOAD_SEP_7, Me.BTT_CHECK_ALL, Me.BTT_CHECK_NONE, MENU_LOAD_SEP_8, Me.BTT_VIEW_SAVE, Me.BTT_VIEW_LOAD}) Me.MENU_LOAD_SESSION.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_LOAD_SESSION_CURRENT, Me.BTT_LOAD_SESSION_LAST, Me.BTT_LOAD_SESSION_CHOOSE, MENU_LOAD_SEP_0, Me.BTT_COPY_TO, Me.BTT_MOVE_TO, MENU_LOAD_SEP_1, Me.BTT_LOAD_FAV, Me.BTT_LOAD_SPEC, MENU_LOAD_SEP_2, Me.BTT_FEED_ADD_FAV, Me.BTT_FEED_ADD_FAV_REMOVE, Me.BTT_FEED_REMOVE_FAV, MENU_LOAD_SEP_3, Me.BTT_FEED_ADD_SPEC, Me.BTT_FEED_ADD_SPEC_REMOVE, Me.BTT_FEED_REMOVE_SPEC, MENU_LOAD_SEP_4, Me.BTT_FEED_CLEAR_FAV, Me.BTT_FEED_CLEAR_SPEC, Me.BTT_FEED_DELETE_SPEC, Me.BTT_FEED_DELETE_DAILY_LIST, Me.BTT_FEED_DELETE_DAILY_DATE, MENU_LOAD_SEP_5, Me.BTT_CURR_SESSION_SET, Me.BTT_MERGE_SESSIONS, Me.BTT_CLEAR_DAILY, MENU_LOAD_SEP_6, Me.BTT_MERGE_FEEDS, MENU_LOAD_SEP_7, Me.BTT_CHECK_ALL, Me.BTT_CHECK_NONE, MENU_LOAD_SEP_8, Me.BTT_VIEW_SAVE, Me.BTT_VIEW_LOAD})
Me.MENU_LOAD_SESSION.Image = Global.SCrawler.My.Resources.Resources.ArrowDownPic_Blue_24 Me.MENU_LOAD_SESSION.Image = Global.SCrawler.My.Resources.Resources.ArrowDownPic_Blue_24
Me.MENU_LOAD_SESSION.ImageTransparentColor = System.Drawing.Color.Magenta Me.MENU_LOAD_SESSION.ImageTransparentColor = System.Drawing.Color.Magenta
Me.MENU_LOAD_SESSION.Name = "MENU_LOAD_SESSION" Me.MENU_LOAD_SESSION.Name = "MENU_LOAD_SESSION"
@@ -343,6 +349,20 @@ Namespace DownloadObjects
Me.BTT_CHECK_NONE.Size = New System.Drawing.Size(352, 22) Me.BTT_CHECK_NONE.Size = New System.Drawing.Size(352, 22)
Me.BTT_CHECK_NONE.Text = "Select none" Me.BTT_CHECK_NONE.Text = "Select none"
' '
'BTT_VIEW_SAVE
'
Me.BTT_VIEW_SAVE.Name = "BTT_VIEW_SAVE"
Me.BTT_VIEW_SAVE.Size = New System.Drawing.Size(352, 22)
Me.BTT_VIEW_SAVE.Text = "Save current view"
'
'BTT_VIEW_LOAD
'
Me.BTT_VIEW_LOAD.AutoToolTip = True
Me.BTT_VIEW_LOAD.Name = "BTT_VIEW_LOAD"
Me.BTT_VIEW_LOAD.Size = New System.Drawing.Size(352, 22)
Me.BTT_VIEW_LOAD.Text = "Load view (from saved)"
Me.BTT_VIEW_LOAD.ToolTipText = "Load one of your previously saved views"
'
'SEP_0 'SEP_0
' '
Me.SEP_0.Name = "SEP_0" Me.SEP_0.Name = "SEP_0"
@@ -409,24 +429,14 @@ Namespace DownloadObjects
Me.TP_DATA.Size = New System.Drawing.Size(484, 436) Me.TP_DATA.Size = New System.Drawing.Size(484, 436)
Me.TP_DATA.TabIndex = 1 Me.TP_DATA.TabIndex = 1
' '
'MENU_LOAD_SEP_8 'BTT_CURR_SESSION_SET
' '
MENU_LOAD_SEP_8.Name = "MENU_LOAD_SEP_8" Me.BTT_CURR_SESSION_SET.AutoToolTip = True
MENU_LOAD_SEP_8.Size = New System.Drawing.Size(349, 6) Me.BTT_CURR_SESSION_SET.Image = Global.SCrawler.My.Resources.Resources.ArrowDownPic_Blue_24
' Me.BTT_CURR_SESSION_SET.Name = "BTT_CURR_SESSION_SET"
'BTT_VIEW_SAVE Me.BTT_CURR_SESSION_SET.Size = New System.Drawing.Size(352, 22)
' Me.BTT_CURR_SESSION_SET.Text = "Set current session..."
Me.BTT_VIEW_SAVE.Name = "BTT_VIEW_SAVE" Me.BTT_CURR_SESSION_SET.ToolTipText = "Select one of the download sessions and set it as the current session"
Me.BTT_VIEW_SAVE.Size = New System.Drawing.Size(352, 22)
Me.BTT_VIEW_SAVE.Text = "Save current view"
'
'BTT_VIEW_LOAD
'
Me.BTT_VIEW_LOAD.AutoToolTip = True
Me.BTT_VIEW_LOAD.Name = "BTT_VIEW_LOAD"
Me.BTT_VIEW_LOAD.Size = New System.Drawing.Size(352, 22)
Me.BTT_VIEW_LOAD.Text = "Load view (from saved)"
Me.BTT_VIEW_LOAD.ToolTipText = "Load one of your previously saved views"
' '
'DownloadFeedForm 'DownloadFeedForm
' '
@@ -483,5 +493,6 @@ Namespace DownloadObjects
Private WithEvents BTT_MOVE_TO As ToolStripMenuItem Private WithEvents BTT_MOVE_TO As ToolStripMenuItem
Private WithEvents BTT_VIEW_SAVE As ToolStripMenuItem Private WithEvents BTT_VIEW_SAVE As ToolStripMenuItem
Private WithEvents BTT_VIEW_LOAD As ToolStripMenuItem Private WithEvents BTT_VIEW_LOAD As ToolStripMenuItem
Private WithEvents BTT_CURR_SESSION_SET As ToolStripMenuItem
End Class End Class
End Namespace End Namespace

View File

@@ -159,10 +159,10 @@
<metadata name="MENU_LOAD_SEP_0.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="MENU_LOAD_SEP_0.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </metadata>
<metadata name="ToolbarTOP.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="MENU_LOAD_SEP_8.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="MENU_LOAD_SEP_8.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </metadata>
<metadata name="ToolbarTOP.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>

View File

@@ -276,7 +276,6 @@ Namespace DownloadObjects
End With End With
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "Feed removed") ErrorsDescriber.Execute(EDP.SendToLog, ex, "Feed removed")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
Private Sub Feed_SPEC_LOAD(ByVal Source As ToolStripMenuItem, ByVal e As EventArgs) Private Sub Feed_SPEC_LOAD(ByVal Source As ToolStripMenuItem, ByVal e As EventArgs)
@@ -440,7 +439,9 @@ Namespace DownloadObjects
End Sub End Sub
Private Sub SessionChooser(ByVal GetLast As Boolean, Optional ByVal GetFilesOnly As Boolean = False, Private Sub SessionChooser(ByVal GetLast As Boolean, Optional ByVal GetFilesOnly As Boolean = False,
Optional ByRef ResultFilesList As List(Of SFile) = Nothing, Optional ByRef ResultFilesList As List(Of SFile) = Nothing,
Optional ByVal SelectedMode As FeedModes = -1) Optional ByVal SelectedMode As FeedModes = -1,
Optional ByVal GetSessionFile As Boolean = False,
Optional ByRef SessionFile As SFile = Nothing)
Try Try
LoadedSessionName = String.Empty LoadedSessionName = String.Empty
Downloader.ClearSessions() Downloader.ClearSessions()
@@ -475,6 +476,12 @@ Namespace DownloadObjects
If fList.ListExists Then If fList.ListExists Then
If GetFilesOnly Then If GetFilesOnly Then
ResultFilesList.AddRange(fList) ResultFilesList.AddRange(fList)
ElseIf GetSessionFile Then
If fList.Count > 1 Then
MsgBoxE({"You must select one session file", "Get session file"}, vbExclamation)
Else
SessionFile = fList(0)
End If
Else Else
DataList.Clear() DataList.Clear()
If SelectedMode >= 0 Then If SelectedMode >= 0 Then
@@ -861,7 +868,6 @@ Namespace DownloadObjects
End If End If
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "Delete daily sessions (by list)") ErrorsDescriber.Execute(EDP.SendToLog, ex, "Delete daily sessions (by list)")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
Private Sub BTT_FEED_DELETE_DAILY_DATE_Click(sender As Object, e As EventArgs) Handles BTT_FEED_DELETE_DAILY_DATE.Click Private Sub BTT_FEED_DELETE_DAILY_DATE_Click(sender As Object, e As EventArgs) Handles BTT_FEED_DELETE_DAILY_DATE.Click
@@ -899,20 +905,23 @@ Namespace DownloadObjects
End Using End Using
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "Delete daily sessions (by date)") ErrorsDescriber.Execute(EDP.SendToLog, ex, "Delete daily sessions (by date)")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
#End Region #End Region
#Region "Clear session" #Region "Sessions set, merge, clear"
Private Sub BTT_CLEAR_DAILY_Click(sender As Object, e As EventArgs) Handles BTT_CLEAR_DAILY.Click Private Sub BTT_CURR_SESSION_SET_Click(sender As Object, e As EventArgs) Handles BTT_CURR_SESSION_SET.Click
If MsgBoxE({"Are you sure you want to clear this session data?", "Clear session"}, vbExclamation,,, {"Process", "Cancel"}) = 0 Then Try
Downloader.Files.Clear() Dim f As SFile = Nothing
ClearTable() SessionChooser(False,,,, True, f)
RefillList() If Not f.IsEmptyString AndAlso f.Exists Then
End If Downloader.FilesLoadLastSession(f)
FeedChangeMode(FeedModes.Current)
RefillList(True, False)
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Replace current session")
End Try
End Sub End Sub
#End Region
#Region "Merge feeds"
Private Sub BTT_MERGE_SESSIONS_Click(sender As Object, e As EventArgs) Handles BTT_MERGE_SESSIONS.Click Private Sub BTT_MERGE_SESSIONS_Click(sender As Object, e As EventArgs) Handles BTT_MERGE_SESSIONS.Click
Try Try
Const msgTitle$ = "Merge feeds" Const msgTitle$ = "Merge feeds"
@@ -973,6 +982,15 @@ Namespace DownloadObjects
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[DownloadFeedForm.MergeSessions]") ErrorsDescriber.Execute(EDP.SendToLog, ex, "[DownloadFeedForm.MergeSessions]")
End Try End Try
End Sub End Sub
Private Sub BTT_CLEAR_DAILY_Click(sender As Object, e As EventArgs) Handles BTT_CLEAR_DAILY.Click
If MsgBoxE({"Are you sure you want to clear this session data?", "Clear session"}, vbExclamation,,, {"Process", "Cancel"}) = 0 Then
Downloader.Files.Clear()
ClearTable()
RefillList()
End If
End Sub
#End Region
#Region "Merge feeds"
Private Sub BTT_MERGE_FEEDS_Click(sender As Object, e As EventArgs) Handles BTT_MERGE_FEEDS.Click Private Sub BTT_MERGE_FEEDS_Click(sender As Object, e As EventArgs) Handles BTT_MERGE_FEEDS.Click
Try Try
Const msgTitle$ = "Merge feeds" Const msgTitle$ = "Merge feeds"

View File

@@ -139,7 +139,6 @@ Namespace DownloadObjects
End If End If
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[FeedSpecial.UpdateUsers]") ErrorsDescriber.Execute(EDP.SendToLog, ex, "[FeedSpecial.UpdateUsers]")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
Friend Overloads Shared Function UpdateUsers(ByVal Item As UserMediaD, ByVal InitialUser As UserInfo, ByVal NewUser As UserInfo, Friend Overloads Shared Function UpdateUsers(ByVal Item As UserMediaD, ByVal InitialUser As UserInfo, ByVal NewUser As UserInfo,

View File

@@ -111,7 +111,6 @@ Namespace DownloadObjects
End If End If
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[FeedSpecialCollection.Load]") ErrorsDescriber.Execute(EDP.SendToLog, ex, "[FeedSpecialCollection.Load]")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
Private Sub Feeds_FeedDeleted(ByVal Source As FeedSpecialCollection, ByVal Feed As FeedSpecial) Private Sub Feeds_FeedDeleted(ByVal Source As FeedSpecialCollection, ByVal Feed As FeedSpecial)
@@ -245,7 +244,6 @@ Namespace DownloadObjects
End If End If
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[FeedSpecialCollection.UpdateUsers]") ErrorsDescriber.Execute(EDP.SendToLog, ex, "[FeedSpecialCollection.UpdateUsers]")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
#End Region #End Region

View File

@@ -93,7 +93,6 @@ Namespace DownloadObjects.STDownloader
End With End With
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[STDownloader.DownloaderUrlForm.TXT_URL_ActionOnTextChanged]") ErrorsDescriber.Execute(EDP.SendToLog, ex, "[STDownloader.DownloaderUrlForm.TXT_URL_ActionOnTextChanged]")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
Private Sub TXT_PATH_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As ActionButtonEventArgs) Handles TXT_PATH.ActionOnButtonClick Private Sub TXT_PATH_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As ActionButtonEventArgs) Handles TXT_PATH.ActionOnButtonClick

View File

@@ -108,7 +108,6 @@ Namespace DownloadObjects.STDownloader
Catch ex As Exception Catch ex As Exception
_UseAccountName = True _UseAccountName = True
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[STDownloader.DownloaderUrlsArrForm.TXT_URLS_TextChanged]") ErrorsDescriber.Execute(EDP.SendToLog, ex, "[STDownloader.DownloaderUrlsArrForm.TXT_URLS_TextChanged]")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
End Class End Class

View File

@@ -226,9 +226,5 @@ Namespace DownloadObjects.STDownloader
RemoveControls(ControlNonYT, False) RemoveControls(ControlNonYT, False)
End If End If
End Sub End Sub
Protected Overrides Sub MyJob_Finished(ByVal Sender As Object, ByVal e As EventArgs)
MainFrameObj.UpdateLogButton()
MyBase.MyJob_Finished(Sender, e)
End Sub
End Class End Class
End Namespace End Namespace

View File

@@ -149,29 +149,35 @@ Namespace DownloadObjects
End Try End Try
End Function End Function
Private _FilesSessionChecked_Impl As Boolean = False Private _FilesSessionChecked_Impl As Boolean = False
Friend Sub FilesLoadLastSession() Friend Sub FilesLoadLastSession(Optional ByVal SelectedSessionFile As SFile = Nothing)
Try Try
If Not _FilesSessionChecked And Not _FilesSessionChecked_Impl And _FilesSessionActual.IsEmptyString Then If Not SelectedSessionFile.IsEmptyString Or (Not _FilesSessionChecked And Not _FilesSessionChecked_Impl And _FilesSessionActual.IsEmptyString) Then
_FilesSessionChecked = True _FilesSessionChecked = True
_FilesSessionChecked_Impl = True _FilesSessionChecked_Impl = True
Dim settingValue% = Settings.FeedCurrentTryLoadLastSession Dim settingValue% = Settings.FeedCurrentTryLoadLastSession
If settingValue >= 0 Then Dim ssfExists As Boolean = Not SelectedSessionFile.IsEmptyString AndAlso SelectedSessionFile.Exists
If settingValue >= 0 Or ssfExists Then
Dim startTime As Date = Process.GetCurrentProcess.StartTime Dim startTime As Date = Process.GetCurrentProcess.StartTime
Dim files As List(Of SFile) = SFile.GetFiles(SessionsPath.CSFileP, "*.xml",, EDP.ReturnValue) Dim files As List(Of SFile)
If files.ListExists Then files.RemoveAll(Settings.Feeds.FeedSpecialRemover) If ssfExists Then
If files.ListExists Then files = New List(Of SFile) From {SelectedSessionFile}
Dim nd$ = Now.ToString("yyyyMMdd") Else
files.RemoveAll(Function(f) Not f.Name.StartsWith(nd)) files = SFile.GetFiles(SessionsPath.CSFileP, "*.xml",, EDP.ReturnValue)
If files.ListExists Then files.RemoveAll(Settings.Feeds.FeedSpecialRemover)
If files.ListExists Then
Dim nd$ = Now.ToString("yyyyMMdd")
files.RemoveAll(Function(f) Not f.Name.StartsWith(nd))
End If
End If End If
If files.ListExists Then If files.ListExists Then
files.Sort() files.Sort()
Dim lastDate As Date = AConvert(Of Date)(files.Last.Name, SessionDateTimeProvider) Dim lastDate As Date = AConvert(Of Date)(files.Last.Name, SessionDateTimeProvider)
If lastDate.Date = startTime.Date Then If ssfExists Or lastDate.Date = startTime.Date Then
Dim __files As New List(Of UserMediaD) Dim __files As New List(Of UserMediaD)
Using x As New XmlFile(files.Last, Protector.Modes.All, False) With {.AllowSameNames = True, .XmlReadOnly = True} Using x As New XmlFile(files.Last, Protector.Modes.All, False) With {.AllowSameNames = True, .XmlReadOnly = True}
x.LoadData() x.LoadData()
If x.Count > 0 Then __files.ListAddList(x, LAP.IgnoreICopier) If x.Count > 0 Then __files.ListAddList(x, LAP.IgnoreICopier)
If __files.Count > 0 AndAlso (settingValue = 0 OrElse If __files.Count > 0 AndAlso (settingValue = 0 OrElse ssfExists OrElse
(startTime - {lastDate, __files.Max(Function(f) f.Date)}.Max).TotalMinutes <= settingValue) Then (startTime - {lastDate, __files.Max(Function(f) f.Date)}.Max).TotalMinutes <= settingValue) Then
_Session = __files.Max(Function(f) f.Session) _Session = __files.Max(Function(f) f.Session)
Me.Files.AddRange(__files) Me.Files.AddRange(__files)
@@ -228,7 +234,6 @@ Namespace DownloadObjects
Catch ex As Exception Catch ex As Exception
_FilesUpdating = False _FilesUpdating = False
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[TDownloader.FilesUpdatePendingUsers]") ErrorsDescriber.Execute(EDP.SendToLog, ex, "[TDownloader.FilesUpdatePendingUsers]")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
Friend Sub ClearSessions() Friend Sub ClearSessions()
@@ -536,10 +541,8 @@ Namespace DownloadObjects
If Pool.Count > 0 Then Pool.ForEach(Sub(p) If Not p.Progress Is Nothing Then p.Progress.Maximum = 0) If Pool.Count > 0 Then Pool.ForEach(Sub(p) If Not p.Progress Is Nothing Then p.Progress.Maximum = 0)
ExecuteCommand(Settings.DownloadsCompleteCommand) ExecuteCommand(Settings.DownloadsCompleteCommand)
UpdateJobsLabel() UpdateJobsLabel()
If MissingPostsDetected And Settings.AddMissingToLog Then If MissingPostsDetected And Settings.AddMissingToLog Then _
MyMainLOG = "Some posts didn't download. You can see them in the 'Missing posts' form." MyMainLOG = "Some posts didn't download. You can see them in the 'Missing posts' form."
MainFrameObj.UpdateLogButton()
End If
Files.Sort() Files.Sort()
FilesChanged = Not fBefore = Files.Count FilesChanged = Not fBefore = Files.Count
RaiseEvent Downloading(False) RaiseEvent Downloading(False)
@@ -612,6 +615,7 @@ Namespace DownloadObjects
Dim limitIndex% Dim limitIndex%
Dim limits As New List(Of HostLimit) Dim limits As New List(Of HostLimit)
Dim Keys As New List(Of String) Dim Keys As New List(Of String)
Dim KeysSkipped As New List(Of String)
Dim h As Boolean = False Dim h As Boolean = False
Dim host As SettingsHost = Nothing Dim host As SettingsHost = Nothing
Dim hostAvailable As Boolean Dim hostAvailable As Boolean
@@ -638,6 +642,8 @@ Namespace DownloadObjects
limit = limit.Next limit = limit.Next
limits(limitIndex) = limit limits(limitIndex) = limit
If limit.Value >= limit.Limit Then Exit For If limit.Value >= limit.Limit Then Exit For
Else
KeysSkipped.Add(_Item.Key)
End If End If
End If End If
End If End If
@@ -655,24 +661,27 @@ Namespace DownloadObjects
For Each k$ In Keys For Each k$ In Keys
i = _Job.Items.FindIndex(Function(ii) ii.Key = k) i = _Job.Items.FindIndex(Function(ii) ii.Key = k)
If i >= 0 Then If i >= 0 Then
With _Job.Items(i) If KeysSkipped.Count = 0 OrElse Not KeysSkipped.Contains(k) Then
If DirectCast(.Self, UserDataBase).ContentMissingExists Then MissingPostsDetected = True With _Job.Items(i)
RaiseEvent UserDownloadStateChanged(.Self, False) If DirectCast(.Self, UserDataBase).ContentMissingExists Then MissingPostsDetected = True
host = _Job.UserHost(.Self) RaiseEvent UserDownloadStateChanged(.Self, False)
host.AfterDownload(.Self, Download.Main) host = _Job.UserHost(.Self)
If Not .Disposed AndAlso Not .IsCollection AndAlso .DownloadedTotal(False) > 0 Then host.AfterDownload(.Self, Download.Main)
If Not Downloaded.Contains(.Self) Then Downloaded.Add(Settings.GetUser(.Self)) If Not .Disposed AndAlso Not .IsCollection AndAlso .DownloadedTotal(False) > 0 Then
With DirectCast(.Self, UserDataBase) If Not Downloaded.Contains(.Self) Then Downloaded.Add(Settings.GetUser(.Self))
If .LatestData.Count > 0 And .IncludeInTheFeed Then Files.ListAddList(.LatestData.Select(Function(d) New UserMediaD(d, .Self, Session)), FilesLP) With DirectCast(.Self, UserDataBase)
End With If .LatestData.Count > 0 And .IncludeInTheFeed Then Files.ListAddList(.LatestData.Select(Function(d) New UserMediaD(d, .Self, Session)), FilesLP)
dcc = True End With
End If dcc = True
End With End If
End With
End If
_Job.Items.RemoveAt(i) _Job.Items.RemoveAt(i)
End If End If
Next Next
End If End If
Keys.Clear() Keys.Clear()
KeysSkipped.Clear()
_Job.Items.RemoveAll(Function(ii) ii.Disposed) _Job.Items.RemoveAll(Function(ii) ii.Disposed)
If dcc Then Downloaded.RemoveAll(Function(u) u Is Nothing) If dcc Then Downloaded.RemoveAll(Function(u) u Is Nothing)
If dcc And Downloaded.Count > 0 Then RaiseEvent DownloadCountChange() If dcc And Downloaded.Count > 0 Then RaiseEvent DownloadCountChange()

View File

@@ -167,6 +167,7 @@ Namespace Editors
Me.TXT_DOWN_COMPLETE_SCRIPT = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_DOWN_COMPLETE_SCRIPT = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.CH_UNAME_UP = New System.Windows.Forms.CheckBox() Me.CH_UNAME_UP = New System.Windows.Forms.CheckBox()
Me.CH_UICON_UP = New System.Windows.Forms.CheckBox() Me.CH_UICON_UP = New System.Windows.Forms.CheckBox()
Me.TXT_AUTO_BRUSH_MIN = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.TXT_FEED_ROWS = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_FEED_ROWS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.TXT_FEED_COLUMNS = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_FEED_COLUMNS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.CH_FEED_ENDLESS = New System.Windows.Forms.CheckBox() Me.CH_FEED_ENDLESS = New System.Windows.Forms.CheckBox()
@@ -269,6 +270,7 @@ Namespace Editors
CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.TXT_DOWN_COMPLETE_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_DOWN_COMPLETE_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit()
TP_MISSING_DATA.SuspendLayout() TP_MISSING_DATA.SuspendLayout()
CType(Me.TXT_AUTO_BRUSH_MIN, System.ComponentModel.ISupportInitialize).BeginInit()
TAB_FEED.SuspendLayout() TAB_FEED.SuspendLayout()
TP_FEED.SuspendLayout() TP_FEED.SuspendLayout()
TP_FEED_IMG_COUNT.SuspendLayout() TP_FEED_IMG_COUNT.SuspendLayout()
@@ -1488,10 +1490,11 @@ Namespace Editors
TP_DOWNLOADING.Controls.Add(Me.CH_UNAME_UP, 0, 1) TP_DOWNLOADING.Controls.Add(Me.CH_UNAME_UP, 0, 1)
TP_DOWNLOADING.Controls.Add(Me.CH_UICON_UP, 0, 2) TP_DOWNLOADING.Controls.Add(Me.CH_UICON_UP, 0, 2)
TP_DOWNLOADING.Controls.Add(Me.CH_USE_DEF_ACC, 0, 9) TP_DOWNLOADING.Controls.Add(Me.CH_USE_DEF_ACC, 0, 9)
TP_DOWNLOADING.Controls.Add(Me.TXT_AUTO_BRUSH_MIN, 0, 10)
TP_DOWNLOADING.Dock = System.Windows.Forms.DockStyle.Fill TP_DOWNLOADING.Dock = System.Windows.Forms.DockStyle.Fill
TP_DOWNLOADING.Location = New System.Drawing.Point(0, 0) TP_DOWNLOADING.Location = New System.Drawing.Point(0, 0)
TP_DOWNLOADING.Name = "TP_DOWNLOADING" TP_DOWNLOADING.Name = "TP_DOWNLOADING"
TP_DOWNLOADING.RowCount = 11 TP_DOWNLOADING.RowCount = 12
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
@@ -1502,6 +1505,7 @@ Namespace Editors
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_DOWNLOADING.Size = New System.Drawing.Size(621, 399) TP_DOWNLOADING.Size = New System.Drawing.Size(621, 399)
TP_DOWNLOADING.TabIndex = 1 TP_DOWNLOADING.TabIndex = 1
@@ -1584,6 +1588,24 @@ Namespace Editors
Me.CH_UICON_UP.Text = "Update user icon and banner every time (where supported)" Me.CH_UICON_UP.Text = "Update user icon and banner every time (where supported)"
Me.CH_UICON_UP.UseVisualStyleBackColor = True Me.CH_UICON_UP.UseVisualStyleBackColor = True
' '
'TXT_AUTO_BRUSH_MIN
'
Me.TXT_AUTO_BRUSH_MIN.CaptionText = "Highlight undownloaded plans (minutes)"
Me.TXT_AUTO_BRUSH_MIN.CaptionToolTipEnabled = True
Me.TXT_AUTO_BRUSH_MIN.CaptionToolTipText = "Highlight (in gray) the scheduler plans that have not been downloaded in 'x' minu" &
"tes." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "-1 to disable."
Me.TXT_AUTO_BRUSH_MIN.CaptionWidth = 200.0R
Me.TXT_AUTO_BRUSH_MIN.ControlMode = PersonalUtilities.Forms.Controls.TextBoxExtended.ControlModes.NumericUpDown
Me.TXT_AUTO_BRUSH_MIN.Dock = System.Windows.Forms.DockStyle.Fill
Me.TXT_AUTO_BRUSH_MIN.Location = New System.Drawing.Point(4, 280)
Me.TXT_AUTO_BRUSH_MIN.Name = "TXT_AUTO_BRUSH_MIN"
Me.TXT_AUTO_BRUSH_MIN.NumberMaximum = New Decimal(New Integer() {2147483646, 0, 0, 0})
Me.TXT_AUTO_BRUSH_MIN.NumberMinimum = New Decimal(New Integer() {1, 0, 0, -2147483648})
Me.TXT_AUTO_BRUSH_MIN.NumberUpDownAlign = System.Windows.Forms.LeftRightAlignment.Left
Me.TXT_AUTO_BRUSH_MIN.Size = New System.Drawing.Size(613, 22)
Me.TXT_AUTO_BRUSH_MIN.TabIndex = 10
Me.TXT_AUTO_BRUSH_MIN.Text = "-1"
'
'TAB_FEED 'TAB_FEED
' '
TAB_FEED.Controls.Add(TP_FEED) TAB_FEED.Controls.Add(TP_FEED)
@@ -2486,6 +2508,7 @@ Namespace Editors
CType(Me.TXT_DOWN_COMPLETE_SCRIPT, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TXT_DOWN_COMPLETE_SCRIPT, System.ComponentModel.ISupportInitialize).EndInit()
TP_MISSING_DATA.ResumeLayout(False) TP_MISSING_DATA.ResumeLayout(False)
TP_MISSING_DATA.PerformLayout() TP_MISSING_DATA.PerformLayout()
CType(Me.TXT_AUTO_BRUSH_MIN, System.ComponentModel.ISupportInitialize).EndInit()
TAB_FEED.ResumeLayout(False) TAB_FEED.ResumeLayout(False)
TP_FEED.ResumeLayout(False) TP_FEED.ResumeLayout(False)
TP_FEED.PerformLayout() TP_FEED.PerformLayout()
@@ -2636,5 +2659,6 @@ Namespace Editors
Private WithEvents CH_DOWN_ALL_NOTIFY As CheckBox Private WithEvents CH_DOWN_ALL_NOTIFY As CheckBox
Private WithEvents CH_CHANNELS_USERS_READY_MARK As CheckBox Private WithEvents CH_CHANNELS_USERS_READY_MARK As CheckBox
Private WithEvents NUM_FEED_SES_CURR_LOAD_LAST As PersonalUtilities.Forms.Controls.TextBoxExtended Private WithEvents NUM_FEED_SES_CURR_LOAD_LAST As PersonalUtilities.Forms.Controls.TextBoxExtended
Private WithEvents TXT_AUTO_BRUSH_MIN As PersonalUtilities.Forms.Controls.TextBoxExtended
End Class End Class
End Namespace End Namespace

View File

@@ -123,6 +123,7 @@ Namespace Editors
CH_ADD_MISSING_ERROS_TO_LOG.Checked = .AddMissingErrorsToLog CH_ADD_MISSING_ERROS_TO_LOG.Checked = .AddMissingErrorsToLog
CH_DOWN_REPARSE_MISSING.Checked = .ReparseMissingInTheRoutine CH_DOWN_REPARSE_MISSING.Checked = .ReparseMissingInTheRoutine
CH_USE_DEF_ACC.Checked = .UseDefaultAccountIfMissing CH_USE_DEF_ACC.Checked = .UseDefaultAccountIfMissing
TXT_AUTO_BRUSH_MIN.Value = .AutomationBrushUndownloadedPlansMinutes.Value
'Downloading: file names 'Downloading: file names
CH_FILE_NAME_CHANGE.Checked = Not .FileReplaceNameByDate.Value = FileNameReplaceMode.None CH_FILE_NAME_CHANGE.Checked = Not .FileReplaceNameByDate.Value = FileNameReplaceMode.None
OPT_FILE_NAME_REPLACE.Checked = .FileReplaceNameByDate.Value = FileNameReplaceMode.Replace OPT_FILE_NAME_REPLACE.Checked = .FileReplaceNameByDate.Value = FileNameReplaceMode.Replace
@@ -331,6 +332,7 @@ Namespace Editors
.AddMissingErrorsToLog.Value = CH_ADD_MISSING_ERROS_TO_LOG.Checked .AddMissingErrorsToLog.Value = CH_ADD_MISSING_ERROS_TO_LOG.Checked
.ReparseMissingInTheRoutine.Value = CH_DOWN_REPARSE_MISSING.Checked .ReparseMissingInTheRoutine.Value = CH_DOWN_REPARSE_MISSING.Checked
.UseDefaultAccountIfMissing.Value = CH_USE_DEF_ACC.Checked .UseDefaultAccountIfMissing.Value = CH_USE_DEF_ACC.Checked
.AutomationBrushUndownloadedPlansMinutes.Value = TXT_AUTO_BRUSH_MIN.Value
'Downloading: file names 'Downloading: file names
If CH_FILE_NAME_CHANGE.Checked Then If CH_FILE_NAME_CHANGE.Checked Then
.FileReplaceNameByDate.Value = If(OPT_FILE_NAME_REPLACE.Checked, FileNameReplaceMode.Replace, FileNameReplaceMode.Add) .FileReplaceNameByDate.Value = If(OPT_FILE_NAME_REPLACE.Checked, FileNameReplaceMode.Replace, FileNameReplaceMode.Add)

View File

@@ -313,7 +313,6 @@ Namespace Editors
BTT_START.Enabled = Not Working BTT_START.Enabled = Not Working
BTT_CANCEL.Enabled = Working BTT_CANCEL.Enabled = Working
End Sub, EDP.None) End Sub, EDP.None)
If Not Working Then MainFrameObj.UpdateLogButton()
Catch Catch
End Try End Try
End Sub End Sub

View File

@@ -131,7 +131,6 @@ Public Class MainFrame
Await .Automation.Start(True) Await .Automation.Start(True)
End With End With
UpdatePauseButtonsVisibility() UpdatePauseButtonsVisibility()
MainFrameObj.UpdateLogButton()
End Sub End Sub
Private _CloseInvoked As Boolean = False Private _CloseInvoked As Boolean = False
Private _IgnoreTrayOptions As Boolean = False Private _IgnoreTrayOptions As Boolean = False
@@ -625,7 +624,6 @@ CloseResume:
End Using End Using
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[MainFrame.ShowGroups]") ErrorsDescriber.Execute(EDP.SendToLog, ex, "[MainFrame.ShowGroups]")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
#End Region #End Region
@@ -652,7 +650,6 @@ CloseResume:
MainFrameObj.PauseButtons.UpdatePauseButtons() MainFrameObj.PauseButtons.UpdatePauseButtons()
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Start automation") ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Start automation")
MainFrameObj.UpdateLogButton()
End Try End Try
End Sub End Sub
Private Sub BTT_DOWN_AUTOMATION_PAUSE_Click(sender As Object, e As EventArgs) Handles BTT_DOWN_AUTOMATION_PAUSE.Click, BTT_TRAY_PAUSE_AUTOMATION.Click Private Sub BTT_DOWN_AUTOMATION_PAUSE_Click(sender As Object, e As EventArgs) Handles BTT_DOWN_AUTOMATION_PAUSE.Click, BTT_TRAY_PAUSE_AUTOMATION.Click
@@ -2022,7 +2019,6 @@ ResumeDownloadingOperation:
End Sub End Sub
Private Sub Downloader_UpdateJobsCount(ByVal TotalCount As Integer) Private Sub Downloader_UpdateJobsCount(ByVal TotalCount As Integer)
ControlInvokeFast(Toolbar_BOTTOM, LBL_JOBS_COUNT, Sub() LBL_JOBS_COUNT.Text = IIf(TotalCount = 0, String.Empty, $"[Jobs {TotalCount}]")) ControlInvokeFast(Toolbar_BOTTOM, LBL_JOBS_COUNT, Sub() LBL_JOBS_COUNT.Text = IIf(TotalCount = 0, String.Empty, $"[Jobs {TotalCount}]"))
MainFrameObj.UpdateLogButton()
End Sub End Sub
Private Sub Downloader_Downloading(ByVal Value As Boolean) Private Sub Downloader_Downloading(ByVal Value As Boolean)
Dim __isDownloading As Boolean = Value Or Downloader.Working(False) Dim __isDownloading As Boolean = Value Or Downloader.Working(False)

View File

@@ -66,17 +66,17 @@ Friend Class MainFrameObjects : Implements INotificator
ControlInvokeFast(MF.TRAY_CONTEXT, Sub() MF.BTT_TRAY_CLOSE_NO_SCRIPT.Visible = ControlInvokeFast(MF.TRAY_CONTEXT, Sub() MF.BTT_TRAY_CLOSE_NO_SCRIPT.Visible =
Settings.ClosingCommand.Attribute And Not Settings.ClosingCommand.IsEmptyString) Settings.ClosingCommand.Attribute And Not Settings.ClosingCommand.IsEmptyString)
End Sub End Sub
Friend Sub UpdateLogButton() Private Sub UpdateLogButton()
MyMainLOG_UpdateLogButton(MF.BTT_LOG, MF.Toolbar_TOP) Try : MyMainLOG_UpdateLogButton(MF.BTT_LOG, MF.Toolbar_TOP) : Catch : End Try
End Sub End Sub
Friend Function GetUserListProvider(ByVal WithCollections As Boolean) As IFormatProvider Friend Function GetUserListProvider(ByVal WithCollections As Boolean) As IFormatProvider
Return MF.GetUserListProvider(WithCollections) Return MF.GetUserListProvider(WithCollections)
End Function End Function
Friend Sub ShowLog() Friend Sub ShowLog()
MyMainLOG_ShowForm(Settings.Design,,,, Sub() Try : MyMainLOG_ShowForm(Settings.Design,,,, Sub()
UpdateLogButton() UpdateLogButton()
LogFormClosed() LogFormClosed()
End Sub) End Sub) : Catch : End Try
End Sub End Sub
#End Region #End Region
#Region "Notifications" #Region "Notifications"

View File

@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2024.5.18.0")> <Assembly: AssemblyVersion("2024.6.6.0")>
<Assembly: AssemblyFileVersion("2024.5.18.0")> <Assembly: AssemblyFileVersion("2024.6.6.0")>
<Assembly: NeutralResourcesLanguage("en")> <Assembly: NeutralResourcesLanguage("en")>

View File

@@ -202,7 +202,6 @@ Namespace Plugin.Hosts
Select Case Hosts_Deleted_MoveAcc(Obj) Select Case Hosts_Deleted_MoveAcc(Obj)
Case -1 : ShowOperationCanceledMsg(ChngUACC_MsgTitle) : Exit Sub Case -1 : ShowOperationCanceledMsg(ChngUACC_MsgTitle) : Exit Sub
Case 1 Case 1
MainFrameObj.UpdateLogButton()
MsgBoxE({$"An error occurred while changing user accounts (see log for details).{vbCr}Operation canceled.", ChngUACC_MsgTitle}, vbCritical) MsgBoxE({$"An error occurred while changing user accounts (see log for details).{vbCr}Operation canceled.", ChngUACC_MsgTitle}, vbCritical)
Exit Sub Exit Sub
End Select End Select

View File

@@ -173,17 +173,17 @@
<Compile Include="API\Base\M3U8Base.vb" /> <Compile Include="API\Base\M3U8Base.vb" />
<Compile Include="API\Base\ProfileSaved.vb" /> <Compile Include="API\Base\ProfileSaved.vb" />
<Compile Include="API\Base\SiteSettingsBase.vb" /> <Compile Include="API\Base\SiteSettingsBase.vb" />
<Compile Include="API\Base\SplitCollectionUserInfo.vb" /> <Compile Include="API\BaseObjects\SplitCollectionUserInfo.vb" />
<Compile Include="API\Base\SplitCollectionUserInfoChangePathsForm.Designer.vb"> <Compile Include="API\BaseObjects\SplitCollectionUserInfoChangePathsForm.Designer.vb">
<DependentUpon>SplitCollectionUserInfoChangePathsForm.vb</DependentUpon> <DependentUpon>SplitCollectionUserInfoChangePathsForm.vb</DependentUpon>
</Compile> </Compile>
<Compile Include="API\Base\SplitCollectionUserInfoChangePathsForm.vb"> <Compile Include="API\BaseObjects\SplitCollectionUserInfoChangePathsForm.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="API\Base\SplitCollectionUserInfoPathForm.Designer.vb"> <Compile Include="API\BaseObjects\SplitCollectionUserInfoPathForm.Designer.vb">
<DependentUpon>SplitCollectionUserInfoPathForm.vb</DependentUpon> <DependentUpon>SplitCollectionUserInfoPathForm.vb</DependentUpon>
</Compile> </Compile>
<Compile Include="API\Base\SplitCollectionUserInfoPathForm.vb"> <Compile Include="API\BaseObjects\SplitCollectionUserInfoPathForm.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="API\Base\Structures.vb" /> <Compile Include="API\Base\Structures.vb" />
@@ -531,10 +531,10 @@
<EmbeddedResource Include="API\BaseObjects\InternalSettingsForm.resx"> <EmbeddedResource Include="API\BaseObjects\InternalSettingsForm.resx">
<DependentUpon>InternalSettingsForm.vb</DependentUpon> <DependentUpon>InternalSettingsForm.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="API\Base\SplitCollectionUserInfoChangePathsForm.resx"> <EmbeddedResource Include="API\BaseObjects\SplitCollectionUserInfoChangePathsForm.resx">
<DependentUpon>SplitCollectionUserInfoChangePathsForm.vb</DependentUpon> <DependentUpon>SplitCollectionUserInfoChangePathsForm.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="API\Base\SplitCollectionUserInfoPathForm.resx"> <EmbeddedResource Include="API\BaseObjects\SplitCollectionUserInfoPathForm.resx">
<DependentUpon>SplitCollectionUserInfoPathForm.vb</DependentUpon> <DependentUpon>SplitCollectionUserInfoPathForm.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="API\OnlyFans\OFResources.resx"> <EmbeddedResource Include="API\OnlyFans\OFResources.resx">

View File

@@ -356,6 +356,7 @@ Friend Class SettingsCLS : Implements IDownloaderSettings, IDisposable
DownloadsCompleteCommand = New XMLValueAttribute(Of String, Boolean)("DownloadsCompleteCommand", "Use",,, MyXML, n) DownloadsCompleteCommand = New XMLValueAttribute(Of String, Boolean)("DownloadsCompleteCommand", "Use",,, MyXML, n)
ReparseMissingInTheRoutine = New XMLValue(Of Boolean)("ReparseMissingInTheRoutine", False, MyXML, n) ReparseMissingInTheRoutine = New XMLValue(Of Boolean)("ReparseMissingInTheRoutine", False, MyXML, n)
UseDefaultAccountIfMissing = New XMLValue(Of Boolean)("UseDefaultAccountIfMissing", True, MyXML, n) UseDefaultAccountIfMissing = New XMLValue(Of Boolean)("UseDefaultAccountIfMissing", True, MyXML, n)
AutomationBrushUndownloadedPlansMinutes = New XMLValue(Of Integer)("AutomationBrushUndownloadedPlansMinutes", 10080, MyXML, n)
'Downloading: file naming 'Downloading: file naming
n_old = {"Users", "FileName"} n_old = {"Users", "FileName"}
@@ -1001,6 +1002,7 @@ Friend Class SettingsCLS : Implements IDownloaderSettings, IDisposable
End Get End Get
End Property End Property
#End Region #End Region
#Region "Properties"
#Region "Basis" #Region "Basis"
Friend ReadOnly Property GlobalPath As XMLValue(Of SFile) Friend ReadOnly Property GlobalPath As XMLValue(Of SFile)
Friend ReadOnly Property MaxLargeImageHeight As XMLValue(Of Integer) Friend ReadOnly Property MaxLargeImageHeight As XMLValue(Of Integer)
@@ -1204,6 +1206,7 @@ Friend Class SettingsCLS : Implements IDownloaderSettings, IDisposable
Friend ReadOnly Property DownloadsCompleteCommand As XMLValueAttribute(Of String, Boolean) Friend ReadOnly Property DownloadsCompleteCommand As XMLValueAttribute(Of String, Boolean)
Friend ReadOnly Property ReparseMissingInTheRoutine As XMLValue(Of Boolean) Friend ReadOnly Property ReparseMissingInTheRoutine As XMLValue(Of Boolean)
Friend ReadOnly Property UseDefaultAccountIfMissing As XMLValue(Of Boolean) Friend ReadOnly Property UseDefaultAccountIfMissing As XMLValue(Of Boolean)
Friend ReadOnly Property AutomationBrushUndownloadedPlansMinutes As XMLValue(Of Integer)
#End Region #End Region
#Region "Downloading: file naming" #Region "Downloading: file naming"
Friend ReadOnly Property FileAddDateToFileName As XMLValue(Of Boolean) Friend ReadOnly Property FileAddDateToFileName As XMLValue(Of Boolean)
@@ -1309,6 +1312,7 @@ Friend Class SettingsCLS : Implements IDownloaderSettings, IDisposable
Friend ReadOnly Property LatestSavingPath As XMLValue(Of SFile) Friend ReadOnly Property LatestSavingPath As XMLValue(Of SFile)
Friend ReadOnly Property LatestSelectedChannel As XMLValue(Of String) Friend ReadOnly Property LatestSelectedChannel As XMLValue(Of String)
#End Region #End Region
#End Region
#Region "IDisposable Support" #Region "IDisposable Support"
Private disposedValue As Boolean = False Private disposedValue As Boolean = False
Protected Overridable Overloads Sub Dispose(ByVal disposing As Boolean) Protected Overridable Overloads Sub Dispose(ByVal disposing As Boolean)

View File

@@ -0,0 +1,24 @@
REM https://superuser.com/a/577640/1410018
@echo off
set dirname=_MEI
set usewildcard=true
set found=false
if %usewildcard% == true (
set dirname=*%dirname%*
)
set directorytosearch=%UserProfile%\AppData\Local\Temp
echo Searching for %dirname% in %directorytosearch%
for /d %%i in (%directorytosearch%\%dirname%) do (
IF EXIST %%i (
set found=true
echo Deleting the folder %%i
rmdir /s /q "%%i"
)
)
if NOT "%found%" == "true" (
echo No directories were found with the name of %dirname%
)