// ==UserScript== // @name 江视网台视频下载 // @namespace http://weibo.com/liangxiafengge // @version 0.1 // @description 江西网络电视台(jxntv.cn)视频下载,有时下载会失效,建议多试几次 // @author coolwind // @run-at document-end // @match http://v.jxntv.cn/* // @grant GM_xmlhttpRequest // @icon http://v.jxntv.cn/assets/images/iconLogo.jpg // @downloadURL none // ==/UserScript== /* jshint -W097 */ 'use strict'; //alert(fvar.file); var MbdownBTN=document.createElement('a'); MbdownBTN.href="http://dianbo02.jxntv.cn/"+fvar.file; MbdownBTN.text="下载此视频的标清版"; var PCdownBTN=document.createElement('a'); var downIco =document.createElement('img'); downIco.src="http://www.easyicon.net/api/resizeApi.php?id=1185846&size=16"; //PCdownBTN.href="http://dianbo01.jxntv.cn/"+fvar.file; //PCdownBTN.text="高清"; var next=document.getElementsByClassName('player'); prependChild(next[0],MbdownBTN); prependChild(next[0],MbdownBTN); prependChild(next[0],downIco); //在指定节点前插入 function prependChild(parent,newChild){ if(parent.firstChild){ parent.insertBefore(newChild,parent.firstChild); } else { parent.appendChild(newChild); } return parent; }