【发布时间】:2015-11-01 04:58:23
【问题描述】:
我一直在尝试将下载管理器(特别是 JDownloader 和/或 IDM)与我制作的下载文件的脚本集成。
先决条件之一是我需要能够将从 URL 中找到的文件重命名为某个名称(脚本已知)。我发现很难用 JDownloader 的Click'n'Load 2 更改文件名。此外,与 IDM 集成似乎是不可能的,因为它需要 NPAPI,据我所知,它正在被逐步淘汰……否则请告诉我:)
我目前拥有的 JDownloader 是 this jsfiddle,它通过其中一项服务添加了到 JDownloader 的链接(注意:JDownloader 必须正在运行!)。
我遇到的问题是:
- 视频流未正确添加到 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);
})
【问题讨论】:
-
这与 NPAPI 完全没有关系;您不能使用 NPAPI 执行此处显示的任何操作。
标签: javascript jquery filenames jdownloader