Permalink
Browse files

v2.5

* 重大更新: 停止支援風行網
>>因其官方於2014/01/23對flashplayer做出大幅度修正 因此如果有緣會再支援 :P
* 重大更新: dailymotion半修復
>>因其官方對資料存取做出限制 所以先用很醜的方式頂著 對不住啦 <(_ _)>
  • Loading branch information...
1 parent 7f84a48 commit d5f0ef6852c1ac5563e3d953cc4f5fb6f256cf7b @tpai committed Jan 27, 2014
Showing with 135 additions and 208 deletions.
  1. +76 −19 manifest.json
  2. +0 −1 popup/intro.html
  3. +1 −1 target/2dgate.js
  4. +6 −36 target/dailymotion.js
  5. +26 −0 target/dailymotion_embed.js
  6. +2 −2 target/facebook.js
  7. +0 −106 target/funshion.js
  8. +2 −2 target/niconico.js
  9. +13 −34 target/ppstream.js
  10. +2 −4 target/xuite.js
  11. +7 −3 target/youtube.js
View
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "__MSG_extName__",
- "version": "2.4.2",
+ "version": "2.5",
"description": "__MSG_extDescription__",
"default_locale": "zh_TW",
"icons": {
@@ -12,48 +12,105 @@
},
"content_scripts": [
{
- "matches": ["http://www.youtube.com/watch?*", "https://www.youtube.com/watch?*"],
- "js": ["libs/lib.js", "target/youtube.js"],
+ // youtube
+ "matches": [
+ "http://www.youtube.com/watch?*",
+ "https://www.youtube.com/watch?*"
+ ],
+ "js": [
+ "libs/lib.js",
+ "target/youtube.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"],
+ // facebook
+ "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://mymedia.yam.com/m/*"],
- "js": ["libs/jquery-1.8.3.min.js", "target/yam.js"],
+ // yam music
+ "matches": [
+ "http://mymedia.yam.com/m/*"
+ ],
+ "js": [
+ "libs/jquery-1.8.3.min.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"],
+ // dailymotion
+ "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": ["libs/jquery-1.8.3.min.js", "target/funshion.js"],
+ "matches": [
+ "http://www.dailymotion.com/embed/video/*"
+ ],
+ "js": [
+ "libs/jquery-1.8.3.min.js",
+ "target/dailymotion_embed.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"],
+ // pps
+ "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": ["http://2d-gate.org/thread-*"],
- "js": ["libs/jquery-1.8.3.min.js", "libs/async.js", "target/2dgate.js"],
+ // 2d-gate
+ "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"],
+ // niconico
+ "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": ["libs/jquery-1.8.3.min.js", "target/xuite.js"],
+ // xuite
+ "matches": [
+ "http://vlog.xuite.net/play/*"
+ ],
+ "js": [
+ "libs/jquery-1.8.3.min.js",
+ "target/xuite.js"
+ ],
"run_at": "document_end"
}
],
View
@@ -16,7 +16,6 @@
<li><a href="http://youtube.com" target="_blank">Youtube</a></li>
<li><a href="http://mymedia.yam.com/tag.php?key=五月天" target="_blank">Yam</a></li>
<li><a href="http://www.dailymotion.com/" target="_blank">Dailymotion</a></li>
- <li><a href="http://www.funshion.com/" target="_blank">風行網</a></li>
<li><a href="http://v.pps.tv/movie-index.html" target="_blank">PPStream</a></li>
<li><a href="http://facebook.com/" target="_blank">Facebook</a></li>
<li><a href="http://2d-gate.org/forum-78-1.html" target="_blank">二次元之門</a></li>
View
@@ -71,7 +71,7 @@ var get_video_info = function(id, docid, callback) {
}
}
};
- xhr.open('GET', 'http://www2.thu.edu.tw/~dataprt/file_get_contents.php?url='+url, true);
+ xhr.open('GET', 'http://tonypai.twbbs.org/file_get_contents.php?url='+url, true);
xhr.send(null);
};
View
@@ -1,38 +1,8 @@
$(document).ready(function() {
var embedId = location.pathname.match(/\/video\/(\w{1,})_[^\n]*/)[1]
- get_video_info(embedId)
-})
-
-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])
-
- 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" }
- ];
-
- $.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)
- }
- }
- };
- xhr.open('GET', 'http://www2.thu.edu.tw/~dataprt/file_get_contents.php?url='+url, true);
- xhr.send(null);
-};
+ $(".pl_video_tabs").prepend("<p style='padding-bottom: 20px;'>"+
+ "<a href='http://www.dailymotion.com/embed/video/"+embedId+"?autoplay=1' class='video_title' style='font-size: 34px; line-height: 42px;'>"+
+ "【前往下載】"+
+ "</a>"+
+ "</p>")
+})
@@ -0,0 +1,26 @@
+$(window).load(function() {
+ var embedId = location.pathname.match(/\/video\/(\w{1,})/)[1]
+ get_video_info(embedId)
+})
+
+var get_video_info = function(id) {
+ var result = $("body").html()
+ var json = JSON.parse(result.match(/var info = (\{[^\n]*\}),/)[1])
+ $("#iframe-embed").css("height", "80%").css("position", "fixed").css("top", "15%")
+ 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" }
+ ];
+
+ $.each(data, function(key, val) {
+ if(json[val.index] != null) {
+ html += "<a href='"+json[val.index]+"' style='font-size: 35px; line-height: 45px; text-decoration: none;' title='按右鍵另存' target='_blank'>【"+val.text+"】</a> "
+ }
+ })
+
+ $("body").prepend("<p style='z-index: 99; background-color: white; padding: 10px; text-align: center;'>"+html+"</p>")
+};
View
@@ -23,12 +23,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")
View
@@ -1,106 +0,0 @@
-// prepare css
-$("head").append("<style type='text/css'>"+
- "#collectButton {"+
- " background: url('http://i.imgur.com/EdQvbsC.png') no-repeat scroll 0 0 transparent;"+
- " background-position: -163px -2px;"+
- " cursor: pointer;"+
- "}"+
- "#collectButton:hover {"+
- " background-position: -163px -37px;"+
- "}"+
- ".immediately_download {"+
- " height: auto;"+
- "}"
-+"</style>")
-
-var collectButton = "<a id='collectButton' class='btn' title='收藏'>收藏</a>"
-
-var video_src = {
- "chi": {
- "tv": [],
- "dvd": [],
- "high-dvd": []
- },
- "arm": {
- "tv": [],
- "dvd": [],
- "high-dvd": []
- },
- "und": {
- "tv": [],
- "dvd": [],
- "high-dvd": []
- }
-};
-
-$(document).ready(function() {
- // http://api.funshion.com/ajax/get_webplayinfo/xxxxxx/x/mp4
- var url = "http://api.funshion.com/ajax/get_webplayinfo/"+location.href.split("play/")[1]+"/mp4";
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange = function() {
- if (xhr.readyState == 4) {
- if (xhr.status == 200) {
- var json = JSON.parse(xhr.responseText)
- var info = json.playinfos
- for(var i=0;i<info.length;i++) {
- // http://jobsfe.funshion.com/query/v1/mp4/[cid].json?bits=[byterate]
- var video_info_url = "http://jobsfe.funshion.com/query/v1/mp4/"+info[i].cid+".json?bits="+info[i].byterate
- get_video_info(video_info_url, info[i].dub_one);
- if(i == info.length - 1) {
- // insert collectButton into navigation bar
- var parent = $("#subscribebtn").parent()
- $("#subscribebtn").remove()
- $(parent).append(collectButton)
- // click event handler
- $("#collectButton").click(function() {
- var html = ""
- var dub = ["", "", ""]
- var txt = ["流暢", "標準", "高清"]
- var arr = [
- video_src["chi"]["tv"], video_src["chi"]["dvd"], video_src["chi"]["high-dvd"],
- video_src["arm"]["tv"], video_src["arm"]["dvd"], video_src["arm"]["high-dvd"],
- video_src["und"]["tv"], video_src["und"]["dvd"], video_src["und"]["high-dvd"],
- ]
- // create html
- for(var i=0;i<txt.length;i++) {
- html += "<h1>"+txt[i]+":</h1> "
- for(var j=0;j<dub.length;j++) {
- var number_of_video = arr[i+3*j].length
- if(number_of_video) {
- html += "<p>["+dub[j]+"] "
- for(var k=0;k<number_of_video;k++) {
- html += "<a href='"+arr[i+3*j][k]+"' target='_blank'>載點("+(k+1)+")</a> ";
- }
- }
- }
- html += "</p>"
- }
- $("#pckhdxiaz").html("<p style='padding: 0px;'>"+html+"</p>")
- })
- }
- }
- } else {
- console.log(xhr.status);
- }
- }
- };
- xhr.open("GET", "http://www2.thu.edu.tw/~dataprt/file_get_contents.php?url="+url, true)
- xhr.send(null)
-})
-
-var get_video_info = function(video_info_url, dub_one) {
- var xhr_main = new XMLHttpRequest()
- xhr_main.open("GET", "http://www2.thu.edu.tw/~dataprt/file_get_contents.php?url="+video_info_url, true)
- xhr_main.onreadystatechange = function() {
- if (xhr_main.readyState == 4) {
- if (xhr_main.status == 200) {
- var json_main = JSON.parse(xhr_main.responseText)
- var video_urls = json_main.playlist[0].urls
- for(var j=0;j<video_urls.length;j++) {
- video_src[dub_one][json_main.playlist[0].tname].push(video_urls[j])
- }
- }
- }
- };
- xhr_main.send(null)
-};
View
@@ -23,12 +23,12 @@ var get_video_info = function(video_id) {
$("#download_btn").prop("href", url)
$("head").append("<style type='text/css'>"+
"#videoMenuTopList li.videoMenuList a.myDownloadButton span {"+
- " background-position: -131px -64px;"+
+ " background-position: -131px -671px;"+
"}"+
"</style>")
}
}
};
- xhr.open("GET", "http://web.thu.edu.tw/g10049002/www/niconico.php?url="+getflv+"&cookie="+encodeURIComponent(document.cookie), true)
+ xhr.open("GET", "http://tonypai.twbbs.org/niconico.php?url="+getflv+"&cookie="+encodeURIComponent(document.cookie), true)
xhr.send(null)
};
Oops, something went wrong.

0 comments on commit d5f0ef6

Please sign in to comment.