Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

v2.4

* 2dgate dropbox連結有誤
>>須以encode後的方式request URL 已修正
* dailymotion無法使用
>>因官方已將資訊自flashvars移除 已另從他址取得資訊
* facebook無法於photo popup使用
>>number_of_embed的數值判斷有誤 已修正
* ppstream重構
  • Loading branch information...
commit e12e7a35cd734efa2499bbdd284367dc53b66599 1 parent dbdca5b
@tpai authored
View
128 manifest.json
@@ -1,68 +1,68 @@
{
- "manifest_version": 2,
- "name": "__MSG_extName__",
- "version": "2.3",
- "description": "__MSG_extDescription__",
- "default_locale": "zh_TW",
- "icons": {
- "16": "imgs/icon_16.jpg",
+ "manifest_version": 2,
+ "name": "__MSG_extName__",
+ "version": "2.4",
+ "description": "__MSG_extDescription__",
+ "default_locale": "zh_TW",
+ "icons": {
+ "16": "imgs/icon_16.jpg",
"32": "imgs/icon_32.jpg",
- "64": "imgs/icon_64.jpg",
+ "64": "imgs/icon_64.jpg",
"128": "imgs/icon_128.jpg"
- },
- "content_scripts": [
- {
- "matches": ["http://www.youtube.com/watch?*", "https://www.youtube.com/watch?*"],
- "js": ["libs/lib.js", "target/youtube.js"],
- "run_at": "document_end"
- },
- {
- "matches": ["http://mymedia.yam.com/m/*"],
- "js": ["target/yam.js"],
- "run_at": "document_end"
- },
- {
- "matches": ["http://www.dailymotion.com/video/*"],
- "js": ["libs/jquery-1.8.3.min.js", "target/dailymotion.js"],
- "run_at": "document_end"
- },
- {
- "matches": ["http://www.funshion.com/subject/play/*"],
- "js": ["target/funshion.js"],
- "run_at": "document_end"
- },
- {
- "matches": ["http://v.pps.tv/play_*"],
- "js": ["libs/jquery-1.8.3.min.js", "libs/async.js", "target/ppstream.js"],
- "run_at": "document_end"
- },
- {
- "matches": ["https://www.facebook.com/*", "https://www.facebook.com/photo.php?v=*", "https://www.facebook.com/video.php?v=*"],
- "js": ["target/facebook.js"],
- "run_at": "document_end"
- },
- {
- "matches": ["http://2d-gate.org/thread-*"],
- "js": ["libs/jquery-1.8.3.min.js", "libs/async.js", "target/2dgate.js"],
- "run_at": "document_end"
- },
- {
- "matches": ["http://www.nicovideo.jp/watch/*"],
- "js": ["libs/jquery-1.8.3.min.js", "target/niconico.js"],
- "run_at": "document_end"
- },
- {
- "matches": ["http://vlog.xuite.net/play/*"],
- "js": ["target/xuite.js"],
- "run_at": "document_end"
- }
- ],
- "permissions": [
- "tabs"
- ],
- "browser_action": {
- "default_icon": "imgs/swiss.png",
- "default_title": "__MSG_extName__",
- "default_popup": "popup/intro.html"
- }
+ },
+ "content_scripts": [
+ {
+ "matches": ["http://www.youtube.com/watch?*", "https://www.youtube.com/watch?*"],
+ "js": ["libs/lib.js", "target/youtube.js"],
+ "run_at": "document_end"
+ },
+ {
+ "matches": ["http://mymedia.yam.com/m/*"],
+ "js": ["target/yam.js"],
+ "run_at": "document_end"
+ },
+ {
+ "matches": ["http://www.dailymotion.com/video/*"],
+ "js": ["libs/jquery-1.8.3.min.js", "target/dailymotion.js"],
+ "run_at": "document_end"
+ },
+ {
+ "matches": ["http://www.funshion.com/subject/play/*"],
+ "js": ["target/funshion.js"],
+ "run_at": "document_end"
+ },
+ {
+ "matches": ["http://v.pps.tv/play_*"],
+ "js": ["libs/jquery-1.8.3.min.js", "libs/async.js", "target/ppstream.js"],
+ "run_at": "document_end"
+ },
+ {
+ "matches": ["https://www.facebook.com/*", "https://www.facebook.com/photo.php?v=*", "https://www.facebook.com/video.php?v=*"],
+ "js": ["target/facebook.js"],
+ "run_at": "document_end"
+ },
+ {
+ "matches": ["http://2d-gate.org/thread-*"],
+ "js": ["libs/jquery-1.8.3.min.js", "libs/async.js", "target/2dgate.js"],
+ "run_at": "document_end"
+ },
+ {
+ "matches": ["http://www.nicovideo.jp/watch/*"],
+ "js": ["libs/jquery-1.8.3.min.js", "target/niconico.js"],
+ "run_at": "document_end"
+ },
+ {
+ "matches": ["http://vlog.xuite.net/play/*"],
+ "js": ["target/xuite.js"],
+ "run_at": "document_end"
+ }
+ ],
+ "permissions": [
+ "tabs"
+ ],
+ "browser_action": {
+ "default_icon": "imgs/swiss.png",
+ "default_title": "__MSG_extName__",
+ "default_popup": "popup/intro.html"
+ }
}
View
2  target/2dgate.js
@@ -92,7 +92,7 @@ window.onload = function() {
for(var j=0;j<objs.length;j++) {
var obj = objs[j]
if(obj.file.match(/http:\/\//) != null || obj.file.match(/https:\/\//) != null) {
- create_list(j, "", obj.file)
+ create_list(j, "", encodeURIComponent(obj.file))
html += "\n<br />"
}
}
View
59 target/dailymotion.js
@@ -1,26 +1,43 @@
-setTimeout(function() {
+$(document).ready(function() {
+ var embedId = location.pathname.match(/\/video\/(\w{1,})_[^\n]*/)[1]
+ get_video_info(embedId)
+})
- var urltype_arr = ["ldURL", "sdURL", "hqURL", "hdURL", "hd720URL", "hd1080URL"];
- var urltxt_arr = ["低畫質", "中等畫質", "普通畫質", "高畫質", "高畫質(720p)", "高畫質(1080p)", ];
+var get_video_info = function(id) {
+ var url = "http://www.dailymotion.com/embed/video/"+id;
+ var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ if (xhr.status == 200) {
+ var result = xhr.responseText
+ var json = JSON.parse(result.match(/var info = (\{[^\n]*\}),/)[1])
+ console.log("nm="+json.stream_h264_url)
+ console.log("ld="+json.stream_h264_ld_url)
+ console.log("hq="+json.stream_h264_hq_url)
+ console.log("hd="+json.stream_h264_hd_url)
+ console.log("hd1080="+json.stream_h264_hd1080_url)
- var html = ""
- var layerList = JSON.parse(
- decodeURIComponent(
- $("param[name='flashvars']").prop("value").match(/\&sequence=([^\&]*)/)[1]
- )
- ).sequence[0].layerList[0].sequenceList[2].layerList
+ var html = ""
+ var data = [
+ { text: "中等清晰度", index: "stream_h264_url" },
+ { text: "低清晰度", index: "stream_h264_ld_url" },
+ { text: "普通清晰度", index: "stream_h264_hq_url" },
+ { text: "高清720P", index: "stream_h264_hd_url" },
+ { text: "最佳1080P", index: "stream_h264_hd1080_url" }
+ ];
- for(var i=0;i<layerList.length;i++) {
- if(layerList[i].name == "video") {
- for(var j=0;j<urltype_arr.length;j++) {
- var url = layerList[i].param[urltype_arr[j]]
- var txt = urltxt_arr[j]
- if(url != undefined)
- html += "<a href='"+url+"' class='video_title' style='padding: 10px; font-size: 16px; line-height: 22px;'>【"+txt+"】</a> "
+ $.each(data, function(key, val) {
+ if(json[val.index] != null) {
+ html += "<a href='"+json[val.index]+"' class='video_title' style='padding: 8px; font-size: 14px; line-height: 22px;'>【"+val.text+"】</a> "
+ }
+ })
+
+ $(".pl_video_tabs").prepend("<p style='padding-bottom: 20px;'>"+html+"</p>")
+ } else {
+ console.log(xhr.status)
}
}
- }
-
- $(".pl_video_tabs").prepend("<p style='padding-bottom: 20px;'>"+html+"</p>")
-
-}, 500);
+ };
+ xhr.open('GET', 'http://www2.thu.edu.tw/~dataprt/file_get_contents.php?url='+url, true);
+ xhr.send(null);
+};
View
8 target/facebook.js
@@ -13,12 +13,12 @@ var get_fb_video = function() {
var hd_src = json.video_data[0].hd_src
var sd = document.createElement("a")
- sd.innerHTML = "收藏影片(一般)";
+ sd.innerHTML = "收藏影片(一般)"
sd.setAttribute("href", sd_src)
sd.setAttribute("target", "_blank")
var hd = document.createElement("a")
- hd.innerHTML = "收藏影片(高清)";
+ hd.innerHTML = "收藏影片(高清)"
hd.setAttribute("href", hd_src)
hd.setAttribute("target", "_blank")
@@ -44,7 +44,7 @@ var get_fb_video = function() {
var number_of_embed = 0;
setInterval(function() {
if(document.getElementsByTagName("embed").length > number_of_embed) {
- number_of_embed = document.getElementsByTagName("embed").length;
- get_fb_video();
+ get_fb_video()
}
+ number_of_embed = document.getElementsByTagName("embed").length
}, 1000)
View
120 target/ppstream.js
@@ -1,69 +1,61 @@
-var eachfmt = function() {
- async.reduce([0, 1, 2, 3], 0, function(memo, item, callback){
- // pointless async:
- async.nextTick(function(){
- var type = item;
- var url = "http://dp.ppstv.com/get_play_url_cdn.php?sid="+location.href.match(/_[^.]*/)[0].replace(/_/g, "")+"&flash_type=1&type="+type;
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- var result = xhr.responseText;
- if(result.search("hd="+type) != -1) {
- //1=高清 2=流暢 3=普通
- var txt;
- switch(type) {
- case 0: txt = "普通1"; break;
- case 1: txt = "高清"; break;
- case 2: txt = "流暢"; break;
- case 3: txt = "普通2"; break;
+$(document).ready(function() {
+ (function() {
+ async.reduce([0, 1, 2, 3], 0, function(memo, item, callback){
+ // pointless async:
+ async.nextTick(function(){
+ var type = item
+ var url = "http://dp.ppstv.com/get_play_url_cdn.php?sid="+location.href.match(/_[^.]*/)[0].replace(/_/g, "")+"&flash_type=1&type="+type
+ var xhr = new XMLHttpRequest()
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4) {
+ if (xhr.status == 200) {
+ var result = xhr.responseText
+ if(result.search("hd="+type) != -1) {
+ //1=高清 2=流暢 3=普通
+ var txt
+ switch(type) {
+ case 0: txt = "普通1"; break;
+ case 1: txt = "高清"; break;
+ case 2: txt = "流暢"; break;
+ case 3: txt = "普通2"; break;
+ }
+ $(".behavior-list").append(''+
+ '<li class="bhv-item trans">'+
+ ' <a href="'+result.split("?hd=")[0]+'" class="ta">'+
+ ' <span class="tai">'+
+ ' <b class="ico-collect"></b>'+
+ ' </span>'+
+ ' <span class="tas">'+txt+'</span>'+
+ ' </a>'+
+ '</li>')
}
- $(".behavior-list").append(''+
- '<li class="bhv-item trans">'+
- ' <a href="'+result.split("?hd=")[0]+'" class="ta">'+
- ' <span class="tai">'+
- ' <b class="ico-collect"></b>'+
- ' </span>'+
- ' <span class="tas">'+txt+'</span>'+
- ' </a>'+
- '</li>')
+ callback(null)
+ } else {
+ console.log(xhr.status)
}
- callback(null)
- } else {
- console.log(xhr.status);
}
}
- };
- xhr.open('GET', 'http://www2.thu.edu.tw/~dataprt/file_get_contents.php?url='+encodeURIComponent(url), true);
- xhr.send(null);
+ xhr.open('GET', 'http://www2.thu.edu.tw/~dataprt/file_get_contents.php?url='+encodeURIComponent(url), true)
+ xhr.send(null)
+ })
+ }, function(err, result){
+ if(err)throw err
+ $(".ico-collect")
+ .css("width", "16px")
+ .css("height", "17px")
+ .css("display", "inline-block")
+ .css("overflow", "hidden")
+ .css("line-height", "0")
+ .css("font-size", "0")
+ .css("color", "transparent!important")
+ .css("background-image", "url(http://i.imgur.com/jDdFx8q.png)")
+ .css("background-repeat", "no-repeat")
+ .css("background-position", "-69px -114px")
+ .css("cursor", "pointer")
+ .css("vertical-align", "top")
+
+ $(".bhv-download").remove()
+ $(".bhv-phone").remove()
});
- }, function(err, result){
- if(err)throw err;
- var css = ''+
- '.ico-collect {'+
- ' width: 16px;'+
- ' height: 17px;'+
- ' display: inline-block;'+
- ' overflow: hidden;'+
- ' line-height: 0;'+
- ' font-size: 0;'+
- ' color: transparent!important;'+
- ' background-image: url(http://i.imgur.com/jDdFx8q.png);'+
- ' background-repeat: no-repeat;'+
- ' background-position: -69px -114px;'+
- ' cursor: pointer;'+
- ' vertical-align: top;'+
- '}',
- head = document.getElementsByTagName('head')[0],
- style = document.createElement('style');
-
- style.type = 'text/css';
- if (style.styleSheet){
- style.styleSheet.cssText = css;
- } else {
- style.appendChild(document.createTextNode(css));
- }
- head.appendChild(style);
- });
-};
-eachfmt();
+ })()
+})
View
2  target/youtube.js
@@ -24,7 +24,7 @@ setTimeout(function() {
if(url_arr[i].match(/\&sig=\w{0,}.\w{0,}/) != null) {
sig = "&signature="+getParameterByName(url_arr[i], "sig");
}
- else {
+ else if(url_arr[i].match(/\&s=\w{0,}.\w{0,}/) != null) {
sig = "&signature="+sigHandler(getParameterByName(url_arr[i], "s"));
}
var tag = getParameterByName(url_arr[i], "type");
Please sign in to comment.
Something went wrong with that request. Please try again.