diff --git a/controller/ftpdownloader.php b/controller/ftpdownloader.php index 83b3a37..cbdad25 100644 --- a/controller/ftpdownloader.php +++ b/controller/ftpdownloader.php @@ -126,6 +126,9 @@ public function add() if (isset ($_POST['OPTIONS']['FTPUseragent']) && strlen (trim ($_POST['OPTIONS']['FTPUseragent'])) > 0) { $OPTIONS['user-agent'] = $_POST['OPTIONS']['FTPUseragent']; } + if (isset ($_POST['OPTIONS']['FTPOutfilename']) && strlen (trim ($_POST['OPTIONS']['FTPOutfilename'])) > 0) { + $OPTIONS['out'] = $_POST['OPTIONS']['FTPOutfilename']; + } if (isset($_POST['OPTIONS']['FTPPasv']) && strlen(trim($_POST['OPTIONS']['FTPPasv'])) > 0) { $OPTIONS['ftp-pasv'] = strcmp($_POST['OPTIONS']['FTPPasv'], "true") == 0 ? true : false; } diff --git a/controller/httpdownloader.php b/controller/httpdownloader.php index 54b0329..3ef0b04 100644 --- a/controller/httpdownloader.php +++ b/controller/httpdownloader.php @@ -122,9 +122,12 @@ public function add() if (isset ($_POST['OPTIONS']['HTTPReferer']) && strlen (trim ($_POST['OPTIONS']['HTTPReferer'])) > 0) { $OPTIONS['referer'] = $_POST['OPTIONS']['HTTPReferer']; } - if (isset ($_POST['OPTIONS']['HTTPUseragent']) && strlen (trim ($_POST['OPTIONS']['HTTPUseragent'])) > 0) { + if (isset ($_POST['OPTIONS']['HTTPUseragent']) && strlen (trim ($_POST['OPTIONS']['HTTPUseragent'])) > 0) { $OPTIONS['user-agent'] = $_POST['OPTIONS']['HTTPUseragent']; } + if (isset ($_POST['OPTIONS']['HTTPOutfilename']) && strlen (trim ($_POST['OPTIONS']['HTTPOutfilename'])) > 0) { + $OPTIONS['out'] = $_POST['OPTIONS']['HTTPOutfilename']; + } if (!$this->ProxyOnlyWithYTDL && !is_null($this->ProxyAddress) && $this->ProxyPort > 0 && $this->ProxyPort <= 65536) { $OPTIONS['all-proxy'] = rtrim($this->ProxyAddress, '/') . ':' . $this->ProxyPort; diff --git a/js/add.js b/js/add.js index f3c01ee..86e2787 100644 --- a/js/add.js +++ b/js/add.js @@ -68,7 +68,8 @@ $(document).ready (function () HTTPUser: $('#option-http-user').val (), HTTPPasswd: $('#option-http-pwd').val (), HTTPReferer: $('#option-http-referer').val (), - HTTPUseragent: $('#option-http-useragent').val () + HTTPUseragent: $('#option-http-useragent').val (), + HTTPOutfilename: $('#option-http-outfilename').val () }); } else @@ -81,6 +82,7 @@ $(document).ready (function () $('#option-http-pwd').val (''); $('#option-http-referer').val (''); $('#option-http-useragent').val (''); + $('#option-http-outfilename').val (''); }); // Launch FTP download @@ -96,7 +98,8 @@ $(document).ready (function () FTPPasswd: $('#option-ftp-pwd').val (), FTPPasv: $('#option-ftp-pasv').prop ('checked'), FTPReferer: $('#option-ftp-referer').val (), - FTPUseragent: $('#option-ftp-useragent').val () + FTPUseragent: $('#option-ftp-useragent').val (), + FTPOutfilename: $('#option-ftp-outfilename').val () }); } else diff --git a/js/add.min.js b/js/add.min.js index eb85fc5..f95c9c4 100644 --- a/js/add.min.js +++ b/js/add.min.js @@ -1 +1 @@ -$(document).ready(function(){$("#ball").Badger("..."),$("#bcompletes").Badger("..."),$("#bactives").Badger("..."),$("#bwaitings").Badger("..."),$("#bstopped").Badger("..."),$("#bremoved").Badger("..."),OCDLR.Utils.UpdateQueue(!0,"add"),$("#NewDL").bind("click",function(){$(this).children("ul").is(":visible")?$(this).children("ul").hide():$(this).children("ul").show()}),$("#NewDL").children("div").children("p").bind("click",function(){$("#app-content-wrapper .content-page").hide(),$("#app-content-wrapper .content-page[rel="+$(this).attr("data-rel")+"]").show()}),$("#NewDL").children("div").bind("click",function(){$("#app-content-wrapper .content-page").hide(),$("#app-content-wrapper .content-page[rel="+$(this).attr("data-rel")+"]").show()}),$("#option-ftp-pasv").prop("checked",!0),$("#option-yt-extractaudio").prop("checked",!1),$("#option-yt-forceipv4").prop("checked",!0),$("#option-bt-rmtorrent").prop("checked",!0),$("#TorrentsList").bind("click",function(){OCDLR.Utils.GetTorrentsList($(this).children("ul"))}),$("#app-content-wrapper .content-page[rel=OCDHTTP] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"http",e.val(),{HTTPUser:$("#option-http-user").val(),HTTPPasswd:$("#option-http-pwd").val(),HTTPReferer:$("#option-http-referer").val(),HTTPUseragent:$("#option-http-useragent").val()}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-http-user").val(""),$("#option-http-pwd").val(""),$("#option-http-referer").val(""),$("#option-http-useragent").val("")}),$("#app-content-wrapper .content-page[rel=OCDFTP] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"ftp",e.val(),{FTPUser:$("#option-ftp-user").val(),FTPPasswd:$("#option-ftp-pwd").val(),FTPPasv:$("#option-ftp-pasv").prop("checked"),FTPReferer:$("#option-ftp-referer").val(),FTPUseragent:$("#option-ftp-useragent").val()}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-ftp-user").val(""),$("#option-ftp-pwd").val(""),$("#option-ftp-pasv").prop("checked",!0),$("#option-ftp-referer").val(""),$("#option-ftp-useragent").val("")}),$("#app-content-wrapper .content-page[rel=OCDYT] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"yt",e.val(),{YTExtractAudio:$("#option-yt-extractaudio").prop("checked"),YTForceIPv4:$("#option-yt-forceipv4").prop("checked")}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-yt-extractaudio").prop("checked",!1),$("#option-yt-forceipv4").prop("checked",!0)}),$("#app-content-wrapper .content-page[rel=OCDBT] div.launch").bind("click",function(){var e=$("#TorrentsList").children("a"),o=t("ocdownloader","Select a file.torrent");e.text().trim()!=o.trim()&&"File"==e.prop("data-rel")&&OCDLR.Utils.AddDownload($(this),"bt",e.text(),{BTRMTorrent:$("#option-bt-rmtorrent").prop("checked")}),e.text(o),$("#option-bt-rmtorrent").prop("checked",!0)});var e=$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile #uploadfile").fileupload({autoUpload:!0,sequentialUploads:!0,type:"POST",dataType:"json"});e.on("fileuploadstart",function(t,e){$("#TorrentsList").children("ul").hide(),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").removeClass("icon-upload"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").addClass("icon-loading-small"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile input").prop("disabled",!0)}),e.on("fileuploaddone",function(t,e){e.result.ERROR?OCDLR.Utils.PrintError(e.result.MESSAGE):OCDLR.Utils.PrintInfo(e.result.MESSAGE),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile input").prop("disabled",!1),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").removeClass("icon-loading-small"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").addClass("icon-upload")}),e.on("fileuploadfail",function(e,o){OCDLR.Utils.PrintError(t("ocdownloader","Error while uploading torrent file"))}),OCDLR.Utils.GetCounters()}); \ No newline at end of file +$(document).ready(function(){$("#ball").Badger("..."),$("#bcompletes").Badger("..."),$("#bactives").Badger("..."),$("#bwaitings").Badger("..."),$("#bstopped").Badger("..."),$("#bremoved").Badger("..."),OCDLR.Utils.UpdateQueue(!0,"add"),$("#NewDL").bind("click",function(){$(this).children("ul").is(":visible")?$(this).children("ul").hide():$(this).children("ul").show()}),$("#NewDL").children("div").children("p").bind("click",function(){$("#app-content-wrapper .content-page").hide(),$("#app-content-wrapper .content-page[rel="+$(this).attr("data-rel")+"]").show()}),$("#NewDL").children("div").bind("click",function(){$("#app-content-wrapper .content-page").hide(),$("#app-content-wrapper .content-page[rel="+$(this).attr("data-rel")+"]").show()}),$("#option-ftp-pasv").prop("checked",!0),$("#option-yt-extractaudio").prop("checked",!1),$("#option-yt-forceipv4").prop("checked",!0),$("#option-bt-rmtorrent").prop("checked",!0),$("#TorrentsList").bind("click",function(){OCDLR.Utils.GetTorrentsList($(this).children("ul"))}),$("#app-content-wrapper .content-page[rel=OCDHTTP] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"http",e.val(),{HTTPUser:$("#option-http-user").val(),HTTPPasswd:$("#option-http-pwd").val(),HTTPReferer:$("#option-http-referer").val(),HTTPUseragent:$("#option-http-useragent").val(),HTTPOutfilename:$("#option-http-outfilename").val()}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-http-user").val(""),$("#option-http-pwd").val(""),$("#option-http-referer").val(""),$("#option-http-useragent").val(""),$("#option-http-outfilename").val("")}),$("#app-content-wrapper .content-page[rel=OCDFTP] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"ftp",e.val(),{FTPUser:$("#option-ftp-user").val(),FTPPasswd:$("#option-ftp-pwd").val(),FTPPasv:$("#option-ftp-pasv").prop("checked"),FTPReferer:$("#option-ftp-referer").val(),FTPUseragent:$("#option-ftp-useragent").val(),FTPOutfilename:$("#option-ftp-outfilename").val()}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-ftp-user").val(""),$("#option-ftp-pwd").val(""),$("#option-ftp-pasv").prop("checked",!0),$("#option-ftp-referer").val(""),$("#option-ftp-useragent").val("")}),$("#app-content-wrapper .content-page[rel=OCDYT] div.launch").bind("click",function(){var e=$(this).parent().parent().children("input.url");OCDLR.Utils.ValidURL(e.val())?OCDLR.Utils.AddDownload($(this),"yt",e.val(),{YTExtractAudio:$("#option-yt-extractaudio").prop("checked"),YTForceIPv4:$("#option-yt-forceipv4").prop("checked")}):OCDLR.Utils.PrintError(t("ocdownloader","Invalid URL. Please check the address of the file ...")),e.val(""),$("#option-yt-extractaudio").prop("checked",!1),$("#option-yt-forceipv4").prop("checked",!0)}),$("#app-content-wrapper .content-page[rel=OCDBT] div.launch").bind("click",function(){var e=$("#TorrentsList").children("a"),o=t("ocdownloader","Select a file.torrent");e.text().trim()!=o.trim()&&"File"==e.prop("data-rel")&&OCDLR.Utils.AddDownload($(this),"bt",e.text(),{BTRMTorrent:$("#option-bt-rmtorrent").prop("checked")}),e.text(o),$("#option-bt-rmtorrent").prop("checked",!0)});var e=$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile #uploadfile").fileupload({autoUpload:!0,sequentialUploads:!0,type:"POST",dataType:"json"});e.on("fileuploadstart",function(t,e){$("#TorrentsList").children("ul").hide(),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").removeClass("icon-upload"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").addClass("icon-loading-small"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile input").prop("disabled",!0)}),e.on("fileuploaddone",function(t,e){e.result.ERROR?OCDLR.Utils.PrintError(e.result.MESSAGE):OCDLR.Utils.PrintInfo(e.result.MESSAGE),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile input").prop("disabled",!1),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").removeClass("icon-loading-small"),$("#app-content-wrapper .content-page[rel=OCDBT] div.uploadfile label").addClass("icon-upload")}),e.on("fileuploadfail",function(e,o){OCDLR.Utils.PrintError(t("ocdownloader","Error while uploading torrent file"))}),OCDLR.Utils.GetCounters()}); \ No newline at end of file diff --git a/templates/add.php b/templates/add.php index 6b3b12f..1837a18 100644 --- a/templates/add.php +++ b/templates/add.php @@ -69,6 +69,7 @@ + @@ -88,6 +89,7 @@ +