diff --git a/.vs/Crunchyroll Downloader/v15/.suo b/.vs/Crunchyroll Downloader/v15/.suo index 97b8f77..69b75e2 100644 Binary files a/.vs/Crunchyroll Downloader/v15/.suo and b/.vs/Crunchyroll Downloader/v15/.suo differ diff --git a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide index 17ada43..8e5f697 100644 Binary files a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide and b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-shm b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-shm index c8c3ffb..f95f905 100644 Binary files a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-shm and b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-shm differ diff --git a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-wal b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-wal index dad870a..70f86e9 100644 Binary files a/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-wal and b/.vs/Crunchyroll Downloader/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Crunchyroll Downloader/CRD_List_Item.Designer.vb b/Crunchyroll Downloader/CRD_List_Item.Designer.vb index 6354d70..9429958 100644 --- a/Crunchyroll Downloader/CRD_List_Item.Designer.vb +++ b/Crunchyroll Downloader/CRD_List_Item.Designer.vb @@ -51,7 +51,7 @@ Partial Class CRD_List_Item ' 'bt_pause ' - Me.bt_pause.BackgroundImage = Global.Crunchyroll_Downloader.My.Resources.Resources.main_pause + Me.bt_pause.BackgroundImage = Global.Crunchyroll_Downloader.My.Resources.main_pause Me.bt_pause.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom Me.bt_pause.Location = New System.Drawing.Point(740, 15) Me.bt_pause.Name = "bt_pause" @@ -128,7 +128,7 @@ Partial Class CRD_List_Item Me.ProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous Me.ProgressBar1.TabIndex = 8 ' - 'Item + 'CRD_List_Item ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font @@ -142,7 +142,7 @@ Partial Class CRD_List_Item Me.Controls.Add(Me.bt_del) Me.Controls.Add(Me.bt_pause) Me.Controls.Add(Me.PB_Thumbnail) - Me.Name = "Item" + Me.Name = "CRD_List_Item" Me.Size = New System.Drawing.Size(838, 142) CType(Me.PB_Thumbnail, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.bt_pause, System.ComponentModel.ISupportInitialize).EndInit() diff --git a/Crunchyroll Downloader/CRD_List_Item.vb b/Crunchyroll Downloader/CRD_List_Item.vb index 9fbbf04..33d21bd 100644 --- a/Crunchyroll Downloader/CRD_List_Item.vb +++ b/Crunchyroll Downloader/CRD_List_Item.vb @@ -16,6 +16,21 @@ Public Class CRD_List_Item Dim MergeSubstoMP4 As Boolean = False Dim SaveLog As Boolean = False Dim DownloadPfad As String = Nothing + Dim ToDispose As Boolean = False + Dim HistoryDL_URL As String + Dim HistoryDL_Pfad As String + Dim HistoryFilename As String + Dim Retry As Boolean = False +#Region "Remove from list" + Public Sub DisposeItem(ByVal Dispose As Boolean) + If Dispose = True Then + Me.Dispose() + End If + End Sub + Public Function GetToDispose() As Boolean + Return ToDispose + End Function +#End Region #Region "Set UI" Public Sub SetLabelWebsite(ByVal Text As String) Label_website.Text = Text @@ -100,6 +115,32 @@ Public Class CRD_List_Item End Sub Private Sub bt_pause_Click(sender As Object, e As EventArgs) Handles bt_pause.Click + If proc.HasExited = True Then + If ProgressBar1.Value < 100 Then + MsgBox("Something is wrong here, the download process seems to have crashed", MsgBoxStyle.Exclamation) + Label_percent.Text = "Press the play button again to retry." + ProgressBar1.Value = 100 + Retry = True + StatusRunning = False + ElseIf Retry = True Then + If Main.RunningDownloads < Main.MaxDL Then + + Else + If MessageBox.Show("You have currtenly on your set Download limit." + vbNewLine + " You can Press OK to ignore it.", "Download maximum reached", MessageBoxButtons.OKCancel) = DialogResult.Cancel Then + Exit Sub + End If + End If + If My.Computer.FileSystem.FileExists(HistoryDL_Pfad.Replace(Chr(34), "")) Then 'Pfad = Kompeltter Pfad mit Dateinamen + ENdung + Try + My.Computer.FileSystem.DeleteFile(HistoryDL_Pfad.Replace(Chr(34), "")) + Catch ex As Exception + End Try + End If + DownloadFFMPEG(HistoryDL_URL, HistoryDL_Pfad, HistoryFilename) + StatusRunning = True + End If + Exit Sub + End If If StatusRunning = True Then StatusRunning = False bt_pause.BackgroundImage = My.Resources.main_pause_play @@ -149,6 +190,9 @@ Public Class CRD_List_Item Public Function DownloadFFMPEG(ByVal DL_URL As String, ByVal DL_Pfad As String, ByVal Filename As String) As String DownloadPfad = DL_Pfad + HistoryDL_URL = DL_URL + HistoryDL_Pfad = DL_Pfad + HistoryFilename = Filename Dim exepath As String = Application.StartupPath + "\ffmpeg.exe" Dim startinfo As New System.Diagnostics.ProcessStartInfo @@ -321,8 +365,14 @@ Public Class CRD_List_Item Private Sub bt_del_Click(sender As Object, e As EventArgs) Handles bt_del.Click If proc.HasExited Then - + If MessageBox.Show("The Download is not running anymore, press ok to remove it from the list.", "Remove from list!", MessageBoxButtons.OKCancel) = DialogResult.Cancel Then + Exit Sub + End If + ToDispose = True Else + If MessageBox.Show("Are you sure you want to cancel the Download?", "Cancel Download!", MessageBoxButtons.YesNo) = DialogResult.No Then + Exit Sub + End If KillRunningTask() End If diff --git a/Crunchyroll Downloader/GeckoFX.vb b/Crunchyroll Downloader/GeckoFX.vb index 1a04300..8cb052b 100644 --- a/Crunchyroll Downloader/GeckoFX.vb +++ b/Crunchyroll Downloader/GeckoFX.vb @@ -371,7 +371,10 @@ Public Class GeckoFX End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click - + 'Main.WebbrowserURL = WebBrowser1.Url.ToString + 'Main.WebbrowserText = WebBrowser1.Document.Body.OuterHtml + 'Main.WebbrowserTitle = WebBrowser1.DocumentTitle + 'Main.GrappURL() Try My.Computer.Clipboard.SetText(WebBrowser1.Url.ToString) MsgBox("copied: " + Chr(34) + WebBrowser1.Url.ToString + Chr(34)) diff --git a/Crunchyroll Downloader/Login.vb b/Crunchyroll Downloader/Login.vb index f063583..6d80ba1 100644 --- a/Crunchyroll Downloader/Login.vb +++ b/Crunchyroll Downloader/Login.vb @@ -59,6 +59,21 @@ Public Class Login Dim Request0 As HttpWebRequest = CType(WebRequest.Create("https://api.crunchyroll.com/login.0.json"), HttpWebRequest) Request0.Method = "POST" Request0.ContentType = "application/x-www-form-urlencoded" + If GeckoFX.keks = Nothing Then + MsgBox("No active Cookie found!", MsgBoxStyle.Exclamation) + Me.Close() + Exit Sub + + 'GeckoFX.WebBrowser1.Navigate("https://www.crunchyroll.com/") + 'Pause(2) + 'Dim c As String = GeckoFX.WebBrowser1.Document.Cookie.ToString + 'MsgBox(c) + 'Dim cookieGrapp7() As String = c.Split(New String() {"session_id="}, System.StringSplitOptions.RemoveEmptyEntries) + 'Dim cookieGrapp8() As String = cookieGrapp7(1).Split(New String() {";"}, System.StringSplitOptions.RemoveEmptyEntries) + 'MsgBox(cookieGrapp8(0)) + 'GeckoFX.keks = cookieGrapp8(0) + ''Console.WriteLine() + End If Dim Post0 As String = "account=" + LoginID.Text + "&password=" + Password.Text + "&session_id=" + GeckoFX.keks Dim byteArray0() As Byte = Encoding.UTF8.GetBytes(Post0) Request0.ContentLength = byteArray0.Length @@ -71,6 +86,7 @@ Public Class Login Dim ServerResponse0 As String = reader0.ReadToEnd() If InStr(ServerResponse0, My.Resources.LoginSuccess) Then Else + MsgBox(Post0) MsgBox(ServerResponse0) End If reader0.Close() diff --git a/Crunchyroll Downloader/Main.vb b/Crunchyroll Downloader/Main.vb index de32555..1224cfa 100644 --- a/Crunchyroll Downloader/Main.vb +++ b/Crunchyroll Downloader/Main.vb @@ -1070,22 +1070,14 @@ Public Class Main End Function)) #Region "Name von Crunchyroll" If TextBox2_Text = Nothing Or TextBox2_Text = "Name of the Anime" Then - 'MsgBox("True") - 'Dim Bug_Deutsch As String = "-" - 'If CBool(InStr(WebbrowserTitle, "Anschauen auf Crunchyroll")) Then - ' Bug_Deutsch = ":" - 'End If - 'Dim CR_Name_by_Titel_2 As String() = WebbrowserTitle.Split(New String() {Bug_Deutsch}, System.StringSplitOptions.RemoveEmptyEntries) - 'CR_FilenName = CR_Name_by_Titel_2(0).Trim() '+ " " + CR_Name_by_Script2(0).Trim - Dim Bug_Deutsch As String = "-" If CBool(InStr(WebbrowserTitle, "Anschauen auf Crunchyroll")) Then Bug_Deutsch = ":" End If Dim CR_Name_by_Titel_2 As String() = WebbrowserTitle.Split(New String() {Bug_Deutsch}, System.StringSplitOptions.RemoveEmptyEntries) Dim CR_Title As String = Nothing - If CR_Name_by_Titel_2.Count > 2 Then - For i As Integer = 0 To CR_Name_by_Titel_2.Count - 2 + 'If CR_Name_by_Titel_2.Count > 2 Then + For i As Integer = 0 To CR_Name_by_Titel_2.Count - 2 If CR_Title = Nothing Then CR_Title = CR_Name_by_Titel_2(i).Trim() Else @@ -1093,7 +1085,9 @@ Public Class Main End If Next - End If + 'Else + + 'End If CR_FilenName = CR_Title CR_FilenName_Backup = CR_Title 'MsgBox(CR_FilenName) @@ -1157,9 +1151,10 @@ Public Class Main End If Return Nothing End Function)) - 'MsgBox(CR_FilenName) + CR_FilenName = System.Text.RegularExpressions.Regex.Replace(CR_FilenName, "[^\w\\-]", " ") CR_FilenName = RemoveExtraSpaces(CR_FilenName) + 'MsgBox(CR_FilenName) If SubfolderValue = Nothing Then Pfad2 = Pfad + "\" + CR_FilenName + ".mp4" Else @@ -1588,13 +1583,17 @@ Public Class Main End Function Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick - Try - Dim ItemDownloadingTrue As Integer = 0 For s As Integer = 0 To ListView1.Items.Count - 1 - Dim r As Rectangle = ListView1.Items.Item(s).Bounds ItemList(s).SetBounds(r.X, r.Y, r.Width, r.Height) + + If ItemList(s).GetToDispose() = True Then + ItemList(s).DisposeItem(ItemList(s).GetToDispose()) + ItemList.RemoveAt(s) + ListView1.Items.RemoveAt(s) + End If + Next Catch ex As Exception @@ -1808,7 +1807,7 @@ Public Class Main Private Sub Main_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles Me.MouseDoubleClick - 'Login.Show() + Login.Show() End Sub Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick diff --git a/Crunchyroll Downloader/My Project/AssemblyInfo.vb b/Crunchyroll Downloader/My Project/AssemblyInfo.vb index 1c8cbda..149af8c 100644 --- a/Crunchyroll Downloader/My Project/AssemblyInfo.vb +++ b/Crunchyroll Downloader/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Crunchyroll Downloader/bin/x86/Debug/Crunchyroll Downloader.exe b/Crunchyroll Downloader/bin/x86/Debug/Crunchyroll Downloader.exe index d1b1fff..bde00f1 100644 Binary files a/Crunchyroll Downloader/bin/x86/Debug/Crunchyroll Downloader.exe and b/Crunchyroll Downloader/bin/x86/Debug/Crunchyroll Downloader.exe differ diff --git a/Crunchyroll Downloader/bin/x86/Debug/Crunchyroll Downloader.pdb b/Crunchyroll Downloader/bin/x86/Debug/Crunchyroll Downloader.pdb index 9692a09..bd59a24 100644 Binary files a/Crunchyroll Downloader/bin/x86/Debug/Crunchyroll Downloader.pdb and b/Crunchyroll Downloader/bin/x86/Debug/Crunchyroll Downloader.pdb differ diff --git a/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.exe b/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.exe index d1b1fff..bde00f1 100644 Binary files a/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.exe and b/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.exe differ diff --git a/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.pdb b/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.pdb index 9692a09..bd59a24 100644 Binary files a/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.pdb and b/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.pdb differ diff --git a/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.vbproj.GenerateResource.cache b/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.vbproj.GenerateResource.cache index 3a14363..a85e464 100644 Binary files a/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.vbproj.GenerateResource.cache and b/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll Downloader.vbproj.GenerateResource.cache differ diff --git a/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll_Downloader.Resources.resources b/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll_Downloader.Resources.resources index 61d8667..5106fc9 100644 Binary files a/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll_Downloader.Resources.resources and b/Crunchyroll Downloader/obj/x86/Debug/Crunchyroll_Downloader.Resources.resources differ diff --git a/Crunchyroll Downloader/obj/x86/Debug/TempPE/My Project.Resources.Designer.vb.dll b/Crunchyroll Downloader/obj/x86/Debug/TempPE/My Project.Resources.Designer.vb.dll index acdd863..bfa44b3 100644 Binary files a/Crunchyroll Downloader/obj/x86/Debug/TempPE/My Project.Resources.Designer.vb.dll and b/Crunchyroll Downloader/obj/x86/Debug/TempPE/My Project.Resources.Designer.vb.dll differ