// ==UserScript==
// @name 抖音网页直播点赞(可调节频率,可设置是否默认自动点赞)
// @namespace http://tampermonkey.net/
// @version 4.0
// @description 这是一个基于抖音直播的自动点赞脚本,支持调节点赞频率,修改自别人的脚本
// @author 余某人
// @match *://live.douyin.com/*
// @grant none
// @license MIT
// @downloadURL https://update.greasyfork.icu/scripts/522658/%E6%8A%96%E9%9F%B3%E7%BD%91%E9%A1%B5%E7%9B%B4%E6%92%AD%E7%82%B9%E8%B5%9E%28%E5%8F%AF%E8%B0%83%E8%8A%82%E9%A2%91%E7%8E%87%EF%BC%8C%E5%8F%AF%E8%AE%BE%E7%BD%AE%E6%98%AF%E5%90%A6%E9%BB%98%E8%AE%A4%E8%87%AA%E5%8A%A8%E7%82%B9%E8%B5%9E%29.user.js
// @updateURL https://update.greasyfork.icu/scripts/522658/%E6%8A%96%E9%9F%B3%E7%BD%91%E9%A1%B5%E7%9B%B4%E6%92%AD%E7%82%B9%E8%B5%9E%28%E5%8F%AF%E8%B0%83%E8%8A%82%E9%A2%91%E7%8E%87%EF%BC%8C%E5%8F%AF%E8%AE%BE%E7%BD%AE%E6%98%AF%E5%90%A6%E9%BB%98%E8%AE%A4%E8%87%AA%E5%8A%A8%E7%82%B9%E8%B5%9E%29.meta.js
// ==/UserScript==
(function() {
'use strict';
let page = document.getElementsByTagName('body')[0];
// 首先添加全局样式
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
// 添加所有需要的样式
addGlobalStyle(`
.kolento {
content: '';
font-size: 14px;
position: relative;
z-index: 500;
cursor: pointer;
background: linear-gradient(90deg,#f4c8c7 0,#0c61bb 45%,#0c61bb 55%,#fcc6c6)!important;
border-radius: 50%;
color: #fff;
display: block;
width: 46px;height: 46px;
line-height: 16px;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
transition: all ease 0.3s;
}
.kolento:hover {
background-color: #4abf8a;
transform: rotate(360deg);
opacity:1;
}
.total {
font-size: 14px;
position: relative;
z-index: 500;
background: linear-gradient(90deg,#f4c8c7 0,#0c61bb 45%,#0c61bb 55%,#fcc6c6)!important;
color: #fff;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
transition: all ease 0.3s;
padding: 5px 8px;
border-radius: 20px;
margin-left: 10px;
}
.total p {
color:#fff;
}
.freq-adjuster {
position: absolute;
top: 50px;
right: 0;
z-index: 500;
background: linear-gradient(90deg,#f4c8c7 0,#0c61bb 45%,#0c61bb 55%,#fcc6c6)!important;
color: #fff;
padding: 8px;
border-radius: 20px;
display: none;
flex-direction: column;
gap: 8px;
opacity:0.8;
width: 180px;
}
.freq-adjuster > div {
display: flex;
align-items: center;
gap: 5px;
}
.freq-input {
width: 100px;
border: none;
border-radius: 10px;
padding: 2px 5px;
text-align: center;
font-size: 14px;
}
.freq-label {
font-size: 12px;
white-space: nowrap;
}
.auto-like-option {
display: flex;
align-items: center;
gap: 5px;
font-size: 12px;
cursor: pointer;
}
.auto-like-checkbox {
cursor: pointer;
}
/* 新增样式 */
.like-container {
position: fixed;
top: 70px;
right: 30px;
z-index: 500;
display: flex;
flex-direction: column;
align-items: flex-end;
cursor: move;
transition: opacity 0.3s ease;
}
.toggle-button {
font-size: 14px;
background: linear-gradient(90deg,#f4c8c7 0,#0c61bb 45%,#0c61bb 55%,#fcc6c6)!important;
border-radius: 50%;
color: #fff;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all ease 0.3s;
}
.toggle-button:hover {
opacity: 1;
}
.like-content {
margin-top: 10px;
display: flex;
flex-direction: column;
gap: 10px;
position: relative;
}
.hidden {
display: none !important;
}
.controls-row {
display: flex;
align-items: center;
justify-content: flex-end;
}
.opacity-slider-container {
position: absolute;
top: -40px;
right: 0;
background: linear-gradient(90deg,#f4c8c7 0,#0c61bb 45%,#0c61bb 55%,#fcc6c6)!important;
padding: 5px 10px;
border-radius: 20px;
display: none;
align-items: center;
gap: 5px;
z-index: 501;
}
.opacity-slider {
width: 100px;
cursor: pointer;
}
.opacity-label {
color: white;
font-size: 12px;
white-space: nowrap;
}
`);
// 创建容器元素
let likeContainer = document.createElement("div");
likeContainer.className = "like-container";
page.append(likeContainer);
// 创建切换按钮
let toggleButton = document.createElement("div");
toggleButton.className = "toggle-button";
toggleButton.innerHTML = "▼";
likeContainer.append(toggleButton);
// 创建内容容器
let likeContent = document.createElement("div");
likeContent.className = "like-content";
likeContainer.append(likeContent);
// 创建控件行容器
let controlsRow = document.createElement("div");
controlsRow.className = "controls-row";
likeContent.append(controlsRow);
// 创建点赞按钮
let kolento = document.createElement("p");
kolento.className = "kolento";
kolento.innerHTML = '开始
点赞';
controlsRow.append(kolento);
// 创建点击数显示
let total = document.createElement("div");
total.className = "total";
total.innerHTML = '
点击数:
0
'; controlsRow.append(total); // 创建频率调整器 let freqAdjuster = document.createElement("div"); freqAdjuster.className = "freq-adjuster"; freqAdjuster.innerHTML = `