平時喜歡看開眼的視頻,但是在 pc 端的頁面並不方便
http://www.eyepetizer.net/detail.html?vid=71469
打開後可以播放該 vid 的視頻
但是
下方的列表視頻點擊打開後都跳到下載 app 頁面
所以求一個腳本,可以批量替換列表 裏面的地址
<a href="https://lkme.cc/3rC/4qQTa1dMJ" data-vid="68245">
改爲
<a href="http://www.eyepetizer.net/detail.html?vid=68245" data-vid="68245">
求大佬,請喝咖啡
1
Dexter123 2018-01-06 23:56:46 +08:00
(function() {
'use strict'; // Your code here... setTimeout(()=>{ document.querySelector('.relate-video-list').querySelectorAll('a').forEach(a=>a.href=a.baseURI); },100); })(); |
4
Dexter123 2018-01-07 00:06:28 +08:00
|
5
Dexter123 2018-01-07 00:09:24 +08:00
r#2 @songz 刚刚那个好像有 bug ; 完整的这个 我本地试了应该没问题了。。
// ==UserScript== // @name New Userscript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match http*://www.eyepetizer.net/* // @grant none // ==/UserScript== (function() { 'use strict'; // Your code here... console.log(111); setTimeout(()=>{ document.querySelector('.relate-video-list').querySelectorAll('a').forEach(a=>a.href=`http://www.eyepetizer.net/detail.html?vid=${a.dataset.vid}`); },200); })(); |
6
lsvih 2018-01-07 00:10:27 +08:00 1
// ==UserScript==
// @name eyepetizer // @match http://www.eyepetizer.net/detail.html?vid=* // @run-at document-start // ==/UserScript== (()=>setInterval(()=>document.querySelectorAll(".relate-video-list a").forEach(e=>e.href = `//www.eyepetizer.net/detail.html?vid=${e.dataset.vid}`),500))(); 直接这样吧,简单粗暴 @Dexter123 那些链接 ajax 加载的,偷懒的话直接 setInterval 走起,不然还要去看啥时候加载完 |
8
cnilnhf 2018-01-07 00:10:52 +08:00 1
(function() {
'use strict'; // Your code here... setTimeout(()=>{ document.querySelector('.relate-video-list').querySelectorAll('a').forEach(a=>a.href=a.href = "http://www.eyepetizer.net/detail.html?vid=" + a.dataset.vid); },100); })(); |
9
iNaru 2018-01-07 00:11:15 +08:00
(function(){
const animationName = btoa(Math.random()).replace(/[^a-z]/ig, 'a'); document.head.appendChild(document.createElement('style')).textContent = ` @keyframes ${animationName} {from{opacity:.9;}to{opacity:1;}} a[data-vid] {animation:${animationName} 1ms;} `; document.addEventListener('animationstart', e => { if(e.animationName !== animationName) return; e.target.href = e.target.baseURI; }); })(); |
10
Dexter123 2018-01-07 00:11:44 +08:00 1
r#7 @songz 中间那句换成 document.querySelector('.relate-video-list').querySelectorAll('a').forEach(a=>a.href=`http://www.eyepetizer.net/detail.html?vid=${a.dataset.vid}`)
|
11
huai 2018-01-07 00:16:51 +08:00 via iPhone 1
哈哈 来个 jq 的。
// ==UserScript== // @name OpenEyeScript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author None // @match *://www.eyepetizer.net/detail.html?* // @grant none // @require http://lib.baomitu.com/jquery/1.9.1/jquery.min.js // ==/UserScript== (function() { 'use strict'; setTimeout(function(){ $('.relate-video-list a').each(function(){ var uid = $(this).data('vid'); $(this).attr('href',`http://www.eyepetizer.net/detail.html?vid=${uid}`); }); },1e3); })(); |
15
songz OP @lsvih #6 开眼换了域名,油猴也报错了,可以更新一下语句吗? https://www.kaiyanapp.com/
|