命名下载发送到JDownloader和/或IDM

时间:2015-11-01 04:58:23

标签: javascript jquery filenames jdownloader

我一直在尝试将下载管理器(特别是JDownloader和/或IDM)与我下载文件的脚本集成在一起。

其中一个先决条件是我需要能够将从URL找到的文件重命名为某个名称(脚本已知)。我发现用JDownloader的Click'n'Load 2更改文件名很困难。此外,与IDM的集成似乎是不可能的,因为它需要NPAPI据我所知正在逐步淘汰......让我知道其他情况:)

我目前为JDownloader提供的是this jsfiddle,它通过其中一个服务添加了一个指向JDownloader的链接(注意:JDownloader必须正在运行!)。

我遇到的问题是:

  1. 视频流无法正确添加到JDownloader(而其他链接似乎正常工作,并通过链接抓取工具手动添加)
  2. 代码不会更改文件名,这是我的脚本
  3. 所需的

    任何帮助都会非常感激。提前谢谢。

    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);
    })
    

1 个答案:

答案 0 :(得分:0)

对于这样一个含糊不清的问题感到抱歉......我正在寻找的答案(供参考)是:

  1. 视频流未正确添加,因为它是重定向
  2. 要更改文件名,Google(方便地)会提供title选项的使用以更改流的名称。例如,使用title = homer%20simpson会将文件名从videoplayback更改为&#34; homer simpson&#34;