From 64c54b159fe47b3c49921565a7486e18ab3f8579 Mon Sep 17 00:00:00 2001 From: TimTester Date: Sun, 6 Dec 2020 15:37:50 +0100 Subject: [PATCH] added Download Path --- M3U_IPTV_CatchUp_Downloader/App.config | 3 + M3U_IPTV_CatchUp_Downloader/Form1.Designer.vb | 77 ++++++++++++++----- M3U_IPTV_CatchUp_Downloader/Form1.resx | 3 + M3U_IPTV_CatchUp_Downloader/Form1.vb | 28 +++++-- .../My Project/AssemblyInfo.vb | 4 +- .../My Project/Settings.Designer.vb | 12 +++ .../My Project/Settings.settings | 3 + 7 files changed, 103 insertions(+), 27 deletions(-) diff --git a/M3U_IPTV_CatchUp_Downloader/App.config b/M3U_IPTV_CatchUp_Downloader/App.config index 90fd8ff..aa1b777 100644 --- a/M3U_IPTV_CatchUp_Downloader/App.config +++ b/M3U_IPTV_CatchUp_Downloader/App.config @@ -16,6 +16,9 @@ + + + \ No newline at end of file diff --git a/M3U_IPTV_CatchUp_Downloader/Form1.Designer.vb b/M3U_IPTV_CatchUp_Downloader/Form1.Designer.vb index 449ad27..a146f03 100644 --- a/M3U_IPTV_CatchUp_Downloader/Form1.Designer.vb +++ b/M3U_IPTV_CatchUp_Downloader/Form1.Designer.vb @@ -43,6 +43,10 @@ Partial Class Form1 Me.MenuStrip = New System.Windows.Forms.MenuStrip() Me.DonateToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.CheckForUpdateOnGitHubToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.Label2 = New System.Windows.Forms.Label() + Me.TextBox_Download_Path = New System.Windows.Forms.TextBox() + Me.Button_choose_Download_path = New System.Windows.Forms.Button() + Me.FolderBrowserDialog_DownloadPath = New System.Windows.Forms.FolderBrowserDialog() Me.GroupBox1.SuspendLayout() Me.GroupBox2.SuspendLayout() Me.MenuStrip.SuspendLayout() @@ -60,14 +64,14 @@ Partial Class Form1 'TextBox_EPG_URL ' Me.TextBox_EPG_URL.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.25!) - Me.TextBox_EPG_URL.Location = New System.Drawing.Point(108, 55) + Me.TextBox_EPG_URL.Location = New System.Drawing.Point(142, 55) Me.TextBox_EPG_URL.Name = "TextBox_EPG_URL" - Me.TextBox_EPG_URL.Size = New System.Drawing.Size(579, 26) + Me.TextBox_EPG_URL.Size = New System.Drawing.Size(545, 26) Me.TextBox_EPG_URL.TabIndex = 2 ' 'ProgressBar1 ' - Me.ProgressBar1.Location = New System.Drawing.Point(10, 87) + Me.ProgressBar1.Location = New System.Drawing.Point(9, 119) Me.ProgressBar1.Name = "ProgressBar1" Me.ProgressBar1.Size = New System.Drawing.Size(776, 23) Me.ProgressBar1.TabIndex = 3 @@ -79,7 +83,7 @@ Partial Class Form1 Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.Label_status.AutoSize = True Me.Label_status.BackColor = System.Drawing.Color.Transparent - Me.Label_status.Location = New System.Drawing.Point(17, 113) + Me.Label_status.Location = New System.Drawing.Point(16, 145) Me.Label_status.Name = "Label_status" Me.Label_status.Size = New System.Drawing.Size(24, 13) Me.Label_status.TabIndex = 4 @@ -99,9 +103,9 @@ Partial Class Form1 'TextBox_M3U_URL ' Me.TextBox_M3U_URL.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.25!) - Me.TextBox_M3U_URL.Location = New System.Drawing.Point(108, 19) + Me.TextBox_M3U_URL.Location = New System.Drawing.Point(142, 19) Me.TextBox_M3U_URL.Name = "TextBox_M3U_URL" - Me.TextBox_M3U_URL.Size = New System.Drawing.Size(579, 26) + Me.TextBox_M3U_URL.Size = New System.Drawing.Size(545, 26) Me.TextBox_M3U_URL.TabIndex = 1 ' 'Label3 @@ -126,6 +130,9 @@ Partial Class Form1 ' 'GroupBox1 ' + Me.GroupBox1.Controls.Add(Me.Button_choose_Download_path) + Me.GroupBox1.Controls.Add(Me.Label2) + Me.GroupBox1.Controls.Add(Me.TextBox_Download_Path) Me.GroupBox1.Controls.Add(Me.Button_reload) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.TextBox_M3U_URL) @@ -136,14 +143,14 @@ Partial Class Form1 Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Top Me.GroupBox1.Location = New System.Drawing.Point(0, 24) Me.GroupBox1.Name = "GroupBox1" - Me.GroupBox1.Size = New System.Drawing.Size(795, 130) + Me.GroupBox1.Size = New System.Drawing.Size(795, 166) Me.GroupBox1.TabIndex = 3 Me.GroupBox1.TabStop = False ' 'Button_Download ' Me.Button_Download.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.25!) - Me.Button_Download.Location = New System.Drawing.Point(3, 51) + Me.Button_Download.Location = New System.Drawing.Point(3, 50) Me.Button_Download.Name = "Button_Download" Me.Button_Download.Size = New System.Drawing.Size(447, 30) Me.Button_Download.TabIndex = 5 @@ -154,7 +161,7 @@ Partial Class Form1 'TextBox_Filter ' Me.TextBox_Filter.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.25!) - Me.TextBox_Filter.Location = New System.Drawing.Point(79, 19) + Me.TextBox_Filter.Location = New System.Drawing.Point(79, 18) Me.TextBox_Filter.Name = "TextBox_Filter" Me.TextBox_Filter.Size = New System.Drawing.Size(707, 26) Me.TextBox_Filter.TabIndex = 4 @@ -163,7 +170,7 @@ Partial Class Form1 ' Me.Label_seeach.AutoSize = True Me.Label_seeach.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label_seeach.Location = New System.Drawing.Point(9, 22) + Me.Label_seeach.Location = New System.Drawing.Point(9, 21) Me.Label_seeach.Name = "Label_seeach" Me.Label_seeach.Size = New System.Drawing.Size(64, 20) Me.Label_seeach.TabIndex = 3 @@ -172,7 +179,7 @@ Partial Class Form1 'Button_Play ' Me.Button_Play.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.25!) - Me.Button_Play.Location = New System.Drawing.Point(566, 51) + Me.Button_Play.Location = New System.Drawing.Point(566, 50) Me.Button_Play.Name = "Button_Play" Me.Button_Play.Size = New System.Drawing.Size(219, 30) Me.Button_Play.TabIndex = 7 @@ -185,7 +192,7 @@ Partial Class Form1 Me.ListBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ListBox.FormattingEnabled = True Me.ListBox.ItemHeight = 20 - Me.ListBox.Location = New System.Drawing.Point(3, 122) + Me.ListBox.Location = New System.Drawing.Point(3, 123) Me.ListBox.Name = "ListBox" Me.ListBox.Size = New System.Drawing.Size(786, 504) Me.ListBox.TabIndex = 10 @@ -193,7 +200,7 @@ Partial Class Form1 'Button_show_TV ' Me.Button_show_TV.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.25!) - Me.Button_show_TV.Location = New System.Drawing.Point(3, 87) + Me.Button_show_TV.Location = New System.Drawing.Point(3, 86) Me.Button_show_TV.Name = "Button_show_TV" Me.Button_show_TV.Size = New System.Drawing.Size(782, 30) Me.Button_show_TV.TabIndex = 8 @@ -204,7 +211,7 @@ Partial Class Form1 'Button_cancel ' Me.Button_cancel.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.25!) - Me.Button_cancel.Location = New System.Drawing.Point(456, 51) + Me.Button_cancel.Location = New System.Drawing.Point(456, 50) Me.Button_cancel.Name = "Button_cancel" Me.Button_cancel.Size = New System.Drawing.Size(104, 30) Me.Button_cancel.TabIndex = 6 @@ -222,9 +229,9 @@ Partial Class Form1 Me.GroupBox2.Controls.Add(Me.TextBox_Filter) Me.GroupBox2.Controls.Add(Me.Button_Download) Me.GroupBox2.Dock = System.Windows.Forms.DockStyle.Fill - Me.GroupBox2.Location = New System.Drawing.Point(0, 154) + Me.GroupBox2.Location = New System.Drawing.Point(0, 190) Me.GroupBox2.Name = "GroupBox2" - Me.GroupBox2.Size = New System.Drawing.Size(795, 641) + Me.GroupBox2.Size = New System.Drawing.Size(795, 631) Me.GroupBox2.TabIndex = 4 Me.GroupBox2.TabStop = False ' @@ -249,19 +256,47 @@ Partial Class Form1 Me.CheckForUpdateOnGitHubToolStripMenuItem.Size = New System.Drawing.Size(169, 20) Me.CheckForUpdateOnGitHubToolStripMenuItem.Text = "Check for Update on GitHub" ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label2.Location = New System.Drawing.Point(15, 90) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(121, 20) + Me.Label2.TabIndex = 11 + Me.Label2.Text = "Download Path:" + ' + 'TextBox_Download_Path + ' + Me.TextBox_Download_Path.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.25!) + Me.TextBox_Download_Path.Location = New System.Drawing.Point(142, 87) + Me.TextBox_Download_Path.Name = "TextBox_Download_Path" + Me.TextBox_Download_Path.Size = New System.Drawing.Size(545, 26) + Me.TextBox_Download_Path.TabIndex = 10 + ' + 'Button_choose_Download_path + ' + Me.Button_choose_Download_path.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.25!) + Me.Button_choose_Download_path.Location = New System.Drawing.Point(693, 87) + Me.Button_choose_Download_path.Name = "Button_choose_Download_path" + Me.Button_choose_Download_path.Size = New System.Drawing.Size(90, 26) + Me.Button_choose_Download_path.TabIndex = 12 + Me.Button_choose_Download_path.Text = "choose" + Me.Button_choose_Download_path.UseVisualStyleBackColor = True + ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.White - Me.ClientSize = New System.Drawing.Size(795, 795) + Me.ClientSize = New System.Drawing.Size(795, 821) Me.Controls.Add(Me.ListBox_Backup) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.MenuStrip) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximumSize = New System.Drawing.Size(811, 834) - Me.MinimumSize = New System.Drawing.Size(811, 834) + Me.MaximumSize = New System.Drawing.Size(811, 860) + Me.MinimumSize = New System.Drawing.Size(811, 860) Me.Name = "Form1" Me.Text = "M3U IPTV CatchUp Downloader ©TimTester" Me.GroupBox1.ResumeLayout(False) @@ -294,4 +329,8 @@ Partial Class Form1 Friend WithEvents MenuStrip As MenuStrip Friend WithEvents DonateToolStripMenuItem As ToolStripMenuItem Friend WithEvents CheckForUpdateOnGitHubToolStripMenuItem As ToolStripMenuItem + Friend WithEvents Label2 As Label + Friend WithEvents TextBox_Download_Path As TextBox + Friend WithEvents Button_choose_Download_path As Button + Friend WithEvents FolderBrowserDialog_DownloadPath As FolderBrowserDialog End Class diff --git a/M3U_IPTV_CatchUp_Downloader/Form1.resx b/M3U_IPTV_CatchUp_Downloader/Form1.resx index f5efaf2..0be27e0 100644 --- a/M3U_IPTV_CatchUp_Downloader/Form1.resx +++ b/M3U_IPTV_CatchUp_Downloader/Form1.resx @@ -120,6 +120,9 @@ 132, 17 + + 240, 17 + diff --git a/M3U_IPTV_CatchUp_Downloader/Form1.vb b/M3U_IPTV_CatchUp_Downloader/Form1.vb index d56bce3..4256743 100644 --- a/M3U_IPTV_CatchUp_Downloader/Form1.vb +++ b/M3U_IPTV_CatchUp_Downloader/Form1.vb @@ -5,8 +5,8 @@ Imports System.Net Public Class Form1 - Public local_M3U As String = Application.StartupPath() & "\Downloads\M3U.m3u" - Public local_EPG As String = Application.StartupPath() & "\Downloads\EPG.XML" + Public local_M3U As String = Path.GetTempPath() & "\M3U.m3u" + Public local_EPG As String = Path.GetTempPath() & "\EPG.XML" Public EPG_XML As String @@ -37,14 +37,24 @@ Public Class Form1 Private Sub save_settings() My.Settings.EPG_URL = TextBox_EPG_URL.Text My.Settings.M3U_URL = TextBox_M3U_URL.Text + My.Settings.DownloadPath = TextBox_Download_Path.Text My.Settings.Save() End Sub Private Sub load_settings() Dim M3U_URL As String = My.Settings.M3U_URL Dim EPG_URL As String = My.Settings.EPG_URL + Dim DownloadPath As String = My.Settings.DownloadPath TextBox_EPG_URL.Text = EPG_URL TextBox_M3U_URL.Text = M3U_URL + If DownloadPath = "" Then + TextBox_Download_Path.Text = Application.StartupPath() + Else + TextBox_Download_Path.Text = DownloadPath + End If + + + M3U_URL_Download(TextBox_M3U_URL.Text) End Sub @@ -144,6 +154,10 @@ Public Class Form1 Private Sub Button_Download_Click(sender As Object, e As EventArgs) Handles Button_Download.Click + If My.Computer.FileSystem.DirectoryExists(TextBox_Download_Path.Text) = False Then + MsgBox("Please check the download path: " & TextBox_Download_Path.Text) + Exit Sub + End If 'Download If (ListBox.SelectedIndices.Count > 0) Then @@ -156,7 +170,7 @@ Public Class Form1 Dim timeshift_URL As String = get_timeshift_URL(title, start_time_str, name) 'Create Folder and download - Dim folder As String = Application.StartupPath() & "\Downloads\" & name + Dim folder As String = TextBox_Download_Path.Text & "\" & name My.Computer.FileSystem.CreateDirectory(folder) Dim DownloadFile As String = folder + "\" & RemoveIllegalFileNameChars(name & " - " & title + " - " & start_time_str, "") & ".mkv" @@ -427,7 +441,9 @@ Public Class Form1 End Sub - - - + Private Sub Button_choose_Download_path_Click(sender As Object, e As EventArgs) Handles Button_choose_Download_path.Click + FolderBrowserDialog_DownloadPath.ShowDialog() + Dim DownloadPath As String = FolderBrowserDialog_DownloadPath.SelectedPath + TextBox_Download_Path.Text = DownloadPath + End Sub End Class diff --git a/M3U_IPTV_CatchUp_Downloader/My Project/AssemblyInfo.vb b/M3U_IPTV_CatchUp_Downloader/My Project/AssemblyInfo.vb index 0df5b07..ae59c3e 100644 --- a/M3U_IPTV_CatchUp_Downloader/My Project/AssemblyInfo.vb +++ b/M3U_IPTV_CatchUp_Downloader/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' indem Sie "*" wie unten gezeigt eingeben: ' - - + + diff --git a/M3U_IPTV_CatchUp_Downloader/My Project/Settings.Designer.vb b/M3U_IPTV_CatchUp_Downloader/My Project/Settings.Designer.vb index a53d3f8..2f0e383 100644 --- a/M3U_IPTV_CatchUp_Downloader/My Project/Settings.Designer.vb +++ b/M3U_IPTV_CatchUp_Downloader/My Project/Settings.Designer.vb @@ -77,6 +77,18 @@ Namespace My Me("EPG_URL") = value End Set End Property + + _ + Public Property DownloadPath() As String + Get + Return CType(Me("DownloadPath"),String) + End Get + Set + Me("DownloadPath") = value + End Set + End Property End Class End Namespace diff --git a/M3U_IPTV_CatchUp_Downloader/My Project/Settings.settings b/M3U_IPTV_CatchUp_Downloader/My Project/Settings.settings index 2bd4941..7123936 100644 --- a/M3U_IPTV_CatchUp_Downloader/My Project/Settings.settings +++ b/M3U_IPTV_CatchUp_Downloader/My Project/Settings.settings @@ -8,5 +8,8 @@ + + + \ No newline at end of file