Get anime download links from http://donghua.dmzj.com/
目前為
// ==UserScript==
// @name Dmzj Anime Downloader
// @description Get anime download links from http://donghua.dmzj.com/
// @include http://donghua.dmzj.com/*
// @version 0.0.1.20140803022318
// @namespace https://greasyfork.org/users/2233
// ==/UserScript==
var wnd = window
var doc = wnd.document
var loc = location
var href = loc.href
if(/^http:\/\/donghua\.dmzj\.com\//.test(href))
{
var imgs = doc.getElementsByTagName('IMG')
for(var i=imgs.length-1; i>=0; i--)
{
imgs[i].onclick = function(evt)
{
evt.preventDefault()
if(this.style.visibility == 'visible' || this.style.visibility == ''){ this.style.visibility = 'hidden' }
else if(this.style.visibility == 'hidden'){ this.style.visibility = 'visible' }
}
}
if(!/\/donghua_play\//.test(href)){ throw 'exit' }
addEventListener("DOMContentLoaded", function(){
var cites = doc.querySelectorAll('.cite-tools>ul>li>a')
for(var i=cites.length-1; i>=0; i--)
{
let f = '(' + cites[i].onclick.toString() + ')()'
cites[i].onclick = function(evt)
{
eval(f)
if(evt.ctrlKey){ evt.preventDefault(); return }
var m = /PlayerBox\.play\(['"]([^'"]*)['"],['"]([^'"]*)['"]/.exec(f)
if(m == null)
{
alert("Error: Cannot find Playerbox.play(...).")
return
}
var site_name = m[1]
var vid = m[2]
// http://donghua.dmzj.com/js/donghua_play.js
var vid_url = '', parse_service = ''
if(site_name == 'letv')
{
vid_url = 'http://www.letv.com/ptv/vplay/' + vid + '.html'
parse_service = 'flvxz'
}
else if(site_name == 'letvyun')
{
vid_url = 'http://yuntv.letv.com/bcloud.swf?uu=d955239f11&vu=' + vid + '&auto_play=1&gpcflag=1&allowFullScreen=true&quality=high&allowScriptAccess=always&type=application/x-shockwave-flash'
parse_service = 'flvxz'
}
else if(site_name == 'tudou' || site_name == 'tudou2')
{
if(/^\d+$/.test(vid))
{
vid_url = 'http://js.tudouui.com/bin/lingtong/PortalPlayer_53.swf?iid=' + vid
}
else
{
vid_url = 'http://www.tudou.com/programs/view/' + vid
}
parse_service = 'flvxz'
}
else if(site_name == 'weiyun')
{
if(!/\.mp4$/.test(vid)){ vid = vid + '.mp4' }
vid_url = 'http://donghuaget.duapp.com/weiyun/' + vid
parse_service = 'none'
}
else if(site_name == 'qingkong')
{
if(!/\.mp4$/.test(vid)){ vid = vid + '.mp4' }
vid_url = 'http://v.qingkong.net/bp/a.php/' + vid
parse_service = 'none'
}
else if(site_name == 'qq' || site_name == 'qq2')
{
vid_url = 'http://cache.tv.qq.com/qqplayerout.swf?vid=' + vid
parse_service = 'flvxz'
}
else if(site_name == 'youku')
{
vid_url = 'http://v.youku.com/v_show/id_' + vid
parse_service = 'flvxz'
}
else if(site_name == 'sina')
{
vid_url = 'http://p.you.video.sina.com.cn/player/outer_player.swf?vid=' + vid
parse_service = 'flvxz'
}
else if(site_name == 'sohu')
{
vid_url = 'http://share.vrs.sohu.com/my/v.swf&id=' + vid
parse_service = 'flvxz'
}
else if(site_name == 'cntv')
{
vid_url = 'http://player.cntv.cn/standard/cntvOutSidePlayer.swf?videoId=VIDE100165778382&videoCenterId=' + vid
parse_service = 'flvxz'
}
else if(site_name == '56')
{
vid_url = 'http://player.56.com/v_' + vid + '.swf'
parse_service = 'flvxz'
}
else if(site_name == 'pptv')
{
vid_url = 'http://v.pptv.com/show/' + vid + '.html'
parse_service = 'flvxz'
}
else if(site_name == 'ku6')
{
vid_url = 'http://player.ku6.com/refer/' + vid + '/v.swf'
parse_service = 'flvxz'
}
else if(site_name == 'qiyi')
{
vid_url = 'http://www.iqiyi.com/player/20130129155059/SharePlayer.swf?vid=' + vid
parse_service = 'flvxz'
}
else if(site_name == 'other')
{
var p, m2
// letv
p = m2 = ''
if(vid_url == '')
{
p = /letv\.com\/player\/swfPlayer\.swf\?.*?id=(\d+)/g
m2 = p.exec(vid)
if(m2 != null)
{
vid_url = 'http://www.letv.com/ptv/vplay/' + m2[1] + '.html'
parse_service = 'flvxz'
}
}
if(vid_url == '')
{
p = /player\.letvcdn\.com\/.*?\?.*?id=(\d+)/g
m2 = p.exec(vid)
if(m2 != null)
{
vid_url = 'http://www.letv.com/ptv/vplay/' + m2[1] + '.html'
parse_service = 'flvxz'
}
}
// tudou
p = m2 = ''
if(vid_url == '')
{
if(/\biid=(\d{9})/.test(vid))
{
vid_url = vid
parse_service = 'flvxz'
}
}
// 56
p = m2 = ''
if(vid_url == '')
{
if(/\bplayer\.56\.com\b/.test(vid))
{
vid_url = vid
parse_service = 'flvxz'
}
}
// b9dm
p = m2 = ''
if(vid_url == '')
{
p = /http:\/\/swf\.b9dm\.com\/[^'"]*?file=([^'"]+)/g
m2 = p.exec(vid)
if(m2 != null)
{
vid_url = m2[1]
parse_service = 'none'
}
}
// file=...
p = m2 = ''
if(vid_url == '')
{
p = /[^'"]+?file=([^'"&]+)/g
m2 = p.exec(vid)
if(m2 != null)
{
vid_url = m2[1]
parse_service = 'none'
}
}
// whatever else
p = m2 = ''
if(vid_url == '')
{
vid_url = vid
parse_service = 'flvxz'
}
}
if(vid_url == '')
{
alert("Error: Cannot find the video url.")
return
}
var parse_url = ''
if(parse_service == 'flvxz')
{
parse_url = 'http://www.flvxz.com/?url=' + encodeURIComponent(vid_url)
}
else if(parse_service == 'flvcd')
{
parse_url = 'http://www.flvcd.com/parse.php?kw=' + encodeURIComponent(vid_url)
}
else if(parse_service == 'none')
{
parse_url = vid_url
}
wnd.open(parse_url, '_blank')
}
}
}, false)
}