VERSION 5.00
Begin VB.Form Form23 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Video downloader"
   ClientHeight    =   8565
   ClientLeft      =   150
   ClientTop       =   525
   ClientWidth     =   11970
   BeginProperty Font 
      Name            =   "Arial"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "Form23.frx":0000
   LinkTopic       =   "Form23"
   MaxButton       =   0   'False
   ScaleHeight     =   8565
   ScaleWidth      =   11970
   StartUpPosition =   2  'CenterScreen
   Begin VB.PictureBox Picture2 
      Height          =   5415
      Left            =   5880
      ScaleHeight     =   5355
      ScaleWidth      =   5235
      TabIndex        =   11
      Top             =   3000
      Visible         =   0   'False
      Width           =   5295
      Begin VB.CheckBox Check4 
         Caption         =   "Marcar / desmarcar todo"
         Height          =   255
         Left            =   0
         TabIndex        =   49
         Top             =   360
         Visible         =   0   'False
         Width           =   4815
      End
      Begin VB.CommandButton Command12 
         Caption         =   "Detener (force)"
         Height          =   495
         Left            =   1800
         TabIndex        =   36
         Top             =   4920
         Width           =   1815
      End
      Begin LibreAVC.IconoCtrl IconoCtrl7 
         Height          =   240
         Left            =   3240
         TabIndex        =   27
         Top             =   5040
         Visible         =   0   'False
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":058A
      End
      Begin LibreAVC.IconoCtrl IconoCtrl6 
         Height          =   240
         Left            =   4560
         TabIndex        =   26
         Top             =   5040
         Visible         =   0   'False
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":08DC
      End
      Begin LibreAVC.IconoCtrl IconoCtrl5 
         Height          =   240
         Left            =   3720
         TabIndex        =   24
         Top             =   2640
         Width           =   240
         _ExtentX        =   0
         _ExtentY        =   0
      End
      Begin LibreAVC.IconoCtrl IconoCtrl1 
         Height          =   240
         Left            =   5040
         TabIndex        =   23
         Top             =   2640
         Width           =   240
         _ExtentX        =   0
         _ExtentY        =   0
      End
      Begin VB.CommandButton Command4 
         Height          =   495
         Left            =   4080
         TabIndex        =   14
         Top             =   4920
         Visible         =   0   'False
         Width           =   1215
      End
      Begin VB.ListBox List1 
         Height          =   4155
         IntegralHeight  =   0   'False
         Left            =   0
         Style           =   1  'Checkbox
         TabIndex        =   13
         Top             =   720
         Visible         =   0   'False
         Width           =   5295
      End
      Begin VB.CommandButton Command7 
         Caption         =   "Detener"
         Height          =   495
         Left            =   3720
         TabIndex        =   28
         Top             =   4920
         Width           =   1575
      End
      Begin VB.CommandButton Command5 
         Height          =   495
         Left            =   2760
         TabIndex        =   15
         Top             =   4920
         Visible         =   0   'False
         Width           =   1215
      End
      Begin VB.Label Label6 
         Alignment       =   2  'Center
         Caption         =   "No fue posible obtener la lista de formatos"
         Height          =   255
         Left            =   0
         TabIndex        =   31
         Top             =   2520
         Visible         =   0   'False
         Width           =   5295
      End
      Begin VB.Label Label4 
         Alignment       =   2  'Center
         Caption         =   "Obteniendo lista de formatos disponibles"
         Height          =   255
         Left            =   0
         TabIndex        =   25
         Top             =   2520
         Width           =   5295
      End
      Begin VB.Label Label5 
         Caption         =   "Seleccione uno más formatos:"
         Height          =   255
         Left            =   0
         TabIndex        =   12
         Top             =   0
         Visible         =   0   'False
         Width           =   3015
      End
   End
   Begin VB.PictureBox Picture1 
      Height          =   5415
      Left            =   120
      ScaleHeight     =   5355
      ScaleWidth      =   5235
      TabIndex        =   0
      Top             =   120
      Width           =   5295
      Begin VB.TextBox Text6 
         Enabled         =   0   'False
         Height          =   375
         Left            =   0
         TabIndex        =   46
         Top             =   4440
         Width           =   5295
      End
      Begin VB.CheckBox Check3 
         Caption         =   "Parámetros de la línea de comandos:"
         Height          =   255
         Left            =   0
         TabIndex        =   45
         Top             =   4080
         Width           =   4335
      End
      Begin VB.ComboBox Combo2 
         Enabled         =   0   'False
         Height          =   330
         ItemData        =   "Form23.frx":0C2E
         Left            =   0
         List            =   "Form23.frx":0C47
         TabIndex        =   44
         Top             =   2760
         Width           =   5295
      End
      Begin VB.CheckBox Check2 
         Caption         =   "Nombre de archivo:"
         Height          =   255
         Left            =   0
         TabIndex        =   43
         Top             =   2400
         Width           =   4095
      End
      Begin VB.TextBox Text5 
         Enabled         =   0   'False
         Height          =   375
         Left            =   0
         TabIndex        =   42
         Top             =   1080
         Width           =   2895
      End
      Begin VB.CheckBox Check1 
         Caption         =   "Elementos de playlist (ej: 1,3,5-12):"
         Height          =   255
         Left            =   0
         TabIndex        =   41
         Top             =   720
         Width           =   4215
      End
      Begin LibreAVC.IconoCtrl IconoCtrl12 
         Height          =   240
         Left            =   360
         TabIndex        =   40
         Top             =   5040
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":0D43
      End
      Begin LibreAVC.IconoCtrl IconoCtrl11 
         Height          =   240
         Left            =   1440
         TabIndex        =   39
         Top             =   5040
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":1095
      End
      Begin VB.CommandButton Command14 
         Height          =   495
         Left            =   1080
         TabIndex        =   38
         Top             =   4920
         Width           =   975
      End
      Begin VB.CommandButton Command13 
         Height          =   495
         Left            =   0
         TabIndex        =   37
         Top             =   4920
         Width           =   975
      End
      Begin LibreAVC.IconoCtrl IconoCtrl10 
         Height          =   240
         Left            =   2520
         TabIndex        =   34
         Top             =   5040
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":13E7
      End
      Begin LibreAVC.IconoCtrl IconoCtrl9 
         Height          =   240
         Left            =   3360
         TabIndex        =   32
         Top             =   5040
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":1739
      End
      Begin LibreAVC.IconoCtrl IconoCtrl4 
         Height          =   240
         Left            =   4920
         TabIndex        =   22
         Top             =   3720
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":1A8B
      End
      Begin LibreAVC.IconoCtrl IconoCtrl3 
         Height          =   240
         Left            =   4920
         TabIndex        =   21
         Top             =   360
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":1DDD
      End
      Begin LibreAVC.IconoCtrl IconoCtrl2 
         Height          =   240
         Left            =   4920
         TabIndex        =   19
         Top             =   1920
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":212F
      End
      Begin VB.CommandButton Command3 
         Enabled         =   0   'False
         Height          =   495
         Left            =   4800
         TabIndex        =   10
         Top             =   3600
         Width           =   495
      End
      Begin VB.TextBox Text3 
         Enabled         =   0   'False
         Height          =   375
         Left            =   3600
         TabIndex        =   9
         Top             =   3600
         Width           =   1095
      End
      Begin VB.CommandButton Command2 
         Caption         =   "Descargar"
         Height          =   495
         Left            =   3240
         TabIndex        =   8
         Top             =   4920
         Width           =   2055
      End
      Begin VB.ComboBox Combo1 
         Height          =   330
         ItemData        =   "Form23.frx":2481
         Left            =   0
         List            =   "Form23.frx":24AC
         Style           =   2  'Dropdown List
         TabIndex        =   7
         Top             =   3600
         Width           =   3495
      End
      Begin VB.CommandButton Command1 
         Height          =   495
         Left            =   4800
         TabIndex        =   5
         Top             =   1800
         Width           =   495
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   0
         Locked          =   -1  'True
         TabIndex        =   4
         Top             =   1920
         Width           =   4215
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   0
         TabIndex        =   2
         Top             =   240
         Width           =   4695
      End
      Begin VB.CommandButton Command8 
         Height          =   495
         Left            =   4800
         TabIndex        =   20
         Top             =   240
         Width           =   495
      End
      Begin VB.CommandButton Command10 
         Height          =   495
         Left            =   2160
         TabIndex        =   33
         Top             =   4920
         Width           =   975
      End
      Begin LibreAVC.IconoCtrl IconoCtrl31 
         Height          =   240
         Left            =   4440
         TabIndex        =   48
         Top             =   1920
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":25E5
      End
      Begin VB.CommandButton Command15 
         Height          =   495
         Left            =   4320
         TabIndex        =   47
         Top             =   1800
         Width           =   495
      End
      Begin VB.Label Label3 
         Caption         =   "Calidad:"
         Height          =   255
         Left            =   0
         TabIndex        =   6
         Top             =   3240
         Width           =   4695
      End
      Begin VB.Label Label2 
         Caption         =   "Guardar en:"
         Height          =   255
         Left            =   0
         TabIndex        =   3
         Top             =   1560
         Width           =   4695
      End
      Begin VB.Label Label1 
         Caption         =   "URL:"
         Height          =   255
         Left            =   0
         TabIndex        =   1
         Top             =   0
         Width           =   495
      End
   End
   Begin VB.PictureBox Picture3 
      Height          =   2775
      Left            =   5880
      ScaleHeight     =   2715
      ScaleWidth      =   5235
      TabIndex        =   16
      Top             =   120
      Visible         =   0   'False
      Width           =   5295
      Begin VB.CommandButton Command11 
         Caption         =   "Detener (force)"
         Height          =   495
         Left            =   1920
         TabIndex        =   35
         Top             =   2280
         Width           =   1815
      End
      Begin LibreAVC.IconoCtrl IconoCtrl8 
         Height          =   240
         Left            =   4560
         TabIndex        =   30
         Top             =   2400
         Visible         =   0   'False
         Width           =   240
         _ExtentX        =   423
         _ExtentY        =   423
         Picture         =   "Form23.frx":2937
      End
      Begin VB.CommandButton Command9 
         Height          =   495
         Left            =   4080
         TabIndex        =   29
         Top             =   2280
         Visible         =   0   'False
         Width           =   1215
      End
      Begin VB.CommandButton Command6 
         Caption         =   "Detener"
         Height          =   495
         Left            =   3840
         TabIndex        =   18
         Top             =   2280
         Width           =   1455
      End
      Begin VB.TextBox Text4 
         Height          =   2175
         Left            =   0
         Locked          =   -1  'True
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   17
         Top             =   0
         Width           =   5295
      End
   End
   Begin VB.Menu Menu_File 
      Caption         =   "Archivo"
      Begin VB.Menu File_Salir 
         Caption         =   "Salir"
      End
   End
   Begin VB.Menu OptMenu 
      Caption         =   "Opciones"
      Begin VB.Menu Opt_ChanBufferSize 
         Caption         =   "Cambiar tamaño de buffer"
      End
      Begin VB.Menu Opt_ValCert 
         Caption         =   "Validar certificados https"
      End
      Begin VB.Menu Opt_ErrIgn 
         Caption         =   "Ignorar errores"
      End
      Begin VB.Menu Sep1 
         Caption         =   "-"
      End
      Begin VB.Menu Opt_CleanAll 
         Caption         =   "Limpiar todo"
      End
   End
   Begin VB.Menu Menu_Options 
      Caption         =   "Ayuda"
      Begin VB.Menu Options_About 
         Caption         =   "Acerca de youtube-dl"
      End
      Begin VB.Menu Help_Version 
         Caption         =   "Versión de youtube-dl"
      End
      Begin VB.Menu Help_GotoYtweb 
         Caption         =   "Ir a la web de youtube-dl"
      End
      Begin VB.Menu Options_List 
         Caption         =   "Listar websites soportados"
      End
      Begin VB.Menu Options_ShowHelp 
         Caption         =   "Mostrar ayuda de youtube-dl"
      End
      Begin VB.Menu Options_ConfigPath 
         Caption         =   "Configurar ruta de youtube-dl"
      End
   End
End
Attribute VB_Name = "Form23"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim IsPlaying As Byte

Private Sub Check1_Click()
Text5.Enabled = (Check1.Value = 1)
VideoDownloader.HabilitarItemsPlayList = Check1.Value
End Sub

Private Sub Check2_Click()
Combo2.Enabled = (Check2.Value = 1)
VideoDownloader.EspecificarNombreArchivoSalida = Check2.Value
End Sub

Private Sub Check3_Click()
Text6.Enabled = (Check3.Value = 1)
VideoDownloader.HabilitarComandosAdicionales = Check3.Value
End Sub

Private Sub Combo1_Click()
If Combo1.ListIndex = 12 Then
    Text3.Enabled = True
    Command3.Enabled = True
Else
    Text3.Enabled = False
    Command3.Enabled = False
End If
VideoDownloader.CalidadIndex = Combo1.ListIndex
End Sub

Private Sub Combo2_Change()
VideoDownloader.NombreArchivoSalida = Combo2.Text
End Sub

Private Sub Combo2_Click()
VideoDownloader.NombreArchivoSalida = Combo2.Text
End Sub

Private Sub Command1_Click()
Dim Ruta As String
Ruta = ScriptObj.FindFolder(, , Form23.hWnd)
If Ruta = "" Then Exit Sub
Text2.Text = Ruta
End Sub

Private Sub Command10_Click()
Dim Comandos As String
If ffmpeg.ComprobarExistenciaFFplay = False Then Exit Sub
Comandos = VideoDownloader.GenerarComandosYTDL(0, 1)
If Comandos = "" Then Exit Sub
Comandos = ScriptObj.Archivo_RutaCorta(VideoDownloader.YouTubeDLPath) & " " & Comandos & "-o - " & Chr(34) & Text1.Text & Chr(34)
Comandos = "cmd.exe /C " & Comandos & " | " & Chr(34) & ffmpeg.ffplayPath & Chr(34) & " -i pipe:0"
Picture1.Visible = False
Picture3.Visible = True
Menu_File.Enabled = False
Menu_Options.Enabled = False
OptMenu.Enabled = False
IsPlaying = 1
Me.Height = 3765
Call CaptureConsole.ExecAndCapture(Comandos, , , 1, Text4, , 3)
Command9.Visible = True
IconoCtrl8.Visible = True
Command6.Visible = False
Command11.Visible = False
End Sub

Private Sub Command11_Click()
If IsPlaying = 0 Then
    Call CaptureConsole.StopProcess
Else
    If VideoDownloader.DetenerPlayer = False Then Lang.FilterEditMsgStopProc
End If
End Sub

Private Sub Command12_Click()
Call CaptureConsole.StopProcess
End Sub

Private Sub Command13_Click()
Dim Comandos As String
Comandos = VideoDownloader.GenerarComandosYTDL(1)
If Comandos = "" Then Exit Sub
Comandos = Chr(34) & VideoDownloader.YouTubeDLPath & Chr(34) & Comandos & Chr(34) & Text1.Text & Chr(34)
Call IntDocView.IniciarDocVisor(Comandos, Form23)
End Sub

Private Sub Command14_Click()
Dim Comandos As String, OutBuffer As String, OcurrioError As Byte
Dim LinkList() As String, Link As String, i As Integer
Comandos = VideoDownloader.GenerarComandosYTDL(1)
If Comandos = "" Then Exit Sub
Comandos = Chr(34) & VideoDownloader.YouTubeDLPath & Chr(34) & Comandos & Chr(34) & Text1.Text & Chr(34)
Picture1.Visible = False
Picture3.Visible = True
Menu_File.Enabled = False
Menu_Options.Enabled = False
OptMenu.Enabled = False
Me.Height = 3765
Call CaptureConsole.ExecAndCapture(Comandos, , , 1, , , , OutBuffer)
If OutBuffer = "" Then
    OcurrioError = 1
Else
    LinkList = Split(OutBuffer, vbCrLf)
    For i = UBound(LinkList) To LBound(LinkList) Step -1
        If LinkList(i) <> "" Then
            If InStr(1, LinkList(i), " ") = 0 Then
                Link = LinkList(i)
                Exit For
            End If
        End If
    Next
    If Link = "" Then OcurrioError = 1
End If
If OcurrioError = 1 Then
    Text4.Text = OutBuffer
    Command9.Visible = True
    IconoCtrl8.Visible = True
    Command11.Visible = False
    Command6.Visible = False
    Exit Sub
End If
Call Command9_Click
Call Grabador.IncializarGrabador(Link)
End Sub

Private Sub Command15_Click()
Text2.Text = ""
End Sub

Private Sub Command2_Click()
Dim Comandos As String
If Text2.Text = "" Then
    Call Lang.MsgCDRipGetOutDir
    Exit Sub
End If
If ScriptObj.ExisteCarpeta(Text2.Text) = False Then
    Call Lang.MsgOutDirNotFound(Text2.Text)
    Exit Sub
End If
Comandos = VideoDownloader.GenerarComandosYTDL
If Comandos = "" Then Exit Sub
If Check2.Value = 1 And Combo2.Text <> "" Then Comandos = Comandos & " --output " & Chr(34) & Combo2.Text & Chr(34)
Comandos = Chr(34) & VideoDownloader.YouTubeDLPath & Chr(34) & Comandos & " " & Chr(34) & Text1.Text & Chr(34)
Picture1.Visible = False
Picture3.Visible = True
Menu_File.Enabled = False
Menu_Options.Enabled = False
OptMenu.Enabled = False
Me.Height = 3765
Call CaptureConsole.ExecAndCapture(Comandos, Text2.Text, , 1, Text4, , 3)
Command6.Visible = False
Command11.Visible = False
Command9.Visible = True
IconoCtrl8.Visible = True
End Sub

Private Sub Command3_Click()
Dim Formatos As String, FormatosM() As String, i As Integer
If Text1.Text = "" Then
    Lang.MsgURLNoEspecificada
    Exit Sub
End If
If ScriptObj.ExisteArchivo(VideoDownloader.YouTubeDLPath) = False Then
    Call Lang.MsgyoutubedlNotFound
    Exit Sub
End If
Picture1.Visible = False
Picture2.Visible = True
Menu_File.Enabled = False
OptMenu.Enabled = False
Menu_Options.Enabled = False
Formatos = VideoDownloader.ListarFormatosDisponibles
Command7.Visible = False
Command12.Visible = False
Command4.Visible = True
IconoCtrl6.Visible = True
If Formatos = "" Then
    Label6.Visible = True
    Label4.Visible = False
Else
    FormatosM = Split(Formatos, vbCrLf)
    For i = LBound(FormatosM) To UBound(FormatosM)
        List1.AddItem FormatosM(i)
    Next
    Label5.Visible = True
    List1.Visible = True
    Command5.Visible = True
    IconoCtrl7.Visible = True
    Label4.Visible = False
    Check4.Visible = True
End If
End Sub

Private Sub Command4_Click()
Dim i As Integer, IndiceSeleccionados() As Integer, nSeleccionados As Integer, j As Integer, k As Integer
If List1.Visible = True Then
    For i = 0 To List1.ListCount - 1
        If List1.Selected(i) = True Then
            nSeleccionados = nSeleccionados + 1
            ReDim Preserve IndiceSeleccionados(1 To nSeleccionados)
            IndiceSeleccionados(nSeleccionados) = i
        End If
    Next
    If nSeleccionados = 0 Then
        MsgBox Replace(Label5.Caption, ":", ""), vbOKOnly, Form1.Caption
        Exit Sub
    Else
        For k = 1 To nSeleccionados
            j = IndiceSeleccionados(k)
            i = InStr(1, List1.List(j), " ")
            If i = 0 Then
                Call Lang.MsgErrorObteniendoIDDeFormato(List1.List(j))
                Exit Sub
            Else
                If k = 1 Then Text3.Text = Left(List1.List(j), i - 1) Else Text3.Text = Text3.Text & "," & Left(List1.List(j), i - 1)
            End If
        Next
    End If
End If
Call Command5_Click
End Sub

Private Sub Command5_Click()
Call VideoDownloader.RestaurarCuadroSelFormato
Picture2.Visible = False
Picture1.Visible = True
Menu_File.Enabled = True
OptMenu.Enabled = True
Menu_Options.Enabled = True
End Sub

Private Sub Command6_Click()
Call CaptureConsole.SendCtrlC
End Sub

Private Sub Command7_Click()
Call CaptureConsole.SendCtrlC
End Sub

Private Sub Command8_Click()
Dim Portapapeles As String
Portapapeles = Clipboard.GetText
If Portapapeles = "" Then Exit Sub
Text1.Text = Portapapeles
Text1.SelStart = Len(Text1.Text)
End Sub

Private Sub Command9_Click()
Command9.Visible = False
IconoCtrl8.Visible = False
Command6.Visible = True
Command11.Visible = True
Menu_File.Enabled = True
Menu_Options.Enabled = True
OptMenu.Enabled = True
Text4.Text = ""
Picture3.Visible = False
Picture1.Visible = True
IsPlaying = 0
Me.Height = 6405
End Sub

Private Sub File_Salir_Click()
Unload Me
End Sub

Private Sub Form_Load()
Me.Height = 6405
Me.Width = 5610

Call Lang.Form23Captions
Picture1.BorderStyle = 0
Picture2.BorderStyle = 0
Picture3.BorderStyle = 0
Picture2.Top = Picture1.Top
Picture3.Top = Picture1.Top
Picture2.Left = Picture1.Left
Picture3.Left = Picture1.Left
Text2.Text = VideoDownloader.DownloadDir
Text1.Text = VideoDownloader.DownloadURL
Combo1.ListIndex = VideoDownloader.CalidadIndex
Text3.Text = VideoDownloader.FormatoEspecificado
Call APIS.AddHScroll_listbox(List1, 1800)
Command11.Caption = Command6.Caption & " (force)"
Command12.Caption = Command11.Caption
Opt_ValCert.Checked = (VideoDownloader.VlCertificado = 1)
Opt_ErrIgn.Checked = (VideoDownloader.IgnorarErrores = 1)
Text5.Text = VideoDownloader.ItemsPlayList
Check1.Value = VideoDownloader.HabilitarItemsPlayList
Check2.Value = VideoDownloader.EspecificarNombreArchivoSalida
Combo2.Text = VideoDownloader.NombreArchivoSalida
Check3.Value = VideoDownloader.HabilitarComandosAdicionales
Text6.Text = VideoDownloader.ComandosAdicionales
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If Menu_File.Enabled = False Then Cancel = 1
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set Form23 = Nothing
End Sub

Private Sub Help_GotoYtweb_Click()
Call APIS.APIAbrirArchivo("https://ytdl-org.github.io/youtube-dl/index.html")
End Sub

Private Sub Help_Version_Click()
Dim Comandos As String
If ScriptObj.ExisteArchivo(VideoDownloader.YouTubeDLPath) = False Then
    Call Lang.MsgyoutubedlNotFound
    Exit Sub
End If
Comandos = Chr(34) & VideoDownloader.YouTubeDLPath & Chr(34) & " --version"
Call IntDocView.IniciarDocVisor(Comandos, Form23)
End Sub

Private Sub List1_Click()
Dim i As Integer, n As Integer
If List1.ListIndex = -1 Then Exit Sub
For i = 0 To List1.ListCount - 1
    If List1.Selected(i) = True Then n = n + 1
Next
Select Case n
    Case 0: Check4.Value = 0
    Case Is = List1.ListCount: Check4.Value = 1
    Case Else: Check4.Value = 2
End Select
End Sub

Private Sub Opt_ChanBufferSize_Click()
Dim Ret As String
Ret = Lang.SetInpBuffSize(CStr(VideoDownloader.BufferSizeValue))
If Ret = "" Then Exit Sub
If IsNumeric(Ret) = False Then
Lang.Grabador_Msg_BuffSizeNoValid
Exit Sub
End If
If InStr(1, Ret, "-") > 0 Or InStr(1, Ret, ".") > 0 Or InStr(1, Ret, ",") > 0 Then
Lang.Grabador_Msg_BuffSizeNoValid
Exit Sub
End If
VideoDownloader.BufferSizeValue = CInt(Ret)
End Sub

Private Sub Opt_CleanAll_Click()
Text1.Text = ""
Text5.Text = ""
Text2.Text = ""
Combo2.Text = ""
Text3.Text = ""
Text6.Text = ""
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Combo1.ListIndex = 0
End Sub

Private Sub Opt_ErrIgn_Click()
Opt_ErrIgn.Checked = Not Opt_ErrIgn.Checked
If Opt_ErrIgn.Checked = True Then VideoDownloader.IgnorarErrores = 1 Else VideoDownloader.IgnorarErrores = 0
End Sub

Private Sub Opt_ValCert_Click()
Opt_ValCert.Checked = Not Opt_ValCert.Checked
If Opt_ValCert.Checked = True Then VideoDownloader.VlCertificado = 1 Else VideoDownloader.VlCertificado = 0
End Sub

Private Sub Options_About_Click()
Call VideoDownloader.AcercaDeYoutubeDL
End Sub

Private Sub Options_ConfigPath_Click()
Load Form9
Form9.Show vbModal, Form23
End Sub

Private Sub Options_List_Click()
Dim Comando As String
If ScriptObj.ExisteArchivo(VideoDownloader.YouTubeDLPath) = False Then
    Lang.MsgyoutubedlNotFound
    Exit Sub
End If
Comando = Chr(34) & VideoDownloader.YouTubeDLPath & Chr(34) & " --list-extractors"
Call IntDocView.IniciarDocVisor(Comando, Form23)
End Sub

Private Sub Options_ShowHelp_Click()
Call VideoDownloader.MostrarAyuda(Form23)
End Sub


Private Sub Text1_Change()
VideoDownloader.DownloadURL = Text1.Text
End Sub

Private Sub Text2_Change()
Text2.SelStart = Len(Text2.Text)
VideoDownloader.DownloadDir = Text2.Text
End Sub

Private Sub Text3_Change()
VideoDownloader.FormatoEspecificado = Text3.Text
End Sub

Private Sub Text5_Change()
VideoDownloader.ItemsPlayList = Text5.Text
End Sub

Private Sub Text6_Change()
VideoDownloader.ComandosAdicionales = Text6.Text
End Sub
