Created
September 17, 2011 09:16
-
-
Save teslamint/1223777 to your computer and use it in GitHub Desktop.
ClickToFlash SKComms Video(Nate/Egloos/Cyworld) Killer Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addKiller("SKCommsVideo", { | |
"canKill": function(data) { | |
if (/v.nate.com/.test(data.src)) { data.site="nate"; return true;} | |
if (/v.(egloos|empas).com/.test(data.src)) { data.site="egloos"; return true;} | |
if (/dbi.video.cyworld(.nate)?.com/.test(data.src)) { data.site="cyworld"; return true; } | |
return false; | |
}, | |
"process": function(data, callback) { | |
var flashvars = parseFlashVariables(data.params.flashvars); | |
// nate (pann, video, ...) | |
if(data.site=="nate") { | |
if(flashvars.mov_id && flashvars.v_key) { | |
this.processNateVideoXml(flashvars.mov_id, flashvars.v_key, callback); | |
} | |
// embedded Nate video | |
var match = data.src.replace("|", "%7C").match(/\/([0-9]+)%7C([0-9]+)\/([0-9]+)/); | |
if (match) { | |
this.processNateVideoID(match[3], callback); | |
} | |
return; | |
} | |
// Cyworld (merged by Nate) | |
if(data.site=="cyworld") { | |
if(flashvars.mov_id) { | |
this.processNateVideoID(flashvars.mov_id, callback); | |
} | |
// embedded Nate video | |
var match = data.src.replace("|", "%7C").match(/\/([0-9]+)%7C([0-9]+)\/([0-9]+)/); | |
if (match) { | |
this.processNateVideoID(match[3], callback); | |
} | |
return; | |
} | |
// egloos (blog) | |
if(data.site=="egloos") { | |
if (flashvars.mov_id && flashvars.vs_keys) { | |
// split vs_keys to blogid & serial | |
var vs_keys = flashvars.vs_keys.split("|"); | |
this.processEgloosVideoID(flashvars.mov_id, vs_keys[0], vs_keys[1], callback); | |
} | |
// embedded Egloos Video | |
var match = data.src.replace("|", "%7C").match(/\/([a-z][0-9]+)%7C([0-9]+)\/([0-9]+)/); | |
if (match) { | |
this.processEgloosVideoID(match[3], match[1], match[2], callback); | |
} | |
return; | |
} | |
}, | |
// flash video via Nate video | |
"processNateVideoXml": function(mov_id, v_key, callback) { | |
var url = "http://v.nate.com/movie_url.php?mov_id=" + mov_id + "&v_key=" + v_key + "&type=xml"; | |
var xhr = new XMLHttpRequest(); | |
_this = this; | |
xhr.open('GET', url, true); | |
xhr.onload = function(event) { | |
var result = event.target.responseXML.getElementsByTagName("movie")[0]; | |
var errorCode = result.getElementsByTagName("errorCode")[0].textContent; | |
if (errorCode !== "0") { | |
// fallback | |
_this.processNateVideoID(mov_id, callback); | |
} else { | |
var org_url = result.getElementsByTagName("org_url")[0].textContent; | |
var org_name = "Nate"; | |
var mov_url = decodeURIComponent(result.getElementsByTagName("mov_url")[0].textContent); | |
var thumb_url = result.getElementsByTagName("master_thumbnail")[0].getElementsByTagName("url")[0].textContent; | |
callback({ | |
"playlist": [{ | |
"title": title, | |
"poster": thumb_url, | |
"siteinfo": [{ | |
"name": org_name, | |
"url": org_url | |
}], | |
"sources": [{ | |
"url": mov_url, | |
"format": extractExt(mov_url).toUpperCase(), | |
"isNative": true | |
}] | |
}], | |
"isAudio": false | |
}); | |
} | |
}; | |
xhr.send(null); | |
}, | |
"processNateVideoID": function(videoid, callback) { | |
callback({ | |
"playlist": [{ | |
"sources": [{ | |
"url": "http://m.pann.nate.com/video/videoPlayUrlRealTime?video_id="+videoid+"", | |
"format": "MP4", | |
"isNative": true | |
}] | |
}] | |
}); | |
}, | |
"processEgloosVideoID": function(videoid, blogid, serial, callback) { | |
callback({ | |
"playlist": [{ | |
"sources": [{ | |
"url": "http://ebc.egloos.com/exec/mobile/play_movile_video.php?movieid="+videoid+"&blogid="+blogid+"&serial="+serial+"", | |
"format": "MP4", | |
"isNative": true | |
}] | |
}] | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment