diff --git a/.vs/Crunchyroll Downloader/v17/.suo b/.vs/Crunchyroll Downloader/v17/.suo index 09dd541..37ffb1e 100644 Binary files a/.vs/Crunchyroll Downloader/v17/.suo and b/.vs/Crunchyroll Downloader/v17/.suo differ diff --git a/Crunchyroll Downloader/Browser.vb b/Crunchyroll Downloader/Browser.vb index 46efc58..ba0d67f 100644 --- a/Crunchyroll Downloader/Browser.vb +++ b/Crunchyroll Downloader/Browser.vb @@ -20,6 +20,7 @@ Public Class Browser Private Sub WebView2_CoreWebView2InitializationCompleted(sender As Object, e As CoreWebView2InitializationCompletedEventArgs) Handles WebView2.CoreWebView2InitializationCompleted WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.crunchyroll.com/*", CoreWebView2WebResourceContext.All) WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.funimation.com/*", CoreWebView2WebResourceContext.All) + 'WebView2.CoreWebView2.AddWebResourceRequestedFilter("https://www.crunchyroll.com/*", CoreWebView2WebResourceContext.All) 'WebView2.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All) diff --git a/Crunchyroll Downloader/ErrorDialog.Designer.vb b/Crunchyroll Downloader/ErrorDialog.Designer.vb index 7850ba2..bd3fa90 100644 --- a/Crunchyroll Downloader/ErrorDialog.Designer.vb +++ b/Crunchyroll Downloader/ErrorDialog.Designer.vb @@ -22,11 +22,13 @@ Partial Class ErrorDialog 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() Me.ComboBox1 = New MetroFramework.Controls.MetroComboBox() Me.pictureBox3 = New System.Windows.Forms.PictureBox() Me.GroupBox3 = New System.Windows.Forms.GroupBox() Me.PictureBox9 = New System.Windows.Forms.PictureBox() Me.StatusLabel = New MetroFramework.Controls.MetroLabel() + Me.Delay = New System.Windows.Forms.Timer(Me.components) CType(Me.pictureBox3, System.ComponentModel.ISupportInitialize).BeginInit() Me.GroupBox3.SuspendLayout() CType(Me.PictureBox9, System.ComponentModel.ISupportInitialize).BeginInit() @@ -50,7 +52,7 @@ Partial Class ErrorDialog Me.pictureBox3.BackColor = System.Drawing.Color.Transparent Me.pictureBox3.Cursor = System.Windows.Forms.Cursors.Hand Me.pictureBox3.Image = Global.Crunchyroll_Downloader.My.Resources.Resources.main_close - Me.pictureBox3.Location = New System.Drawing.Point(329, 1) + Me.pictureBox3.Location = New System.Drawing.Point(333, -3) Me.pictureBox3.Name = "pictureBox3" Me.pictureBox3.Size = New System.Drawing.Size(50, 40) Me.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize @@ -63,7 +65,7 @@ Partial Class ErrorDialog Me.GroupBox3.Controls.Add(Me.PictureBox9) Me.GroupBox3.Controls.Add(Me.StatusLabel) Me.GroupBox3.Controls.Add(Me.ComboBox1) - Me.GroupBox3.Location = New System.Drawing.Point(13, 43) + Me.GroupBox3.Location = New System.Drawing.Point(13, 60) Me.GroupBox3.Name = "GroupBox3" Me.GroupBox3.Size = New System.Drawing.Size(354, 203) Me.GroupBox3.TabIndex = 38 @@ -98,6 +100,10 @@ Partial Class ErrorDialog Me.StatusLabel.Text = "Status: idle" Me.StatusLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' + 'Delay + ' + Me.Delay.Interval = 2000 + ' 'ErrorDialog ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -106,6 +112,7 @@ Partial Class ErrorDialog Me.Controls.Add(Me.GroupBox3) Me.Controls.Add(Me.pictureBox3) Me.Name = "ErrorDialog" + Me.Text = "CRD-Dialog-Box" CType(Me.pictureBox3, System.ComponentModel.ISupportInitialize).EndInit() Me.GroupBox3.ResumeLayout(False) Me.GroupBox3.PerformLayout() @@ -119,4 +126,5 @@ Partial Class ErrorDialog Private WithEvents PictureBox9 As PictureBox Friend WithEvents ComboBox1 As MetroFramework.Controls.MetroComboBox Public WithEvents StatusLabel As MetroFramework.Controls.MetroLabel + Friend WithEvents Delay As Timer End Class diff --git a/Crunchyroll Downloader/ErrorDialog.resx b/Crunchyroll Downloader/ErrorDialog.resx index 1af7de1..2c036a2 100644 --- a/Crunchyroll Downloader/ErrorDialog.resx +++ b/Crunchyroll Downloader/ErrorDialog.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/Crunchyroll Downloader/ErrorDialog.vb b/Crunchyroll Downloader/ErrorDialog.vb index d76d5e2..66e13b2 100644 --- a/Crunchyroll Downloader/ErrorDialog.vb +++ b/Crunchyroll Downloader/ErrorDialog.vb @@ -7,8 +7,10 @@ Public Class ErrorDialog Private Sub Reso_Load(sender As Object, e As EventArgs) Handles MyBase.Load + 'Me.TopMost = True Manager.Owner = Me Me.StyleManager = Manager + pictureBox3.Image = Main.CloseImg ComboBox1.Text = Nothing @@ -97,7 +99,7 @@ Public Class ErrorDialog End Try End If - + Delay.Enabled = True End Sub Private Sub SurroundingSub() @@ -208,4 +210,16 @@ Public Class ErrorDialog PictureBox9.Cursor = Cursors.Hand End Sub + Private Sub Delay_Tick(sender As Object, e As EventArgs) Handles Delay.Tick + + Try + Dim hwnd As IntPtr = FindWindow(Nothing, Me.Text) + SetForegroundWindow(hwnd) + + Catch ex As Exception + MsgBox(ex.ToString) + End Try + 'MsgBox(Me.Text) + Delay.Enabled = False + End Sub End Class \ No newline at end of file diff --git a/Crunchyroll Downloader/GetData.vb b/Crunchyroll Downloader/GetData.vb index 5caa5ec..0b1ffd6 100644 --- a/Crunchyroll Downloader/GetData.vb +++ b/Crunchyroll Downloader/GetData.vb @@ -189,6 +189,7 @@ Module GetData Loop Until Proc.HasExited Or Microsoft.VisualBasic.DateAndTime.Timer < finish + If CurlOutput = Nothing Or CBool(InStr(CurlOutput, "curl")) Then Throw New System.Exception("Error - Getting ObjectJson data" + vbNewLine + CurlOutput) Return Nothing diff --git a/Crunchyroll Downloader/Main.vb b/Crunchyroll Downloader/Main.vb index a7de826..2a6e7a5 100644 --- a/Crunchyroll Downloader/Main.vb +++ b/Crunchyroll Downloader/Main.vb @@ -1485,8 +1485,10 @@ Public Class Main ChaptersJson = Nothing Debug.WriteLine("no Chapter data... ignoring") End If - If ChaptersJson IsNot Nothing Then + + If ChaptersJson IsNot Nothing Then + 'MsgBox(ChaptersJson) Dim StartTime As String() = ChaptersJson.Split(New String() {Chr(34) + "startTime" + Chr(34) + ": "}, System.StringSplitOptions.RemoveEmptyEntries) Dim StartTime2 As String() = StartTime(1).Split(New String() {","}, System.StringSplitOptions.RemoveEmptyEntries) Dim StartTime3 As String() = StartTime2(0).Split(New String() {"."}, System.StringSplitOptions.RemoveEmptyEntries) @@ -1497,7 +1499,8 @@ Public Class Main Next Dim StartTime_ms As String = StartTime3(0) + StartTime4 - + ' + Dim StartTime_int As Integer = CInt(StartTime_ms) Dim EndTime As String() = ChaptersJson.Split(New String() {Chr(34) + "endTime" + Chr(34) + ": "}, System.StringSplitOptions.RemoveEmptyEntries) Dim EndTime2 As String() = EndTime(1).Split(New String() {","}, System.StringSplitOptions.RemoveEmptyEntries) @@ -1517,15 +1520,20 @@ Public Class Main Dim AfterTime_ms As String = EndTime3(0) + AfterTime Dim Metadata As String = Nothing + If CInt(CR_episode_duration_ms) < CInt(StartTime_ms) Then 'Totaly invalid... + ElseIf CInt(CR_episode_duration_ms) < CInt(EndTime_ms) And StartTime_int = 0 Then + 'the answer is 42... + Debug.WriteLine("Skip Chapters, the answer is 42...") + 'this is pointless ElseIf CInt(CR_episode_duration_ms) < CInt(EndTime_ms) Then 'it's not an Intro it's an outro - Dim DeCh As Integer = CInt(StartTime_ms) - 1 - Metadata = My.Resources.ffmpeg_metadata_out.Replace("[Titel]", CR_FilenName).Replace("[Start-1]", DeCh.ToString).Replace("[Start]", StartTime_ms).Replace("[duration_ms]", CR_episode_duration_ms) + Dim DeCh As Integer = StartTime_int - 1 + Metadata = My.Resources.ffmpeg_metadata_out.Replace("[Start-1]", DeCh.ToString).Replace("[Start]", StartTime_ms).Replace("[duration_ms]", CR_episode_duration_ms) Else - Metadata = My.Resources.ffmpeg_metadata.Replace("[Titel]", CR_FilenName).Replace("[Start]", StartTime_ms).Replace("[END]", EndTime_ms).Replace("[after]", AfterTime_ms).Replace("[duration_ms]", CR_episode_duration_ms) + Metadata = My.Resources.ffmpeg_metadata.Replace("[Start]", StartTime_ms).Replace("[END]", EndTime_ms).Replace("[after]", AfterTime_ms).Replace("[duration_ms]", CR_episode_duration_ms) End If @@ -4235,9 +4243,10 @@ Public Class Main Sub FillArray() ' LangValueEnum.Add(New NameValuePair("[ null ]", "", Nothing)) - LangValueEnum.Add(New NameValuePair("Deutsch", "de-DE", Nothing)) + LangValueEnum.Add(New NameValuePair("Deutsch", "de-DE", Nothing)) ' LangValueEnum.Add(New NameValuePair("English", "en-US", "en")) LangValueEnum.Add(New NameValuePair("Português (Brasil)", "pt-BR", "pt")) + LangValueEnum.Add(New NameValuePair("Português (Portugal)", "pt-PT", Nothing)) LangValueEnum.Add(New NameValuePair("Español (LA)", "es-419", "es")) LangValueEnum.Add(New NameValuePair("Français (France)", "fr-FR", Nothing)) LangValueEnum.Add(New NameValuePair("العربية (Arabic)", "ar-SA", Nothing)) @@ -4488,6 +4497,7 @@ Public Class Main ObjectJson = CurlAuthNew(ObjectsUrl, Loc_CR_Cookies, Auth2) Catch ex As Exception + If CBool(InStr(ex.ToString, "Error - Getting")) Then MsgBox("Error invalid CR respone") Exit Sub diff --git a/Crunchyroll Downloader/My Project/Resources.Designer.vb b/Crunchyroll Downloader/My Project/Resources.Designer.vb index 661faa3..bf9c289 100644 --- a/Crunchyroll Downloader/My Project/Resources.Designer.vb +++ b/Crunchyroll Downloader/My Project/Resources.Designer.vb @@ -338,7 +338,6 @@ Namespace My.Resources ''' ''' Sucht eine lokalisierte Zeichenfolge, die ;FFMETADATA1 - '''title=[Titel] ''' '''[CHAPTER] '''TIMEBASE=1/1000 @@ -359,7 +358,6 @@ Namespace My.Resources ''' ''' Sucht eine lokalisierte Zeichenfolge, die ;FFMETADATA1 - '''title=[Titel] ''' '''[CHAPTER] '''TIMEBASE=1/1000 diff --git a/Crunchyroll Downloader/My Project/Resources.resx b/Crunchyroll Downloader/My Project/Resources.resx index f6bfe99..d42320e 100644 --- a/Crunchyroll Downloader/My Project/Resources.resx +++ b/Crunchyroll Downloader/My Project/Resources.resx @@ -531,7 +531,6 @@ Dialogue: 0,0:00:00.00,0:00:00.00,Default,,0000,0000,0000,,some ideas on how tem ;FFMETADATA1 -title=[Titel] [CHAPTER] TIMEBASE=1/1000 @@ -546,7 +545,6 @@ END=[duration_ms] ;FFMETADATA1 -title=[Titel] [CHAPTER] TIMEBASE=1/1000 diff --git a/Crunchyroll Downloader/Subfolder.vb b/Crunchyroll Downloader/Subfolder.vb index 3769338..36f7db3 100644 --- a/Crunchyroll Downloader/Subfolder.vb +++ b/Crunchyroll Downloader/Subfolder.vb @@ -239,6 +239,9 @@ Module Subfolder End Function + Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As IntPtr) As IntPtr + + Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr End Module