-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdouyin.js
33 lines (32 loc) · 1.16 KB
/
douyin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function initBind(){
console.log("init success");
//增加特定按钮
setTimeout(function(){
if($(".video-player").length>0){
showText("--------------------------------");
$(".video-player").click();
setTimeout(function(){
var link = $(".video-player .player").attr("src");
var imglink= $(".video-player .player").attr("poster");
showText(imglink);
showText(link);
},100);
var txt = $(".video-info .desc").html();
showText(txt);
}
},500);
}
function showText(ele){
$("#video_result").prepend($("<div>").html(escapeHTML(ele)));
}
$(function(){
//增加样式表
var style="<style type=\"text/css\">\
#video_result{position:fixed;right:10px;bottom:10px;height:100px;width:700px;z-index:999;background:#fff;padding:10px;overflow-y: scroll;}\
.get_video_info{position: absolute;top: 5px;left: 5px;z-index: 550;background: #fff;padding:5px 10px;border-radius: 5px;border:1px solid #ddd;}\
</style>";
$("head").append(style);
$("body").append("<div id='video_result'></div>")
initBind();
})
function escapeHTML(str) { return str.replace(/[&"'<>]/g, (m) => ({ "&": "&", '"': """, "'": "'", "<": "<", ">": ">" })[m]); }