I've been trying to integrate download managers (in particular, JDownloader and/or IDM) with a script I made that download files.
One of the prerequisites is that I need to be able to rename the file found from the URL to a certain name (that is known by the script). I'm finding it difficult to change the filename with JDownloader's Click'n'Load 2. Additionally, integration with IDM seems impossible as it requires NPAPI which is being phased out as far as I know... let me know otherwise :)
What I currently have for JDownloader is this jsfiddle, which adds a link to JDownloader through one of it's services (Note: JDownloader must be running!).
The problem that I am having is that:
- The video stream does not correctly add to JDownloader (whereas other links seem to work AND adding it manually through link grabber works as well)
- The code does not change the filename, which is what is required by my script
Any help at all would be much appreciated. Thanks in advance.
HTML:
<!-- A link that does not work, type is direct video stream, works through manual links adding but not through Click'n'Load -->
<input type='button' id='testTitle' value='Test title' link='https://2.bp.blogspot.com/2p41_DNcufgUPAgtoT-DyGVK2rdyCz8PLfNAMhSegg=m18'>
<!-- A link that works, type is .exe from rapidshare.com -->
<input type='button' id='rapidShare' value='RapidShare' link='http://www.rapidshare.com/files/407970280/RapidShareManager2WindowsSetup.exe'>
JS:
//The function that adds the link to JDownload
function JDownload(title, url){
$.post("http://127.0.0.1:9666/flash/add", {
urls:url,
fileName:title //This does not work...
});
}
//Buttons for convenience
$("input[type='button']").click(function(){
var title = $(this).attr("value");
var link = $(this).attr("link");
JDownload(title, link);
})
Sorry for such an ambiguous question... The answers I was looking for (for reference) are: