|
@@ -0,0 +1,42 @@
|
|
|
+// ==UserScript==
|
|
|
+// @name T-抖音-复制视频引用
|
|
|
+// @namespace Violentmonkey Scripts
|
|
|
+// @match https://www.douyin.com/video/*
|
|
|
+// @grant none
|
|
|
+// @version 1.0
|
|
|
+// @author tianyunperfect
|
|
|
+// @require https://git.tianyunperfect.cn/tianyunperfect/web-base/raw/master/tmp/monkey/util.js?a=2
|
|
|
+// @description 2021/1/30 下午7:09:51
|
|
|
+// ==/UserScript==
|
|
|
+(async () => {
|
|
|
+ 'use strict';
|
|
|
+
|
|
|
+ let h1_s = '.z8_VexPf';
|
|
|
+ await getDom('.xg-video-container video source');
|
|
|
+ console.log("123")
|
|
|
+
|
|
|
+ function getTempId() {
|
|
|
+ return "myTmp" + Math.floor(Math.random() * 10000);
|
|
|
+ }
|
|
|
+
|
|
|
+ function get_video_id() {
|
|
|
+ document.querySelector('.xg-video-container video').querySelectorAll('source').forEach(s => {
|
|
|
+ let src = s.getAttribute("src");
|
|
|
+ let video_id = getQueryStringByUrl(src, "video_id");
|
|
|
+ console.log(video_id)
|
|
|
+ if (video_id.length > 0) {
|
|
|
+ return video_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ document.querySelector(h1_s).on('dblclick',()=>{
|
|
|
+ console.log(123)
|
|
|
+ let url = `https://aweme.snssdk.com/aweme/v1/playwm/?video_id=${get_video_id()}`;
|
|
|
+ myCopy(url);
|
|
|
+ let tmpId = getTempId();
|
|
|
+ $("h1_s").eq(0).append(jQuery('<span class="tag" id="' + tmpId + '">:已复制</span>'));
|
|
|
+ setTimeout(() => {
|
|
|
+ jQuery('#' + tmpId).remove();
|
|
|
+ }, 1500)
|
|
|
+ })
|
|
|
+})();
|