命名下载发送到JDownloader和/或IDM
Naming downloads sent to JDownloader and/or IDM
我一直在尝试将下载管理器(特别是JDownloader和/或IDM)与我制作的下载文件的脚本集成。
先决条件之一是,我需要能够将从URL中找到的文件重命名为某个名称(脚本已知)。我发现用JDownloader的Click'n'Load 2很难更改文件名。此外,与IDM的集成似乎是不可能的,因为它需要NPAPI,据我所知,NPAPI正在逐步淘汰。。。否则请告诉我:)
我目前对JDownloader拥有的是这个jsfiddle,它通过它的一个服务添加了一个到JDownloader的链接(注意:JDownloaders必须正在运行!)。
我遇到的问题是:
- 视频流没有正确添加到JDownloader(而其他链接似乎可以工作,通过链接抓取器手动添加也可以)
- 代码不会更改文件名,这是我的脚本所要求的
任何帮助都将不胜感激。提前谢谢。
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);
})
很抱歉问了这么一个模棱两可的问题。。。我一直在寻找(供参考)的答案是:
- 视频流没有正确添加,因为它是重定向
- 为了更改文件名,谷歌(方便地)提供了使用title选项来更改流的名称。例如,使用title=homer%20simpson会将文件名从视频播放更改为"homer simpson"