Comments (2)
// ==UserScript==
// @name Mac斗鱼播放器
// @namespace http://tampermonkey.net/
// @version 0.1.2
// @description 用Mac斗鱼打开直播间
// @author Garyon
// @match *://*.douyu.com/*
// @grant none
// ==/UserScript==
(function() {
function openMacVideo() {
try {
var count = 0;
var sin = setInterval(() => {
var title_a = document.querySelector(".Title-report");
var ooo = document.querySelector('.PhoneWatch-qrcodeTitle');
if (title_a && ooo) {
console.log(title_a);
var roomid = /\d+/.exec(title_a.href)[0];
ooo.innerHTML='<li><span id="openMacPlayer"><a href = "dy://room/'+roomid+'">Mac斗鱼</span></li>';
clearInterval(sin);
}
if (count > 50) {clearInterval(sin);} else {count++; }
}, 100);}
catch(error){
console.error(error);
}
}
window.onload = openMacVideo;
})();
from douyu-for-mac.
自己动手风衣足食,问题已经解决。
- anchor-cover-wrap 主播如果将自己的数字id改成字母时,这个类将不会在safari上被搜到(不知道原因),于是将类换成feedback-report-button,解决!
- 不知道是不是作者手误将生效时间设置为10000ms(10s)button出现就比较慢,已经手动改成1000ms(1s),暂时未发现别的问题。
感谢作者大大!!!
// ==UserScript==
// @name Mac斗鱼播放器
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 用Mac斗鱼打开直播间
// @author Garyon
// @match *://*.douyu.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
$(document).ready(function(){
setTimeout(function(){
var roomid=/\d+/.exec($(".feedback-report-button").attr("href"));
$(".r-else").append('<li><span id="openMacPlayer"><a href = "dy://room/'+ roomid +'">用Mac斗鱼打开</span></li>');
},1000);
});
})();
from douyu-for-mac.
Related Issues (20)
- CPU占用率将近50%,有点吓人啊 HOT 2
- 请问如何置顶播放器?
- 弹幕和视频分离 HOT 2
- 没有弹幕? HOT 1
- 期待大大的safari插件 HOT 1
- 初始窗口太小了 HOT 1
- :) 希望能够保留历史播放记录或者设计一个收藏的列表,并且每次打开 app 都会有一个小绿点提示主播是否在线 HOT 3
- 没有弹幕
- 希望增加:弹幕开关选项和熊猫TV的支持 HOT 3
- 无法获取房间信息 HOT 12
- 无法获取房间信息 HOT 1
- 能否考虑加入调整弹幕透明度的功能
- 希望能增加蓝光选项,谢谢大佬
- 10.14闪退 HOT 2
- 被设置须输入密码访问的直播房间无法进入,请问今后是否考虑增加这个功能?
- 获取不到房间信息 HOT 1
- 斗鱼tv9999房间无法解析 HOT 1
- 20190614无法获取房间信息 HOT 3
- 能考虑加个投屏功能吗?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from douyu-for-mac.