diff --git a/Project files/RTMP-Downloader/Descargador.cs b/Project files/RTMP-Downloader/Descargador.cs index 060f0cb..06e8454 100644 --- a/Project files/RTMP-Downloader/Descargador.cs +++ b/Project files/RTMP-Downloader/Descargador.cs @@ -60,9 +60,17 @@ public bool download () string parametroO = Utilidades.GetParametro(url, "o"); if(parametroO.IndexOf(":\\") == -1){ - url = Utilidades.ReemplazaParametro (url, "o", MainClass.configs.rutaDescargas + parametroO); } + + if(MainClass.configs.proxy != null && MainClass.configs.proxy != ""){ + if(Utilidades.GetParametro(url, "S")!=""){ + url = Utilidades.ReemplazaParametro (url, "S", MainClass.configs.proxy); + } + else{ + url += " -S \""+MainClass.configs.proxy+"\""; + } + } Debug.WriteLine(Utilidades.WL("Iniciando proceso RTMPDump para = "+url)); procesoRTMPDUMP = new ProcessStartInfo (); diff --git a/Project files/RTMP-Downloader/HTML.cs b/Project files/RTMP-Downloader/HTML.cs index 116ac72..eb588c9 100644 --- a/Project files/RTMP-Downloader/HTML.cs +++ b/Project files/RTMP-Downloader/HTML.cs @@ -47,6 +47,12 @@ public static class HTML "
Dónde se guardarán la descargas:
" + "
Ruta actual: "+MainClass.configs.rutaDescargas+"
" + "Elejir dónde guardar los vídeos
" + + "
Configurar un proxy:
" + + "
"+ + "
Proxy: " + + "
" + + "Para no usar proxy guarda el campo Proxy vacio." + + ""+ "
"; } diff --git a/Project files/RTMP-Downloader/MainClass.cs b/Project files/RTMP-Downloader/MainClass.cs index be9edcf..900176a 100644 --- a/Project files/RTMP-Downloader/MainClass.cs +++ b/Project files/RTMP-Downloader/MainClass.cs @@ -64,7 +64,7 @@ public static void Main (string[] cmdLine) configs = Utilidades.leerConfigs (); - if (configs.rutaDescargas == null) { + if (configs.rutaDescargas == null || configs.rutaDescargas == "") { configs.rutaDescargas = relativePath; Utilidades.escribirConfigs (configs); } @@ -164,7 +164,12 @@ public static void Main (string[] cmdLine) } //Descargar urlhttp para usar el contenido como url try{ - url = new WebClient().DownloadString(urlhttp); + WebClient client = new WebClient(); + if(configs.proxy != null && configs.proxy != ""){ + WebProxy wp = new WebProxy(configs.proxy); + client.Proxy = wp; + } + url = client.DownloadString(urlhttp); Debug.WriteLine(Utilidades.WL("url descargada desde urlhttp = "+url)); Debug.WriteLine(Utilidades.WL("Poniendo la descarga en cola")); var t = new Thread(() => lanzaDescarga(url, nombre)); @@ -225,6 +230,14 @@ public static void Main (string[] cmdLine) myServer.EnviaLocation ("/opciones"); continue; } + + if (path == "/elijeproxy") { + string proxy = GETurl.getParametro("valor"); + configs.proxy = proxy; + Utilidades.escribirConfigs (configs); + myServer.EnviaLocation ("/opciones"); + continue; + } if (path == "/" && accion == "") { myServer.Envia (HTML.getIndex()); diff --git a/Project files/RTMP-Downloader/Utilidades.cs b/Project files/RTMP-Downloader/Utilidades.cs index 50c4ddc..258da8c 100644 --- a/Project files/RTMP-Downloader/Utilidades.cs +++ b/Project files/RTMP-Downloader/Utilidades.cs @@ -84,6 +84,7 @@ public static int UnixTimestamp() [Serializable] public class Configs{ public string rutaDescargas; + public string proxy; } public class Bloqueo{ diff --git a/Project files/RTMP-Downloader/web/css/all.css b/Project files/RTMP-Downloader/web/css/all.css index 3a92614..845fd75 100644 --- a/Project files/RTMP-Downloader/web/css/all.css +++ b/Project files/RTMP-Downloader/web/css/all.css @@ -225,4 +225,5 @@ li { } .contenidoCONT{ font-size: 15px; + margin-bottom: 30px; } \ No newline at end of file