2021-09-20 20:37:57 +02:00
Option Strict On
2019-11-10 00:16:12 +01:00
Imports Microsoft . Win32
Imports System . Net
2020-06-10 17:34:27 +02:00
Imports System . IO
Imports System . Text
2020-08-16 23:27:48 +02:00
Imports System . Threading
2020-11-13 15:57:34 +01:00
Imports MetroFramework . Forms
Imports MetroFramework
Imports MetroFramework . Components
2021-02-12 13:44:17 +01:00
Imports System . Text . RegularExpressions
2019-11-10 00:16:12 +01:00
2020-12-02 21:01:30 +01:00
Public Class Einstellungen
2020-11-13 15:57:34 +01:00
Inherits MetroForm
2020-12-10 19:18:20 +01:00
Dim Manager As MetroStyleManager = Main . Manager
2021-05-23 22:27:56 +02:00
Dim LastVersionString As String = " v3.8-Beta "
2020-12-10 19:18:20 +01:00
2023-02-16 20:56:58 +01:00
Public CR_SoftSubsTemp As New List ( Of String )
2023-06-17 17:23:31 +02:00
Dim TempCheckSubMod1 As Boolean = False
2023-06-24 23:50:39 +02:00
Dim TempVTTStyle As Boolean = False
2023-02-16 20:56:58 +01:00
2020-12-02 21:01:30 +01:00
Private Sub Einstellungen_Load ( sender As Object , e As EventArgs ) Handles MyBase . Load
2021-01-14 18:06:42 +01:00
2022-12-02 18:43:43 +01:00
Label6 . Text = " You have: v " + Application . ProductVersion . ToString '+ " WebView2_Test"
2021-09-20 20:37:57 +02:00
2021-01-16 14:08:33 +01:00
BackgroundWorker1 . RunWorkerAsync ( )
2021-01-14 18:06:42 +01:00
'CR_Anime_Folge = CR_Name_Staffel0_Folge1(1)
'If GitHubLastTag1(0)
2023-02-16 20:56:58 +01:00
CR_SoftSubsTemp . AddRange ( Main . SoftSubs )
2021-01-14 18:06:42 +01:00
2020-12-08 19:01:35 +01:00
Manager . Owner = Me
2020-12-10 19:18:20 +01:00
Me . StyleManager = Manager
2021-09-20 20:37:57 +02:00
2023-03-21 16:48:10 +01:00
CB_OverrideDub . Checked = My . Settings . OverrideDub
CB_Cap . Checked = My . Settings . Captions
2021-09-20 20:37:57 +02:00
2023-06-19 20:17:59 +02:00
CB_Mod1 . Checked = My . Settings . SubtitleMod1
2023-07-11 18:53:50 +02:00
CB_vttStyle . Checked = My . Settings . vttStyleRemove
2023-06-24 23:50:39 +02:00
2022-03-19 12:01:12 +01:00
TempTB . Text = Main . TempFolder
2021-12-20 18:10:51 +01:00
LeadingZeroDD . SelectedIndex = Main . LeadingZero
2021-12-31 14:21:19 +01:00
Bitrate_Funi . SelectedIndex = Main . Funimation_Bitrate
2022-06-24 16:11:21 +02:00
CB_Ignore . SelectedIndex = Main . IgnoreSeason
2021-09-20 20:37:57 +02:00
2023-02-09 13:24:51 +01:00
CB_HideSF . SelectedIndex = Main . HideFLInt
2021-09-20 20:37:57 +02:00
If Main . IncludeLangName = True Then
CB_SoftSubSettings . SelectedIndex = 1
Else
CB_SoftSubSettings . SelectedIndex = 0
End If
2022-01-23 15:34:33 +01:00
If Main . LangNameType = 1 Then
LangNameType_DD . SelectedIndex = 1
ElseIf Main . LangNameType = 2 Then
LangNameType_DD . SelectedIndex = 2
Else
LangNameType_DD . SelectedIndex = 0
End If
2021-05-23 22:27:56 +02:00
If Main . KodiNaming = True Then
2023-01-07 19:04:56 +01:00
CB_Kodi . Checked = True
2021-05-23 22:27:56 +02:00
End If
2020-12-08 19:01:35 +01:00
2022-08-05 15:12:25 +02:00
If Main . DubMode = True Then
DubMode . Checked = True
End If
2022-10-25 18:05:57 +02:00
If Main . CR_Chapters = True Then
ChB_Chapters . Checked = True
End If
2022-10-26 09:39:24 +02:00
If Main . Curl_insecure = True Then
Chb_Ign_tls . Checked = True
End If
2020-12-10 19:18:20 +01:00
If Main . DarkModeValue = True Then
DarkMode . Checked = True
GroupBoxColor ( Color . FromArgb ( 150 , 150 , 150 ) )
pictureBox1 . Image = Main . CloseImg
Else
GroupBoxColor ( Color . FromArgb ( 0 , 0 , 0 ) )
DarkMode . Checked = False
End If
2020-12-08 19:01:35 +01:00
2020-11-13 15:57:34 +01:00
TabControl1 . SelectedIndex = 0
2023-02-16 20:56:58 +01:00
#Region "sof subs"
CR_SoftSubDefault . SelectedIndex = 0
For i As Integer = 1 To Main . LangValueEnum . Count - 2 ' index 0 = 'null' | last index = jp
If Main . SoftSubs . Contains ( Main . LangValueEnum ( i ) . CR_Value ) Then
2023-09-10 16:28:23 +02:00
CR_SoftSubDefault . Items . Add ( Main . LangValueEnum ( i ) . DisplayText )
2023-02-16 20:56:58 +01:00
2020-02-02 16:39:54 +01:00
End If
2023-02-16 20:56:58 +01:00
2020-02-02 16:39:54 +01:00
Next
2023-02-16 20:56:58 +01:00
CR_SoftSubs . SelectedIndex = 0
#End Region
2020-11-19 22:28:42 +01:00
For i As Integer = 0 To Main . SubFunimation . Count - 1
If Main . SubFunimation ( i ) = " en " Then
CB_fun_eng . Checked = True
ElseIf Main . SubFunimation ( i ) = " es " Then
CB_fun_es . Checked = True
ElseIf Main . SubFunimation ( i ) = " pt " Then
CB_fun_ptbr . Checked = True
End If
2023-01-01 20:47:09 +01:00
2023-02-16 20:56:58 +01:00
Next
2021-09-20 20:37:57 +02:00
Me . Location = New Point ( CInt ( Main . Location . X + Main . Width / 2 - Me . Width / 2 ) , CInt ( Main . Location . Y + Main . Height / 2 - Me . Height / 2 ) )
2020-11-13 15:57:34 +01:00
Try
Me . Icon = My . Resources . icon
Catch ex As Exception
End Try
2022-01-23 15:34:33 +01:00
If Main . HybridMode = True And Main . KeepCache = True Then
DD_DLMode . SelectedIndex = 2
ElseIf Main . HybridMode = True Then
DD_DLMode . SelectedIndex = 1
Else
DD_DLMode . SelectedIndex = 0
2020-09-30 18:19:31 +02:00
End If
2020-11-21 14:56:27 +01:00
If Main . Funimation_srt = True Then
CB_srt . Checked = True
Else
CB_srt . Checked = False
End If
If Main . Funimation_vtt = True Then
CB_vtt . Checked = True
Else
CB_vtt . Checked = False
End If
2020-11-19 22:28:42 +01:00
If Main . HardSubFunimation = " en " Then
CB_Fun_HardSubs . SelectedItem = " English "
ElseIf Main . HardSubFunimation = " pt " Then
CB_Fun_HardSubs . SelectedItem = " Português (Brasil) "
ElseIf Main . HardSubFunimation = " es " Then
CB_Fun_HardSubs . SelectedItem = " Español (LA) "
Else
CB_Fun_HardSubs . SelectedItem = " Disabled "
'FunimationHardsub.Checked = True
End If
2021-03-08 21:08:26 +01:00
If Main . VideoFormat = " .mkv " Then
CB_Format . SelectedItem = " MKV "
2021-06-04 15:25:59 +02:00
ElseIf Main . VideoFormat = " .aac " Then
CB_Format . SelectedItem = " AAC (Audio only) "
2021-03-08 21:08:26 +01:00
Else
CB_Format . SelectedItem = " MP4 "
End If
2020-11-19 22:28:42 +01:00
If Main . DubFunimation = " english " Then
Fun_Dub_Over . SelectedItem = " english "
ElseIf Main . DubFunimation = " japanese " Then
Fun_Dub_Over . SelectedItem = " japanese "
ElseIf Main . DubFunimation = " portuguese(Brazil) " Then
Fun_Dub_Over . SelectedItem = " portuguese(Brazil) "
ElseIf Main . DubFunimation = " spanish(Mexico) " Then
Fun_Dub_Over . SelectedItem = " spanish(Mexico) "
Else
Fun_Dub_Over . SelectedItem = " Disabled "
2020-06-10 17:34:27 +02:00
End If
2020-09-30 18:19:31 +02:00
2021-03-08 21:08:26 +01:00
2019-11-10 00:16:12 +01:00
Try
GB_Resolution . Text = Main . GB_Resolution_Text
GB_SubLanguage . Text = Main . GB_SubLanguage_Text
DL_Count_simultaneous . Text = Main . DL_Count_simultaneousText
Catch ex As Exception
End Try
2020-11-13 15:57:34 +01:00
If Main . Reso = 1080 Then
2019-11-10 00:16:12 +01:00
A1080p . Checked = True
2020-11-13 15:57:34 +01:00
ElseIf Main . Reso = 720 Then
2019-11-10 00:16:12 +01:00
A720p . Checked = True
2020-11-13 15:57:34 +01:00
ElseIf Main . Reso = 480 Then
2019-11-10 00:16:12 +01:00
A480p . Checked = True
2020-11-13 15:57:34 +01:00
ElseIf Main . Reso = 360 Then
2019-11-10 00:16:12 +01:00
A360p . Checked = True
2020-11-13 15:57:34 +01:00
ElseIf Main . Reso = 42 Then
2019-12-29 16:44:16 +01:00
AAuto . Checked = True
2019-11-10 00:16:12 +01:00
End If
2021-12-19 13:38:19 +01:00
2023-01-13 14:05:30 +01:00
CB_CR_Harsubs . Items . Clear ( )
2023-01-10 17:04:41 +01:00
2023-06-09 16:15:24 +02:00
For i As Integer = 0 To Main . LangValueEnum . Count - 2
2023-09-10 16:28:23 +02:00
CB_CR_Harsubs . Items . Add ( Main . LangValueEnum ( i ) . DisplayText )
2023-01-21 11:21:39 +01:00
If Main . LangValueEnum ( i ) . CR_Value = Main . SubSprache . CR_Value Then
'MsgBox(CB_CR_Harsubs.Items.Count.ToString)
'MsgBox(i.ToString)
CB_CR_Harsubs . SelectedIndex = i
'Exit For
End If
2023-01-10 17:04:41 +01:00
2023-01-21 11:21:39 +01:00
Next
2022-12-29 11:45:55 +01:00
2020-12-02 21:01:30 +01:00
2023-01-21 11:21:39 +01:00
CB_CR_Audio . Items . Clear ( )
2023-01-13 14:05:30 +01:00
2023-01-21 11:21:39 +01:00
For i As Integer = 1 To Main . LangValueEnum . Count - 1
2023-09-10 16:28:23 +02:00
CB_CR_Audio . Items . Add ( Main . LangValueEnum ( i ) . DisplayText )
2023-01-21 11:21:39 +01:00
If Main . LangValueEnum ( i ) . CR_Value = Main . DubSprache . CR_Value Then
CB_CR_Audio . SelectedIndex = i - 1
End If
Next
DD_Season_Prefix . Text = Main . Season_Prefix
2023-01-05 14:26:40 +01:00
DD_Episode_Prefix . Text = Main . Episode_Prefix
2021-02-07 13:47:30 +01:00
2020-11-05 20:43:52 +01:00
NumericUpDown2 . Value = Main . ErrorTolerance
2019-11-10 00:16:12 +01:00
NumericUpDown1 . Value = Main . MaxDL
2019-12-22 16:15:17 +01:00
TextBox1 . Text = Main . Startseite
2020-02-12 22:08:02 +01:00
2023-01-26 21:01:15 +01:00
Try
If CBool ( InStr ( Main . ffmpeg_command , " -c copy " ) ) Then
FFMPEG_CommandP1 . Text = " -c copy "
FFMPEG_CommandP2 . Enabled = False
FFMPEG_CommandP3 . Enabled = False
2021-05-23 22:27:56 +02:00
FFMPEG_CommandP4 . Text = " -c:a copy -bsf:a aac_adtstoasc "
2023-01-26 21:01:15 +01:00
ElseIf CBool ( InStr ( Main . ffmpeg_command , " -c:a copy " ) ) Then
Dim ffmpegDisplayCurrent As String ( ) = Main . ffmpeg_command . Split ( New String ( ) { " " } , System . StringSplitOptions . RemoveEmptyEntries )
If ffmpegDisplayCurrent . Count > 8 Then
FFMPEG_CommandP1 . Text = ffmpegDisplayCurrent ( 0 ) + " " + ffmpegDisplayCurrent ( 1 )
FFMPEG_CommandP2 . Text = ffmpegDisplayCurrent ( 2 ) + " " + ffmpegDisplayCurrent ( 3 )
FFMPEG_CommandP3 . Text = ffmpegDisplayCurrent ( 4 ) + " " + ffmpegDisplayCurrent ( 5 )
FFMPEG_CommandP4 . Text = " -c:a copy -bsf:a aac_adtstoasc "
Else
FFMPEG_CommandP1 . Text = ffmpegDisplayCurrent ( 0 ) + " " + ffmpegDisplayCurrent ( 1 )
FFMPEG_CommandP2 . Text = " [no Preset] "
FFMPEG_CommandP3 . Text = ffmpegDisplayCurrent ( 2 ) + " " + ffmpegDisplayCurrent ( 3 )
FFMPEG_CommandP4 . Text = " -c:a copy -bsf:a aac_adtstoasc "
End If
2021-05-23 22:27:56 +02:00
Else
2023-01-26 21:01:15 +01:00
Dim ffmpegDisplayCurrent As String ( ) = Main . ffmpeg_command . Split ( New String ( ) { " " } , System . StringSplitOptions . RemoveEmptyEntries )
2021-05-23 22:27:56 +02:00
FFMPEG_CommandP1 . Text = ffmpegDisplayCurrent ( 0 ) + " " + ffmpegDisplayCurrent ( 1 )
2023-01-26 21:01:15 +01:00
FFMPEG_CommandP2 . Text = ffmpegDisplayCurrent ( 2 ) + " " + ffmpegDisplayCurrent ( 3 )
FFMPEG_CommandP3 . Text = ffmpegDisplayCurrent ( 4 ) + " " + ffmpegDisplayCurrent ( 5 )
2021-05-23 22:27:56 +02:00
FFMPEG_CommandP4 . Text = " -c:a copy -bsf:a aac_adtstoasc "
End If
2023-01-26 21:01:15 +01:00
If FFMPEG_CommandP1 . Text = " -c:v libsvtav1 " And FFMPEG_CommandP2 . Text = " [no Preset] " Then
FFMPEG_CommandP2 . Enabled = False
FFMPEG_CommandP3 . Enabled = True
End If
2021-02-12 13:44:17 +01:00
2023-01-26 21:01:15 +01:00
Catch ex As Exception
MsgBox ( " Error processing ffmpeg command " , MsgBoxStyle . Information )
End Try
2022-11-10 14:31:11 +01:00
ListViewAdd_True . Checked = Main . UseQueue
2021-02-12 13:44:17 +01:00
2022-11-10 14:31:11 +01:00
If Main . StartServer = 0 Then
2021-02-28 13:22:00 +01:00
http_support . Text = " add-on support disabled "
2022-11-10 14:31:11 +01:00
Else
http_support . Text = Main . StartServer . ToString
End If
2021-02-28 13:22:00 +01:00
2021-02-20 18:25:49 +01:00
If Main . DefaultSubFunimation = " en " Then
FunSubDef . SelectedItem = " English "
ElseIf Main . DefaultSubFunimation = " pt " Then
FunSubDef . SelectedItem = " Português (Brasil) "
ElseIf Main . DefaultSubFunimation = " es " Then
FunSubDef . SelectedItem = " Español (LA) "
Else
FunSubDef . SelectedItem = " [Disabled] "
'FunimationHardsub.Checked = True
End If
2022-12-29 11:45:55 +01:00
If Main . DefaultSubCR = " de-DE " Then
2021-02-20 18:25:49 +01:00
CR_SoftSubDefault . SelectedItem = " Deutsch "
2022-12-29 11:45:55 +01:00
ElseIf Main . DefaultSubCR = " en-US " Then
2021-02-20 18:25:49 +01:00
CR_SoftSubDefault . SelectedItem = " English "
2022-12-29 11:45:55 +01:00
ElseIf Main . DefaultSubCR = " pt-BR " Then
2021-02-20 18:25:49 +01:00
CR_SoftSubDefault . SelectedItem = " Português (Brasil) "
2022-12-29 11:45:55 +01:00
ElseIf Main . DefaultSubCR = " es-419 " Then
2021-02-20 18:25:49 +01:00
CR_SoftSubDefault . SelectedItem = " Español (LA) "
2022-12-29 11:45:55 +01:00
ElseIf Main . DefaultSubCR = " fr-FR " Then
2021-02-20 18:25:49 +01:00
CR_SoftSubDefault . SelectedItem = " Français (France) "
2023-01-01 16:34:18 +01:00
ElseIf Main . DefaultSubCR = " ar-SA " Then
2021-02-20 18:25:49 +01:00
CR_SoftSubDefault . SelectedItem = " العربية (Arabic) "
2022-12-29 11:45:55 +01:00
ElseIf Main . DefaultSubCR = " ru-RU " Then
2021-02-20 18:25:49 +01:00
CR_SoftSubDefault . SelectedItem = " Русский (Russian) "
2022-12-29 11:45:55 +01:00
ElseIf Main . DefaultSubCR = " it-IT " Then
2021-02-20 18:25:49 +01:00
CR_SoftSubDefault . SelectedItem = " Italiano (Italian) "
2022-12-29 11:45:55 +01:00
ElseIf Main . DefaultSubCR = " es-ES " Then
2021-02-20 18:25:49 +01:00
CR_SoftSubDefault . SelectedItem = " Español (España) "
Else
CR_SoftSubDefault . SelectedItem = " [Disabled] "
End If
2023-01-01 20:47:09 +01:00
Dim NameParts As String ( ) = Main . NameBuilder . Split ( New String ( ) { " ; " } , System . StringSplitOptions . RemoveEmptyEntries )
2023-01-05 14:26:40 +01:00
2023-01-01 20:47:09 +01:00
For i As Integer = 0 To NameParts . Count - 1
If NameParts ( i ) = " AnimeTitle " Then
CB_Anime . Checked = True
ElseIf NameParts ( i ) = " Season " Then
CB_Season . Checked = True
ElseIf NameParts ( i ) = " EpisodeNR " Then
CB_EpisodeNR . Checked = True
ElseIf NameParts ( i ) = " EpisodeName " Then
CB_EpisodeName . Checked = True
ElseIf NameParts ( i ) = " AnimeDub " Then
CB_AnimeDub . Checked = True
End If
Next
2023-01-07 19:04:56 +01:00
2023-01-05 14:26:40 +01:00
2023-01-01 20:47:09 +01:00
2019-11-10 00:16:12 +01:00
End Sub
2021-09-20 20:37:57 +02:00
Private Sub Btn_Save_Click ( sender As Object , e As EventArgs ) Handles Btn_Save . Click
2021-12-20 18:10:51 +01:00
Main . LeadingZero = LeadingZeroDD . SelectedIndex
2022-11-10 14:31:11 +01:00
My . Settings . LeadingZero = LeadingZeroDD . SelectedIndex
2023-03-21 16:48:10 +01:00
My . Settings . OverrideDub = CB_OverrideDub . Checked
My . Settings . Captions = CB_Cap . Checked
2021-12-31 14:21:19 +01:00
Main . Funimation_Bitrate = Bitrate_Funi . SelectedIndex
2022-11-10 14:31:11 +01:00
My . Settings . Funimation_Bitrate = Bitrate_Funi . SelectedIndex
2021-12-31 14:21:19 +01:00
2021-02-12 13:44:17 +01:00
If http_support . Text = " add-on support disabled " Then
2022-11-10 14:31:11 +01:00
My . Settings . ServerPort = 0
2021-09-20 20:37:57 +02:00
Main . StartServer = CInt ( False )
2021-02-12 13:44:17 +01:00
Else
Dim Port As Integer = 0
Try
Port = CInt ( http_support . Text )
2022-11-10 14:31:11 +01:00
My . Settings . ServerPort = Port
2021-02-12 13:44:17 +01:00
Catch ex As Exception
2021-02-28 13:22:00 +01:00
2021-02-12 13:44:17 +01:00
MsgBox ( " The add-on support Port can only be numbers! " , MsgBoxStyle . Exclamation )
2022-11-10 14:31:11 +01:00
'Exit Sub
2021-02-12 13:44:17 +01:00
End Try
2021-06-20 19:02:55 +02:00
If Main . StartServer = Port Then
Else
MsgBox ( " The add-on support needs a restart of the downloader. " , MsgBoxStyle . Information )
End If
2021-02-12 13:44:17 +01:00
End If
2021-06-20 19:02:55 +02:00
2022-01-23 15:34:33 +01:00
2021-07-04 17:22:46 +02:00
2023-02-09 13:24:51 +01:00
Main . HideFLInt = CB_HideSF . SelectedIndex
My . Settings . HideSF = CB_HideSF . SelectedIndex
2021-09-20 20:37:57 +02:00
2022-06-24 16:11:21 +02:00
Main . IgnoreSeason = CB_Ignore . SelectedIndex
2022-11-10 14:31:11 +01:00
My . Settings . IgnoreSeason = CB_Ignore . SelectedIndex
2022-06-24 16:11:21 +02:00
2023-06-17 17:23:31 +02:00
My . Settings . SubtitleMod1 = CB_Mod1 . Checked
2023-06-24 23:50:39 +02:00
My . Settings . vttStyleRemove = CB_vttStyle . Checked
2021-07-04 17:22:46 +02:00
2022-08-05 15:12:25 +02:00
If DubMode . Checked = True Then
Main . DubMode = True
2022-11-10 14:31:11 +01:00
My . Settings . DubMode = True
2022-08-05 15:12:25 +02:00
Else
Main . DubMode = False
2022-11-10 14:31:11 +01:00
My . Settings . DubMode = False
2022-08-05 15:12:25 +02:00
End If
2022-10-25 18:05:57 +02:00
If ChB_Chapters . Checked = True Then
Main . CR_Chapters = True
2022-11-10 14:31:11 +01:00
My . Settings . CR_Chapters = True
2022-10-25 18:05:57 +02:00
Else
Main . CR_Chapters = False
2022-11-10 14:31:11 +01:00
My . Settings . CR_Chapters = False
2022-10-25 18:05:57 +02:00
End If
2022-10-26 09:39:24 +02:00
If Chb_Ign_tls . Checked = True Then
Main . Curl_insecure = True
2022-11-10 14:31:11 +01:00
My . Settings . Curl_insecure = True
2022-10-26 09:39:24 +02:00
Else
Main . Curl_insecure = False
2022-11-10 14:31:11 +01:00
My . Settings . Curl_insecure = False
2022-10-26 09:39:24 +02:00
End If
2023-01-07 19:04:56 +01:00
If CB_Kodi . Checked = True Then
2021-05-23 22:27:56 +02:00
Main . KodiNaming = True
2022-11-10 14:31:11 +01:00
My . Settings . KodiSupport = True
2021-05-23 22:27:56 +02:00
Else
Main . KodiNaming = False
2022-11-10 14:31:11 +01:00
My . Settings . KodiSupport = False
2021-05-23 22:27:56 +02:00
End If
2021-02-12 13:44:17 +01:00
' MsgBox(Name_season.Text)
2021-09-20 20:37:57 +02:00
If CBool ( InStr ( TextBox1 . Text , " https:// " ) ) Then
2019-12-22 16:15:17 +01:00
Main . Startseite = TextBox1 . Text
2022-11-10 14:31:11 +01:00
My . Settings . Startseite = Main . Startseite
2019-12-22 16:15:17 +01:00
ElseIf TextBox1 . Text = Nothing Then
Main . Startseite = " https://www.crunchyroll.com/ "
2022-11-10 14:31:11 +01:00
My . Settings . Startseite = Main . Startseite
2019-12-22 16:15:17 +01:00
Else
End If
2022-11-10 14:31:11 +01:00
If DD_Season_Prefix . Text IsNot " [default season prefix] " Then
2021-02-07 13:47:30 +01:00
Main . Season_Prefix = DD_Season_Prefix . Text
2022-11-10 14:31:11 +01:00
My . Settings . Prefix_S = Main . Season_Prefix
2021-02-07 13:47:30 +01:00
End If
2022-11-10 14:31:11 +01:00
If DD_Episode_Prefix . Text IsNot " [default episode prefix] " Then
2021-02-07 13:47:30 +01:00
Main . Episode_Prefix = DD_Episode_Prefix . Text
2022-11-10 14:31:11 +01:00
My . Settings . Prefix_E = Main . Episode_Prefix
2021-02-07 13:47:30 +01:00
End If
2019-11-10 00:16:12 +01:00
If A1080p . Checked Then
2020-11-13 15:57:34 +01:00
Main . Reso = 1080
2022-11-10 14:31:11 +01:00
My . Settings . Reso = Main . Reso
2019-11-10 00:16:12 +01:00
ElseIf A720p . Checked Then
2020-11-13 15:57:34 +01:00
Main . Reso = 720
2022-11-10 14:31:11 +01:00
My . Settings . Reso = Main . Reso
2019-11-10 00:16:12 +01:00
ElseIf A360p . Checked Then
2020-11-13 15:57:34 +01:00
Main . Reso = 360
2022-11-10 14:31:11 +01:00
My . Settings . Reso = Main . Reso
2019-11-10 00:16:12 +01:00
ElseIf A480p . Checked Then
2020-11-13 15:57:34 +01:00
Main . Reso = 480
2022-11-10 14:31:11 +01:00
My . Settings . Reso = Main . Reso
2019-12-29 16:44:16 +01:00
ElseIf AAuto . Checked Then
2020-11-13 15:57:34 +01:00
Main . Reso = 42
2022-11-10 14:31:11 +01:00
My . Settings . Reso = Main . Reso
2019-11-10 00:16:12 +01:00
End If
2020-11-13 15:57:34 +01:00
2022-12-29 11:45:55 +01:00
2023-01-21 11:21:39 +01:00
For i As Integer = 0 To Main . LangValueEnum . Count - 1
2022-12-29 11:45:55 +01:00
2023-09-10 16:28:23 +02:00
If CB_CR_Harsubs . SelectedItem . ToString = Main . LangValueEnum ( i ) . DisplayText Then
2023-01-21 11:21:39 +01:00
Main . SubSprache = Main . LangValueEnum ( i )
2022-12-29 11:45:55 +01:00
My . Settings . Subtitle = Main . SubSprache . CR_Value
2023-01-21 11:21:39 +01:00
'MsgBox(Main.LangValueEnum(i).Name)
'MsgBox(Main.LangValueEnum(i).CR_Value)
Exit For
End If
Next
For i As Integer = 0 To Main . LangValueEnum . Count - 1
2023-09-10 16:28:23 +02:00
If CB_CR_Audio . SelectedItem . ToString = Main . LangValueEnum ( i ) . DisplayText Then
2023-01-21 11:21:39 +01:00
Main . DubSprache = Main . LangValueEnum ( i )
My . Settings . CR_Dub = Main . DubSprache . CR_Value
2022-12-29 11:45:55 +01:00
Exit For
End If
Next
2020-11-21 14:56:27 +01:00
2023-01-10 17:04:41 +01:00
2021-02-20 18:25:49 +01:00
If CR_SoftSubDefault . SelectedItem . ToString = " English " Then
2023-01-01 16:34:18 +01:00
Main . DefaultSubCR = " en-US "
My . Settings . DefaultSubCR = Main . DefaultSubCR
ElseIf CR_SoftSubDefault . SelectedItem . ToString = " Deutsch " Then
Main . DefaultSubCR = " de-DE "
My . Settings . DefaultSubCR = Main . DefaultSubCR
ElseIf CR_SoftSubDefault . SelectedItem . ToString = " Português (Brasil) " Then
Main . DefaultSubCR = " pt-BR "
My . Settings . DefaultSubCR = Main . DefaultSubCR
ElseIf CR_SoftSubDefault . SelectedItem . ToString = " Español (LA) " Then
Main . DefaultSubCR = " es-419 "
My . Settings . DefaultSubCR = Main . DefaultSubCR
ElseIf CR_SoftSubDefault . SelectedItem . ToString = " Français (France) " Then
Main . DefaultSubCR = " fr-FR "
My . Settings . DefaultSubCR = Main . DefaultSubCR
ElseIf CR_SoftSubDefault . SelectedItem . ToString = " العربية (Arabic) " Then
Main . DefaultSubCR = " ar-SA "
My . Settings . DefaultSubCR = Main . DefaultSubCR
ElseIf CR_SoftSubDefault . SelectedItem . ToString = " Русский (Russian) " Then
Main . DefaultSubCR = " ru-RU "
My . Settings . DefaultSubCR = Main . DefaultSubCR
ElseIf CR_SoftSubDefault . SelectedItem . ToString = " Italiano (Italian) " Then
Main . DefaultSubCR = " it-IT "
My . Settings . DefaultSubCR = Main . DefaultSubCR
ElseIf CR_SoftSubDefault . SelectedItem . ToString = " Español (España) " Then
Main . DefaultSubCR = " es-ES "
My . Settings . DefaultSubCR = Main . DefaultSubCR
ElseIf CR_SoftSubDefault . SelectedItem . ToString = " [Disabled] " Then
Main . DefaultSubCR = " None "
My . Settings . DefaultSubCR = Main . DefaultSubCR
End If
2023-01-01 20:47:09 +01:00
Main . NameBuilder = TB_NameString . Text
2023-01-05 14:26:40 +01:00
My . Settings . NameTemplate = Main . NameBuilder
2020-11-21 14:56:27 +01:00
2021-03-08 21:08:26 +01:00
If CB_Format . Text = " MKV " Then
Main . VideoFormat = " .mkv "
2022-11-10 14:31:11 +01:00
My . Settings . VideoFormat = Main . VideoFormat
2021-06-04 15:25:59 +02:00
ElseIf CB_Format . Text = " AAC (Audio only) " Then
Main . VideoFormat = " .aac "
2022-11-10 14:31:11 +01:00
My . Settings . VideoFormat = Main . VideoFormat
2021-03-08 21:08:26 +01:00
Else
Main . VideoFormat = " .mp4 "
2022-11-10 14:31:11 +01:00
My . Settings . VideoFormat = Main . VideoFormat
2021-03-08 21:08:26 +01:00
End If
2022-09-06 21:20:05 +02:00
If CB_Merge . SelectedIndex > 0 Then
2021-03-08 21:08:26 +01:00
Main . MergeSubs = True
2022-09-06 21:20:05 +02:00
Main . MergeSubsFormat = CB_Merge . SelectedItem . ToString
2022-11-10 14:31:11 +01:00
My . Settings . MergeSubs = Main . MergeSubsFormat
2020-02-02 16:39:54 +01:00
Else
2022-09-06 21:20:05 +02:00
Main . MergeSubsFormat = CB_Merge . SelectedItem . ToString
2021-03-08 21:08:26 +01:00
Main . MergeSubs = False
2022-11-10 14:31:11 +01:00
My . Settings . MergeSubs = Main . MergeSubsFormat
2020-02-02 16:39:54 +01:00
End If
2022-01-23 15:34:33 +01:00
If DD_DLMode . SelectedIndex = 2 Then
2020-09-30 18:19:31 +02:00
Main . HybridMode = True
2022-01-23 15:34:33 +01:00
Main . KeepCache = True
2022-11-10 14:31:11 +01:00
My . Settings . HybridMode = Main . HybridMode
2022-01-23 15:34:33 +01:00
ElseIf DD_DLMode . SelectedIndex = 1 Then
Main . HybridMode = True
Main . KeepCache = False
2022-11-10 14:31:11 +01:00
My . Settings . HybridMode = Main . HybridMode
2020-09-30 18:19:31 +02:00
Else
Main . HybridMode = False
2022-01-23 15:34:33 +01:00
Main . KeepCache = False
2022-11-10 14:31:11 +01:00
My . Settings . HybridMode = Main . HybridMode
2020-09-30 18:19:31 +02:00
End If
2022-01-23 15:34:33 +01:00
2022-11-10 14:31:11 +01:00
My . Settings . Keep_Cache = Main . KeepCache
2022-01-23 15:34:33 +01:00
2020-11-19 22:28:42 +01:00
#Region "funimation"
2020-09-30 18:19:31 +02:00
2021-11-14 22:06:06 +01:00
2020-11-21 14:56:27 +01:00
2020-11-19 22:28:42 +01:00
Main . DubFunimation = Fun_Dub_Over . SelectedItem . ToString
2022-11-10 14:31:11 +01:00
My . Settings . FunimationDub = Main . DubFunimation
2020-11-19 22:28:42 +01:00
2022-11-10 14:31:11 +01:00
'If CB_Fun_HardSubs.SelectedItem.ToString = "Disabled" Then
' Main.HardSubFunimation = "Disabled"
' rk.SetValue("FunimationHardsub", "Disabled", RegistryValueKind.String)
2020-11-19 22:28:42 +01:00
2022-11-10 14:31:11 +01:00
'ElseIf CB_Fun_HardSubs.SelectedItem.ToString = "English" Then
' Main.HardSubFunimation = "en"
' rk.SetValue("FunimationHardsub", "en", RegistryValueKind.String)
2020-11-19 22:28:42 +01:00
2022-11-10 14:31:11 +01:00
'ElseIf CB_Fun_HardSubs.SelectedItem.ToString = "Português (Brasil)" Then
' Main.HardSubFunimation = "pt"
' rk.SetValue("FunimationHardsub", "pt", RegistryValueKind.String)
2020-11-19 22:28:42 +01:00
2022-11-10 14:31:11 +01:00
'ElseIf CB_Fun_HardSubs.SelectedItem.ToString = "Español (LA)" Then
' Main.HardSubFunimation = "es"
' rk.SetValue("FunimationHardsub", "es", RegistryValueKind.String)
'End If
2020-11-19 22:28:42 +01:00
2021-02-20 18:25:49 +01:00
If FunSubDef . SelectedItem . ToString = " [Disabled] " Then
Main . DefaultSubFunimation = " Disabled "
2022-11-10 14:31:11 +01:00
My . Settings . DefaultSubFunimation = Main . DefaultSubFunimation
2021-02-20 18:25:49 +01:00
ElseIf FunSubDef . SelectedItem . ToString = " English " Then
Main . DefaultSubFunimation = " en "
2022-11-10 14:31:11 +01:00
My . Settings . DefaultSubFunimation = Main . DefaultSubFunimation
2021-02-20 18:25:49 +01:00
ElseIf FunSubDef . SelectedItem . ToString = " Português (Brasil) " Then
Main . DefaultSubFunimation = " pt "
2022-11-10 14:31:11 +01:00
My . Settings . DefaultSubFunimation = Main . DefaultSubFunimation
2021-02-20 18:25:49 +01:00
ElseIf FunSubDef . SelectedItem . ToString = " Español (LA) " Then
Main . DefaultSubFunimation = " es "
2022-11-10 14:31:11 +01:00
My . Settings . DefaultSubFunimation = Main . DefaultSubFunimation
2021-02-20 18:25:49 +01:00
End If
2020-11-19 22:28:42 +01:00
Main . SubFunimation . Clear ( )
If CB_fun_eng . Checked = True Then
Main . SubFunimation . Add ( " en " )
End If
2021-11-14 22:06:06 +01:00
2020-11-19 22:28:42 +01:00
If CB_fun_es . Checked = True Then
Main . SubFunimation . Add ( " es " )
End If
2021-11-14 22:06:06 +01:00
2020-11-19 22:28:42 +01:00
If CB_fun_ptbr . Checked = True Then
Main . SubFunimation . Add ( " pt " )
End If
2021-11-14 22:06:06 +01:00
If Main . SubFunimation . Count > 0 And CB_vtt . Checked = False And CB_srt . Checked = False Then
CB_vtt . Checked = True
End If
If CB_srt . Checked = True Then
Main . Funimation_srt = True
2022-11-10 14:31:11 +01:00
My . Settings . Funimation_srt = True
2021-11-14 22:06:06 +01:00
Else
Main . Funimation_srt = False
2022-11-10 14:31:11 +01:00
My . Settings . Funimation_srt = False
2021-11-14 22:06:06 +01:00
End If
If CB_vtt . Checked = True Then
Main . Funimation_vtt = True
2022-11-10 14:31:11 +01:00
My . Settings . Funimation_vtt = True
2021-11-14 22:06:06 +01:00
Else
Main . Funimation_vtt = False
2022-11-10 14:31:11 +01:00
My . Settings . Funimation_vtt = False
2021-11-14 22:06:06 +01:00
End If
2020-11-19 22:28:42 +01:00
Dim FunimationSaveString As String = Nothing
For ii As Integer = 0 To Main . SubFunimation . Count - 1
If FunimationSaveString = Nothing Then
FunimationSaveString = Main . SubFunimation ( ii )
Else
FunimationSaveString = FunimationSaveString + " , " + Main . SubFunimation ( ii )
End If
Next
If FunimationSaveString = Nothing Then
2022-11-10 14:31:11 +01:00
FunimationSaveString = " None "
2020-06-10 17:34:27 +02:00
End If
2022-11-10 14:31:11 +01:00
My . Settings . Fun_Sub = FunimationSaveString
2020-11-19 22:28:42 +01:00
#End Region
2020-09-30 18:19:31 +02:00
2020-12-02 21:01:30 +01:00
2020-02-12 22:08:02 +01:00
2021-06-20 19:02:55 +02:00
Dim ffpmeg_cmd As String = Nothing
2021-07-04 17:22:46 +02:00
If FFMPEG_CommandP1 . Text = " -c copy " Then
ffpmeg_cmd = " " + FFMPEG_CommandP1 . Text + " " + FFMPEG_CommandP4 . Text
ElseIf FFMPEG_CommandP2 . Text = " [no Preset] " Then
2020-04-01 20:55:47 +02:00
2021-07-04 17:22:46 +02:00
ffpmeg_cmd = " " + FFMPEG_CommandP1 . Text + " " + FFMPEG_CommandP3 . Text + " " + FFMPEG_CommandP4 . Text
Else
2020-04-01 20:55:47 +02:00
2021-07-04 17:22:46 +02:00
ffpmeg_cmd = " " + FFMPEG_CommandP1 . Text + " " + FFMPEG_CommandP2 . Text + " " + FFMPEG_CommandP3 . Text + " " + FFMPEG_CommandP4 . Text
2020-02-12 22:08:02 +01:00
End If
2023-02-07 14:31:23 +01:00
If Main . ffmpeg_command = My . Settings . ffmpeg_command_override Then
'override should not get overwritten
Else
Main . ffmpeg_command = ffpmeg_cmd
My . Settings . ffmpeg_command = Main . ffmpeg_command
End If
2022-11-10 14:31:11 +01:00
2021-07-04 17:22:46 +02:00
2022-12-02 18:43:43 +01:00
If CBool ( InStr ( FFMPEG_CommandP1 . Text , " nvenc " ) ) = True And CBool ( Main . VideoFormat = " .aac " ) = False Then
2020-11-05 20:43:52 +01:00
If NumericUpDown1 . Value > 2 Then
NumericUpDown1 . Value = 2
End If
2022-12-02 18:43:43 +01:00
ElseIf CBool ( InStr ( FFMPEG_CommandP1 . Text , " libx26 " ) ) = True And CBool ( Main . VideoFormat = " .aac " ) = False Then
2020-11-05 20:43:52 +01:00
If NumericUpDown1 . Value > 1 Then
NumericUpDown1 . Value = 1
End If
2020-02-12 22:08:02 +01:00
End If
2022-11-10 14:31:11 +01:00
2021-09-20 20:37:57 +02:00
Main . MaxDL = CInt ( NumericUpDown1 . Value )
2022-11-10 14:31:11 +01:00
My . Settings . SL_DL = Main . MaxDL
2020-02-12 22:08:02 +01:00
2021-09-20 20:37:57 +02:00
Main . ErrorTolerance = CInt ( NumericUpDown2 . Value )
2022-11-10 14:31:11 +01:00
My . Settings . ErrorTolerance = Main . ErrorTolerance
2020-11-05 20:43:52 +01:00
2020-02-28 16:28:38 +01:00
If ListViewAdd_True . Checked = True Then
2020-12-18 13:47:55 +01:00
Main . UseQueue = True
2022-11-10 14:31:11 +01:00
My . Settings . QueueMode = Main . UseQueue
2020-02-28 16:28:38 +01:00
ElseIf ListViewAdd_True . Checked = False Then
Main . UseQueue = False
2022-11-10 14:31:11 +01:00
My . Settings . QueueMode = Main . UseQueue
2020-02-28 16:28:38 +01:00
End If
2021-02-12 13:44:17 +01:00
2020-02-28 16:28:38 +01:00
2020-02-02 16:39:54 +01:00
Main . SoftSubs . Clear ( )
2023-02-16 20:56:58 +01:00
Main . SoftSubs . AddRange ( CR_SoftSubsTemp )
2020-02-02 16:39:54 +01:00
Dim SaveString As String = Nothing
For ii As Integer = 0 To Main . SoftSubs . Count - 1
If SaveString = Nothing Then
SaveString = Main . SoftSubs ( ii )
Else
SaveString = SaveString + " , " + Main . SoftSubs ( ii )
End If
Next
If SaveString = Nothing Then
2022-11-10 14:31:11 +01:00
SaveString = " None "
2020-02-02 16:39:54 +01:00
End If
2022-11-10 14:31:11 +01:00
My . Settings . AddedSubs = SaveString
2023-02-16 20:56:58 +01:00
2021-09-20 20:37:57 +02:00
If CB_SoftSubSettings . SelectedIndex = 0 Then
Main . IncludeLangName = False
2022-11-10 14:31:11 +01:00
My . Settings . IncludeLangName = Main . IncludeLangName
2021-09-20 20:37:57 +02:00
Else
Main . IncludeLangName = True
2022-11-10 14:31:11 +01:00
My . Settings . IncludeLangName = Main . IncludeLangName
2021-09-20 20:37:57 +02:00
End If
2022-01-23 15:34:33 +01:00
If LangNameType_DD . SelectedIndex = 1 Then
Main . LangNameType = 1
2022-11-10 14:31:11 +01:00
My . Settings . LangNameType = Main . LangNameType
2022-01-23 15:34:33 +01:00
ElseIf LangNameType_DD . SelectedIndex = 2 Then
Main . LangNameType = 2
2022-11-10 14:31:11 +01:00
My . Settings . LangNameType = Main . LangNameType
2022-01-23 15:34:33 +01:00
Else
Main . LangNameType = 0
2022-11-10 14:31:11 +01:00
My . Settings . LangNameType = Main . LangNameType
2022-01-23 15:34:33 +01:00
End If
2022-11-10 14:31:11 +01:00
My . Settings . Save ( )
2022-01-23 15:34:33 +01:00
2019-11-10 00:16:12 +01:00
Me . Close ( )
End Sub
2022-12-29 11:45:55 +01:00
2019-11-10 00:16:12 +01:00
2020-06-01 18:43:38 +02:00
2019-11-10 00:16:12 +01:00
2021-06-20 19:02:55 +02:00
2020-12-02 21:01:30 +01:00
Private Sub PictureBox1_Click ( sender As Object , e As EventArgs ) Handles pictureBox1 . Click
2019-11-10 00:16:12 +01:00
Me . Close ( )
End Sub
#Region "UI"
2020-12-10 19:18:20 +01:00
Private Sub Btn_Close_MouseEnter ( sender As Object , e As EventArgs ) Handles pictureBox1 . MouseEnter
2021-09-20 20:37:57 +02:00
pictureBox1 . Image = My . Resources . main_del
2019-11-10 00:16:12 +01:00
End Sub
2020-12-10 19:18:20 +01:00
Private Sub Btn_Close_MouseLeave ( sender As Object , e As EventArgs ) Handles pictureBox1 . MouseLeave
2021-09-20 20:37:57 +02:00
pictureBox1 . Image = Main . CloseImg
2019-11-10 00:16:12 +01:00
End Sub
2021-09-20 20:37:57 +02:00
Private Sub Btn_Save_MouseEnter ( sender As Object , e As EventArgs ) Handles Btn_Save . MouseEnter , Btn_Save . GotFocus
Btn_Save . Image = My . Resources . crdSettings_Button_SafeExit_hover
2019-11-10 00:16:12 +01:00
End Sub
2021-09-20 20:37:57 +02:00
Private Sub Btn_Save_MouseLeave ( sender As Object , e As EventArgs ) Handles Btn_Save . MouseLeave , Btn_Save . LostFocus
Btn_Save . Image = My . Resources . crdSettings_Button_SafeExit
2019-11-10 00:16:12 +01:00
End Sub
2022-12-29 11:45:55 +01:00
Private Sub ComboBox1_DrawItem ( sender As Object , e As DrawItemEventArgs ) Handles CB_CR_Harsubs . DrawItem , CB_Fun_HardSubs . DrawItem , Fun_Dub_Over . DrawItem
2021-09-20 20:37:57 +02:00
Dim CB As ComboBox = CType ( sender , ComboBox )
2020-11-13 15:57:34 +01:00
CB . BackColor = Color . White
2019-11-10 00:16:12 +01:00
If e . Index >= 0 Then
Using st As New StringFormat With { . Alignment = StringAlignment . Center }
' e.DrawBackground()
' e.DrawFocusRectangle()
e . Graphics . FillRectangle ( SystemBrushes . ControlLightLight , e . Bounds )
2020-11-13 15:57:34 +01:00
e . Graphics . DrawString ( CB . Items ( e . Index ) . ToString , e . Font , Brushes . Black , e . Bounds , st )
2019-11-10 00:16:12 +01:00
End Using
End If
End Sub
2020-02-02 16:39:54 +01:00
Private Sub AAuto_Click ( sender As Object , e As EventArgs ) Handles AAuto . Click
2022-09-06 21:20:05 +02:00
If CB_Merge . SelectedIndex > 0 Then
2020-02-02 16:39:54 +01:00
If AAuto . Checked = True Then
If MessageBox . Show ( " Resolution '[Auto]' and merge the subtitle with the video file will download all resolutions! " + vbNewLine + " Press 'Yes' to enable it anyway " , " Prepare for unforeseen consequences. " , MessageBoxButtons . YesNo ) = DialogResult . Yes Then
Else
2020-10-07 22:40:58 +02:00
AAuto . Checked = False
2020-12-13 16:11:43 +01:00
A360p . Checked = True
2020-02-02 16:39:54 +01:00
End If
End If
2022-01-23 15:34:33 +01:00
'ElseIf HybridMode_CB.Checked = True Then
' If AAuto.Checked = True Then
' MsgBox("Resolution '[Auto]' and 'Hybride Mode' does not work together", MsgBoxStyle.Information)
' AAuto.Checked = False
' A1080p.Checked = True
' End If
2020-02-02 16:39:54 +01:00
End If
End Sub
2022-09-06 21:20:05 +02:00
Private Sub MergeMP4_Click ( sender As Object , e As EventArgs )
If CB_Merge . SelectedIndex > 0 Then
2020-02-02 16:39:54 +01:00
If AAuto . Checked = True Then
If MessageBox . Show ( " Resolution '[Auto]' and merge the subtitle with the video file will download all resolutions! " + vbNewLine + " Press 'Yes' to enable it anyway " , " Prepare for unforeseen consequences. " , MessageBoxButtons . YesNo ) = DialogResult . Yes Then
Else
2022-09-06 21:20:05 +02:00
CB_Merge . SelectedIndex = 0
2020-02-02 16:39:54 +01:00
End If
End If
End If
End Sub
2021-03-08 21:08:26 +01:00
2020-12-13 16:11:43 +01:00
2020-02-02 16:39:54 +01:00
2020-10-07 22:40:58 +02:00
2019-11-10 00:16:12 +01:00
2019-12-29 16:44:16 +01:00
2020-02-12 22:08:02 +01:00
2021-06-20 19:02:55 +02:00
2020-04-01 20:55:47 +02:00
2023-07-15 20:54:20 +02:00
Private Sub ListC1_Click ( sender As Object , e As EventArgs ) Handles copy . Click , nv_h264 . Click , nv_hevc . Click , nv_AV1 . Click , CPU_h264 . Click , CPU_h265 . Click , CPU_AV1 . Click , AMD_h264 . Click , AMD_hevc . Click , AMD_AV1 . Click , Intel_h264 . Click , Intel_hevc . Click , Intel_AV1 . Click
2021-09-20 20:37:57 +02:00
Dim Button As ToolStripMenuItem = CType ( sender , ToolStripMenuItem )
2023-01-21 11:21:39 +01:00
If CBool ( InStr ( Button . Text , " av1 " ) ) Then
If MessageBox . Show ( " The inculded ffmpeg version does not support any AV1 encoders. " + vbNewLine + " The 'Help' button gets you to the ffmpeg download page. " , " AV1 support " , MessageBoxButtons . OKCancel , MessageBoxIcon . Information , MessageBoxDefaultButton . Button1 , 0 , " https://ffmpeg.org/download.html " , " " ) = DialogResult . Cancel Then
Exit Sub
End If
End If
2020-04-01 20:55:47 +02:00
If Button . Text = " -c copy " Then
FFMPEG_CommandP1 . Text = " -c copy "
FFMPEG_CommandP2 . Enabled = False
FFMPEG_CommandP3 . Enabled = False
2023-01-21 11:21:39 +01:00
2023-01-01 16:34:18 +01:00
ElseIf Button . Text = " -c:v libsvtav1 " Then
FFMPEG_CommandP1 . Text = Button . Text
FFMPEG_CommandP2 . Text = " [no Preset] "
FFMPEG_CommandP2 . Enabled = False
FFMPEG_CommandP3 . Enabled = True
2020-04-01 20:55:47 +02:00
Else
FFMPEG_CommandP1 . Text = Button . Text
FFMPEG_CommandP2 . Enabled = True
FFMPEG_CommandP3 . Enabled = True
End If
2020-02-12 22:08:02 +01:00
End Sub
2021-05-23 22:27:56 +02:00
Private Sub ListP1_Click ( sender As Object , e As EventArgs ) Handles ListP1 . Click , ListP2 . Click , ListP3 . Click
2021-09-20 20:37:57 +02:00
Dim Button As ToolStripMenuItem = CType ( sender , ToolStripMenuItem )
2020-04-01 20:55:47 +02:00
FFMPEG_CommandP2 . Text = Button . Text
FFMPEG_CommandP2 . Enabled = True
FFMPEG_CommandP3 . Enabled = True
End Sub
2021-10-27 21:43:12 +02:00
Private Sub ListBit1_Click ( sender As Object , e As EventArgs ) Handles ListBit_7000 . Click , ListBit_6500 . Click , ListBit_6000 . Click , ListBit_5500 . Click , ListBit_5000 . Click , ListBit_4500 . Click , ListBit_4000 . Click , ListBit_3500 . Click , ListBit_3000 . Click , ListBit_2500 . Click , ListBit_2000 . Click , ListBit_1500 . Click , ListBit_1000 . Click
2021-09-20 20:37:57 +02:00
Dim Button As ToolStripMenuItem = CType ( sender , ToolStripMenuItem )
2020-04-01 20:55:47 +02:00
FFMPEG_CommandP3 . Text = Button . Text
FFMPEG_CommandP2 . Enabled = True
FFMPEG_CommandP3 . Enabled = True
End Sub
2020-02-12 22:08:02 +01:00
2020-12-10 19:18:20 +01:00
Private Sub Label7_Click ( sender As Object , e As EventArgs )
2022-12-02 18:43:43 +01:00
Process . Start ( " https://learn.microsoft.com/de-de/microsoft-edge/webview2/ " )
2020-11-13 15:57:34 +01:00
End Sub
2020-12-10 19:18:20 +01:00
Private Sub Label3_Click ( sender As Object , e As EventArgs )
2020-11-13 15:57:34 +01:00
Process . Start ( " https://www.ffmpeg.org/about.html " )
End Sub
2020-12-10 19:18:20 +01:00
Private Sub Label9_Click ( sender As Object , e As EventArgs )
2020-11-13 15:57:34 +01:00
Process . Start ( " https://github.com/hama3254/metroframework-modern-ui " )
End Sub
2020-12-04 20:22:22 +01:00
2020-12-10 19:18:20 +01:00
Sub GroupBoxColor ( ByVal color As Color )
2021-06-20 19:02:55 +02:00
NumericUpDown1 . ForeColor = color
NumericUpDown2 . ForeColor = color
FFMPEG_CommandP1 . ForeColor = color
FFMPEG_CommandP2 . ForeColor = color
FFMPEG_CommandP3 . ForeColor = color
FFMPEG_CommandP4 . ForeColor = color
2020-12-10 19:18:20 +01:00
SoftSubs . ForeColor = color
GB_SubLanguage . ForeColor = color
DL_Count_simultaneous . ForeColor = color
GB_Resolution . ForeColor = color
2021-06-20 19:02:55 +02:00
GB_Filename_Pre . ForeColor = color
2020-12-10 19:18:20 +01:00
GroupBox1 . ForeColor = color
GroupBox2 . ForeColor = color
2021-09-20 20:37:57 +02:00
GroupBox3 . ForeColor = color
2022-01-23 15:34:33 +01:00
GroupBox4 . ForeColor = color
2020-12-10 19:18:20 +01:00
GroupBox5 . ForeColor = color
GroupBox6 . ForeColor = color
GroupBox7 . ForeColor = color
2021-12-31 14:21:19 +01:00
GroupBox8 . ForeColor = color
2020-12-10 19:18:20 +01:00
GroupBox9 . ForeColor = color
GroupBox10 . ForeColor = color
GroupBox11 . ForeColor = color
GroupBox12 . ForeColor = color
2021-12-31 14:21:19 +01:00
GroupBox13 . ForeColor = color
GroupBox14 . ForeColor = color
GroupBox15 . ForeColor = color
2022-01-23 15:34:33 +01:00
GroupBox16 . ForeColor = color
GroupBox17 . ForeColor = color
GroupBox18 . ForeColor = color
2022-08-05 15:12:25 +02:00
GroupBox19 . ForeColor = color
2023-01-01 16:34:18 +01:00
GroupBox20 . ForeColor = color
2020-12-10 19:18:20 +01:00
End Sub
Private Sub DarkMode_CheckedChanged ( sender As Object , e As EventArgs ) Handles DarkMode . CheckedChanged
If DarkMode . Checked = True Then
2022-11-10 14:31:11 +01:00
My . Settings . DarkModeValue = True
2020-12-10 19:18:20 +01:00
Manager . Theme = MetroThemeStyle . Dark
GroupBoxColor ( Color . FromArgb ( 150 , 150 , 150 ) )
2021-06-20 19:02:55 +02:00
NumericUpDown1 . BackColor = Color . FromArgb ( 17 , 17 , 17 )
NumericUpDown2 . BackColor = Color . FromArgb ( 17 , 17 , 17 )
2020-12-10 19:18:20 +01:00
Main . DarkMode ( )
Main . DarkModeValue = True
pictureBox1 . Image = Main . CloseImg
Else
Main . DarkModeValue = False
2022-11-10 14:31:11 +01:00
My . Settings . DarkModeValue = False
2020-12-10 19:18:20 +01:00
Manager . Theme = MetroThemeStyle . Light
Main . LightMode ( )
GroupBoxColor ( Color . FromArgb ( 0 , 0 , 0 ) )
2021-06-20 19:02:55 +02:00
NumericUpDown1 . BackColor = Color . FromArgb ( 243 , 243 , 243 )
NumericUpDown2 . BackColor = Color . FromArgb ( 243 , 243 , 243 )
2020-12-10 19:18:20 +01:00
pictureBox1 . Image = Main . CloseImg
End If
End Sub
2020-12-04 20:22:22 +01:00
2020-06-10 19:52:11 +02:00
2021-02-12 13:44:17 +01:00
Private Sub Server_Click ( sender As Object , e As EventArgs )
'If Server.Checked = True Then
' MsgBox("This feature requires a restart of the downloader", MsgBoxStyle.Information)
'End If
2021-01-14 18:06:42 +01:00
End Sub
2021-01-16 14:08:33 +01:00
Private Sub BackgroundWorker1_DoWork ( sender As Object , e As System . ComponentModel . DoWorkEventArgs ) Handles BackgroundWorker1 . DoWork
Try
Dim client0 As New WebClient
client0 . Encoding = Encoding . UTF8
2023-04-21 17:03:00 +02:00
client0 . Headers . Add ( My . Settings . User_Agend . Replace ( Chr ( 34 ) , " " ) )
2021-01-16 14:08:33 +01:00
Dim str0 As String = client0 . DownloadString ( " https://api.github.com/repos/hama3254/Crunchyroll-Downloader-v3.0/releases " )
Dim GitHubLastIsPre ( ) As String = str0 . Split ( New String ( ) { Chr ( 34 ) + " prerelease " + Chr ( 34 ) + " : " } , System . StringSplitOptions . RemoveEmptyEntries )
Dim LastNonPreRelase As Integer = 0
For i As Integer = 1 To GitHubLastIsPre . Count - 1
Dim GitHubLastIsPre1 ( ) As String = GitHubLastIsPre ( i ) . Split ( New String ( ) { " , " } , System . StringSplitOptions . RemoveEmptyEntries )
If GitHubLastIsPre1 ( 0 ) = " false " Then
LastNonPreRelase = i
Exit For
End If
Next
Dim GitHubLastTag ( ) As String = str0 . Split ( New String ( ) { Chr ( 34 ) + " tag_name " + Chr ( 34 ) + " : " + Chr ( 34 ) } , System . StringSplitOptions . RemoveEmptyEntries )
Dim GitHubLastTag1 ( ) As String = GitHubLastTag ( LastNonPreRelase ) . Split ( New String ( ) { Chr ( 34 ) + " , " } , System . StringSplitOptions . RemoveEmptyEntries )
2021-05-23 22:27:56 +02:00
LastVersionString = GitHubLastTag1 ( 0 )
'Debug.WriteLine(GitHubLastTag1(0))
2021-01-16 14:08:33 +01:00
Catch ex As Exception
Debug . WriteLine ( ex . ToString )
End Try
End Sub
2021-01-14 18:06:42 +01:00
2020-10-31 23:36:52 +01:00
2021-01-22 22:45:01 +01:00
Private Sub CB_Fun_HardSubs_SelectedIndexChanged ( sender As Object , e As EventArgs ) Handles CB_Fun_HardSubs . SelectedIndexChanged
If CB_Fun_HardSubs . SelectedIndex = 0 Then
Else
If Main . HardSubFunimation = " Disabled " Then
If FFMPEG_CommandP1 . Text = " -c copy " Then
If MessageBox . Show ( " Funimation hard subtitle are post-processed. " + vbNewLine + " This cost a lot of performance and it should not more than one download run at the time! " , " Prepare for unforeseen consequences. " , MessageBoxButtons . YesNo ) = DialogResult . Yes Then
Else
CB_Fun_HardSubs . SelectedIndex = 0
End If
End If
End If
End If
2021-02-07 13:47:30 +01:00
'MetroMessageBox.Show(Me, "Test", "Test Box", MessageBoxButtons.YesNo, MessageBoxIcon.None, 150)
'MetroMessageBox.Show(Me, "Test", "Test Box", MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button2, 150, MetroThemeStyle.Dark)
2021-01-22 22:45:01 +01:00
End Sub
2021-02-20 18:25:49 +01:00
Private Sub CB_fun_eng_CheckedChanged ( sender As Object , e As EventArgs ) Handles CB_fun_eng . CheckedChanged
If CB_fun_eng . Checked = True Then
FunSubDef . Items . Add ( " English " )
Else
FunSubDef . Items . Remove ( " English " )
If FunSubDef . Text = " English " Then
FunSubDef . SelectedItem = " [Disabled] "
End If
End If
End Sub
Private Sub CB_fun_es_CheckedChanged ( sender As Object , e As EventArgs ) Handles CB_fun_es . CheckedChanged
If CB_fun_es . Checked = True Then
FunSubDef . Items . Add ( " Español (LA) " )
Else
FunSubDef . Items . Remove ( " Español (LA) " )
If FunSubDef . Text = " Español (LA) " Then
FunSubDef . SelectedItem = " [Disabled] "
End If
End If
End Sub
Private Sub CB_fun_ptbr_CheckedChanged ( sender As Object , e As EventArgs ) Handles CB_fun_ptbr . CheckedChanged
If CB_fun_ptbr . Checked = True Then
FunSubDef . Items . Add ( " Português (Brasil) " )
Else
FunSubDef . Items . Remove ( " Português (Brasil) " )
If FunSubDef . Text = " Português (Brasil) " Then
FunSubDef . SelectedItem = " [Disabled] "
End If
End If
End Sub
2021-03-08 21:08:26 +01:00
2021-06-20 19:02:55 +02:00
Private Sub MetroLink1_Click ( sender As Object , e As EventArgs )
2021-05-23 22:27:56 +02:00
Process . Start ( " https://github.com/hama3254/Crunchyroll-Downloader-v3.0/discussions/276 " )
End Sub
Private Sub TabPage7_Enter ( sender As Object , e As EventArgs ) Handles TabPage7 . Enter
LastVersion . Text = " last release: " + LastVersionString
End Sub
2021-06-04 15:25:59 +02:00
Private Sub CB_Format_SelectedIndexChanged ( sender As Object , e As EventArgs ) Handles CB_Format . SelectedIndexChanged
If CB_Format . Text = " AAC (Audio only) " Then
2022-10-24 18:33:49 +02:00
CB_Merge . Items . Clear ( )
CB_Merge . Items . Add ( " [merge disabled] " )
CB_Merge . SelectedIndex = 0
CB_Merge . Enabled = False
2022-09-06 21:20:05 +02:00
ElseIf CB_Format . Text = " MP4 " Then
2022-10-24 18:33:49 +02:00
CB_Merge . Enabled = True
2022-09-06 21:20:05 +02:00
CB_Merge . Items . Clear ( )
2022-10-24 18:33:49 +02:00
CB_Merge . Items . Add ( " [merge disabled] " )
2022-09-06 21:20:05 +02:00
CB_Merge . Items . Add ( " mov_text " )
2023-01-05 14:26:40 +01:00
CB_Merge . SelectedIndex = 0
2022-09-06 21:20:05 +02:00
'CB_Merge.Items.Add("srt")
CB_Merge . SelectedItem = Main . MergeSubsFormat
ElseIf CB_Format . Text = " MKV " Then
2022-10-24 18:33:49 +02:00
CB_Merge . Enabled = True
2022-09-06 21:20:05 +02:00
CB_Merge . Items . Clear ( )
2022-10-14 14:33:23 +02:00
CB_Merge . Items . Add ( " [merge disabled] " )
2022-09-06 21:20:05 +02:00
CB_Merge . Items . Add ( " copy " )
CB_Merge . Items . Add ( " srt " )
2023-01-05 14:26:40 +01:00
CB_Merge . SelectedIndex = 0
2022-09-06 21:20:05 +02:00
CB_Merge . SelectedItem = Main . MergeSubsFormat
2021-06-04 15:25:59 +02:00
End If
2022-09-06 21:20:05 +02:00
2021-06-04 15:25:59 +02:00
End Sub
2022-09-06 21:20:05 +02:00
Private Sub MergeMP4_CheckedChanged ( sender As Object , e As EventArgs )
2021-06-04 15:25:59 +02:00
If CB_Format . Text = " AAC (Audio only) " Then
2022-09-06 21:20:05 +02:00
If CB_Merge . SelectedIndex > 0 Then
2021-06-04 15:25:59 +02:00
MsgBox ( " Merged subs are not avalible with audio only! " , MsgBoxStyle . Information )
End If
2022-09-06 21:20:05 +02:00
CB_Merge . SelectedIndex = 0
2021-06-04 15:25:59 +02:00
End If
End Sub
2022-03-19 12:01:12 +01:00
Private Sub DD_DLMode_SelectedIndexChanged ( sender As Object , e As EventArgs ) Handles DD_DLMode . SelectedIndexChanged
If DD_DLMode . SelectedIndex > 0 Then
TempTB . Enabled = True
Else
TempTB . Enabled = False
End If
2023-06-17 17:23:31 +02:00
If ( CB_Merge . Text = " [merge disabled] " ) = False And DD_DLMode . Text = " Default - ffmpeg " Then
CB_Mod1 . Enabled = False
CB_Mod1 . Checked = False
2023-06-24 23:50:39 +02:00
CB_vttStyle . Enabled = False
CB_vttStyle . Checked = False
ElseIf ( CB_Merge . Text = " [merge disabled] " ) = True And DD_DLMode . Text = " Default - ffmpeg " Then
CB_Mod1 . Enabled = True
CB_Mod1 . Checked = TempCheckSubMod1
CB_vttStyle . Enabled = False
CB_vttStyle . Checked = False
ElseIf ( DD_DLMode . Text = " Default - ffmpeg " ) = False Then
2023-06-17 17:23:31 +02:00
CB_Mod1 . Enabled = True
CB_Mod1 . Checked = TempCheckSubMod1
2023-06-24 23:50:39 +02:00
CB_vttStyle . Enabled = True
CB_vttStyle . Checked = TempVTTStyle
2023-06-17 17:23:31 +02:00
End If
2022-03-19 12:01:12 +01:00
End Sub
Private Sub TempTB_Click ( sender As Object , e As EventArgs ) Handles TempTB . Click
Dim FolderBrowserDialog1 As New FolderBrowserDialog ( )
FolderBrowserDialog1 . RootFolder = Environment . SpecialFolder . MyComputer
If FolderBrowserDialog1 . ShowDialog ( ) = DialogResult . OK Then
Main . TempFolder = FolderBrowserDialog1 . SelectedPath
TempTB . Text = FolderBrowserDialog1 . SelectedPath
2022-11-10 14:31:11 +01:00
My . Settings . TempFolder = Main . TempFolder
2022-03-19 12:01:12 +01:00
End If
End Sub
2023-01-01 20:47:09 +01:00
#Region "Build Name String"
2023-01-07 19:04:56 +01:00
Private Sub CB_Anime_CheckedChanged ( sender As Object , e As EventArgs ) Handles CB_Anime . CheckedChanged , CB_Season . CheckedChanged , CB_EpisodeNR . CheckedChanged , CB_EpisodeName . CheckedChanged , CB_AnimeDub . CheckedChanged , CB_Kodi . CheckedChanged
2023-01-01 20:47:09 +01:00
If CB_Anime . Checked = True And CBool ( InStr ( TB_NameString . Text , " AnimeTitle; " ) ) = False Then
TB_NameString . AppendText ( " AnimeTitle; " )
ElseIf CB_Anime . Checked = False Then
TB_NameString . Text = TB_NameString . Text . Replace ( " AnimeTitle; " , " " )
End If
If CB_Season . Checked = True And CBool ( InStr ( TB_NameString . Text , " Season; " ) ) = False Then
TB_NameString . AppendText ( " Season; " )
ElseIf CB_Season . Checked = False Then
TB_NameString . Text = TB_NameString . Text . Replace ( " Season; " , " " )
End If
If CB_EpisodeNR . Checked = True And CBool ( InStr ( TB_NameString . Text , " EpisodeNR; " ) ) = False Then
TB_NameString . AppendText ( " EpisodeNR; " )
ElseIf CB_EpisodeNR . Checked = False Then
TB_NameString . Text = TB_NameString . Text . Replace ( " EpisodeNR; " , " " )
End If
If CB_EpisodeName . Checked = True And CBool ( InStr ( TB_NameString . Text , " EpisodeName; " ) ) = False Then
TB_NameString . AppendText ( " EpisodeName; " )
ElseIf CB_EpisodeName . Checked = False Then
TB_NameString . Text = TB_NameString . Text . Replace ( " EpisodeName; " , " " )
End If
If CB_AnimeDub . Checked = True And CBool ( InStr ( TB_NameString . Text , " AnimeDub; " ) ) = False Then
TB_NameString . AppendText ( " AnimeDub; " )
ElseIf CB_AnimeDub . Checked = False Then
TB_NameString . Text = TB_NameString . Text . Replace ( " AnimeDub; " , " " )
End If
2023-01-07 19:04:56 +01:00
2023-01-01 20:47:09 +01:00
End Sub
2023-01-05 14:26:40 +01:00
Private Sub DD_Season_Prefix_UserAction ( sender As Object , e As EventArgs ) Handles DD_Season_Prefix . Click , DD_Season_Prefix . GotFocus
If DD_Season_Prefix . Text = Main . Season_PrefixDefault Then
DD_Season_Prefix . Text = Nothing
End If
End Sub
Private Sub DD_Season_Prefix_LostFocus ( sender As Object , e As EventArgs ) Handles DD_Season_Prefix . LostFocus
If DD_Season_Prefix . Text = Nothing Then
DD_Season_Prefix . Text = Main . Season_PrefixDefault
End If
End Sub
Private Sub DD_Episode_Prefix_UserAction ( sender As Object , e As EventArgs ) Handles DD_Episode_Prefix . Click , DD_Episode_Prefix . GotFocus
2023-01-05 15:44:21 +01:00
If DD_Episode_Prefix . Text = Main . Episode_PrefixDefault Then
2023-01-05 14:26:40 +01:00
DD_Episode_Prefix . Text = Nothing
End If
End Sub
Private Sub DD_Episode_Prefix_LostFocus ( sender As Object , e As EventArgs ) Handles DD_Episode_Prefix . LostFocus
If DD_Episode_Prefix . Text = Nothing Then
2023-01-05 15:44:21 +01:00
DD_Episode_Prefix . Text = Main . Episode_PrefixDefault
2023-01-05 14:26:40 +01:00
End If
End Sub
2023-02-16 20:56:58 +01:00
Private Sub CR_SoftSubs_Change ( sender As Object , e As EventArgs ) Handles CR_SoftSubs . Click
Dim Popup As New CheckBoxComboBox
Popup . Text = " CR Sub selection "
Popup . Show ( )
End Sub
2023-01-05 14:26:40 +01:00
2023-06-17 17:23:31 +02:00
Private Sub CB_Merge_SelectedIndexChanged ( sender As Object , e As EventArgs ) Handles CB_Merge . SelectedIndexChanged
If ( CB_Merge . Text = " [merge disabled] " ) = False And DD_DLMode . Text = " Default - ffmpeg " Then
CB_Mod1 . Enabled = False
CB_Mod1 . Checked = False
2023-06-24 23:50:39 +02:00
CB_vttStyle . Enabled = False
CB_vttStyle . Checked = False
ElseIf ( CB_Merge . Text = " [merge disabled] " ) = True And DD_DLMode . Text = " Default - ffmpeg " Then
CB_Mod1 . Enabled = True
CB_Mod1 . Checked = TempCheckSubMod1
CB_vttStyle . Enabled = False
CB_vttStyle . Checked = False
ElseIf ( DD_DLMode . Text = " Default - ffmpeg " ) = False Then
2023-06-17 17:23:31 +02:00
CB_Mod1 . Enabled = True
CB_Mod1 . Checked = TempCheckSubMod1
2023-06-24 23:50:39 +02:00
CB_vttStyle . Enabled = True
CB_vttStyle . Checked = TempVTTStyle
2023-06-17 17:23:31 +02:00
End If
2023-06-24 23:50:39 +02:00
2023-06-17 17:23:31 +02:00
End Sub
Private Sub CB_Mod1_CheckedChanged ( sender As Object , e As EventArgs ) Handles CB_Mod1 . CheckedChanged
If CB_Mod1 . Enabled = True Then
TempCheckSubMod1 = CB_Mod1 . Checked
End If
End Sub
2023-06-24 23:50:39 +02:00
Private Sub CB_vttStyle_CheckedChanged ( sender As Object , e As EventArgs ) Handles CB_vttStyle . CheckedChanged
If CB_vttStyle . Enabled = True Then
TempVTTStyle = CB_vttStyle . Checked
End If
End Sub
2023-01-05 14:26:40 +01:00
2023-01-21 11:21:39 +01:00
2023-02-16 20:56:58 +01:00
'Private Sub CB_CR_Audio_Click(sender As Object, e As EventArgs) Handles CB_CR_Audio.Click
' Dim Popup As New CheckBoxComboBox
' Popup.Text = "CR Dub selection"
' Popup.Show()
'End Sub
2023-01-21 11:21:39 +01:00
2022-03-19 12:01:12 +01:00
2021-02-20 18:25:49 +01:00
2021-01-22 22:45:01 +01:00
2023-02-16 20:56:58 +01:00
#End Region
2021-01-22 22:45:01 +01:00
2019-11-10 00:16:12 +01:00
#End Region
2023-02-16 20:56:58 +01:00
2019-11-10 00:16:12 +01:00
End Class