小红书评论点赞软件,抖音快手微博评论点赞脚本,CID指定评论点赞工具【开源分享】

简介: 这段代码模拟了一个社交媒体自动化点赞工具的实现,包含了登录、评论点赞等基本功能

下载地址:https://www.pan38.com/dow/share.php?code=JCnzE 提取密码:1133
这段代码模拟了一个社交媒体自动化点赞工具的实现,包含了登录、评论点赞等基本功能。请注意这仅用于技术研究目的,实际使用可能违反平台规则。代码使用了Selenium进行浏览器自动化,支持小红书、抖音、快手和微博平台。

import time
import random
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

class SocialMediaLiker:
def init(self, platform):
self.platform = platform.lower()
self.driver = None
self.session = requests.Session()
self.headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}

def init_driver(self):
    chrome_options = Options()
    chrome_options.add_argument("--headless")
    chrome_options.add_argument("--disable-gpu")
    chrome_options.add_argument("--no-sandbox")
    self.driver = webdriver.Chrome(options=chrome_options)

def login(self, username, password):
    if self.platform == 'xiaohongshu':
        self._xiaohongshu_login(username, password)
    elif self.platform == 'douyin':
        self._douyin_login(username, password)
    elif self.platform == 'kuaishou':
        self._kuaishou_login(username, password)
    elif self.platform == 'weibo':
        self._weibo_login(username, password)
    else:
        raise ValueError("Unsupported platform")

def _xiaohongshu_login(self, username, password):
    self.driver.get("https://www.xiaohongshu.com")
    time.sleep(2)
    login_btn = self.driver.find_element(By.CSS_SELECTOR, ".login-btn")
    login_btn.click()
    time.sleep(1)
    username_input = self.driver.find_element(By.NAME, "username")
    password_input = self.driver.find_element(By.NAME, "password")
    username_input.send_keys(username)
    password_input.send_keys(password)
    password_input.send_keys(Keys.RETURN)
    time.sleep(5)

def _douyin_login(self, username, password):
    self.driver.get("https://www.douyin.com")
    time.sleep(2)
    login_btn = self.driver.find_element(By.CSS_SELECTOR, ".login-btn")
    login_btn.click()
    time.sleep(1)
    switch_btn = self.driver.find_element(By.CSS_SELECTOR, ".switch-btn")
    switch_btn.click()
    time.sleep(1)
    username_input = self.driver.find_element(By.NAME, "username")
    password_input = self.driver.find_element(By.NAME, "password")
    username_input.send_keys(username)
    password_input.send_keys(password)
    password_input.send_keys(Keys.RETURN)
    time.sleep(5)

def like_comments(self, post_url, cid=None, count=10):
    if self.platform == 'xiaohongshu':
        return self._like_xiaohongshu_comments(post_url, cid, count)
    elif self.platform == 'douyin':
        return self._like_douyin_comments(post_url, cid, count)
    elif self.platform == 'kuaishou':
        return self._like_kuaishou_comments(post_url, cid, count)
    elif self.platform == 'weibo':
        return self._like_weibo_comments(post_url, cid, count)
    else:
        raise ValueError("Unsupported platform")

def _like_xiaohongshu_comments(self, post_url, cid, count):
    self.driver.get(post_url)
    time.sleep(3)

    # Scroll to load comments
    for _ in range(3):
        self.driver.execute_script("window.scrollBy(0, 500)")
        time.sleep(1)

    comments = self.driver.find_elements(By.CSS_SELECTOR, ".comment-item")
    liked = 0

    for comment in comments:
        if liked >= count:
            break

        comment_id = comment.get_attribute("data-cid")
        if cid and comment_id != cid:
            continue

        try:
            like_btn = comment.find_element(By.CSS_SELECTOR, ".like-btn")
            if "liked" not in like_btn.get_attribute("class"):
                like_btn.click()
                liked += 1
                time.sleep(random.uniform(0.5, 2))
        except:
            continue

    return liked

def close(self):
    if self.driver:
        self.driver.quit()

if name == "main":
platforms = ['xiaohongshu', 'douyin', 'kuaishou', 'weibo']
print("Available platforms:", ", ".join(platforms))
platform = input("Select platform: ")
username = input("Username: ")
password = input("Password: ")
post_url = input("Post URL: ")
cid = input("Specific comment ID (leave empty for random): ")
count = int(input("Number of likes: "))

liker = SocialMediaLiker(platform)
try:
    liker.init_driver()
    liker.login(username, password)
    result = liker.like_comments(post_url, cid if cid else None, count)
    print(f"Successfully liked {result} comments")
except Exception as e:
    print(f"Error: {str(e)}")
finally:
    liker.close()
相关文章
|
编解码 Linux Android开发
安卓投屏神器 Scrcpy 安装与使用(支持 Mac、Windows、Linux)
安卓投屏神器 Scrcpy 安装与使用(支持 Mac、Windows、Linux)
55011 1
小红书批量收藏点赞评论脚本,私信群发插件导入ID,可养号也可以引流
这是一款功能强大的小红书引流插件,支持多账号操作,可实现批量私信、点赞、收藏、评论等营销功能,非常适合微商群体
|
11月前
|
弹性计算 自然语言处理 数据库
2026年阿里云最新优惠券参考,适合普通用户的新用户满减券与165元优惠券领取及使用教程分享
2026年截至目前,阿里云有哪些优惠券呢?除了学生优惠券和企业出海扶持优惠券等之外,适合普通个人和企业用户的优惠券目前主要有新用户满减券与165元优惠券,满减券金额虽然只有10元,但是使用门槛较低,165元优惠券相对金额更大,完成实名认证即可参与领取上云礼包,最高可减100元。有的新手用户可能不知道领券入口和使用教程,本文将详细介绍这两项活动的具体内容、领取方式和使用教程,以供参考。
|
6月前
|
人工智能 关系型数据库 Java
阿里云OpenCode解析:替代Claude Code的国产开源AI编程Agent全攻略
2026年,阿里云OpenCode已成为国内开发者与企业首选的终端AI编程工具,它以开源、轻量、跨平台、多模型兼容、深度集成阿里云百炼大模型服务为核心优势,完美解决传统AI编程工具依赖单一厂商、隐私风险高、终端适配差等痛点。作为一款终端原生的AI编程Agent,OpenCode支持代码生成、调试、重构、文件操作、项目规划等全链路开发能力,可无缝接入阿里云百炼的Qwen系列、Claude系列等主流模型,同时支持本地离线模型部署,满足个人开发者、中小企业、金融与政企等不同场景的AI编程需求。本文将从产品定位、核心功能、安装配置、模型接入、计费模式、实战案例、避坑指南等维度,全面解读2026年阿里云
4057 0
|
7月前
|
运维 前端开发 架构师
从“QA测两遍直接上线”到规范发布:一次私教咨询实录
测试负责人小F深陷环境混乱、交付压力与权责失衡的困局。资深专家以大厂实践为镜,系统拆解代码分支规范、泳道隔离、预发环境设计等技术方案,并传授风险前置上报、精准取舍、数据化沟通等管理智慧——助测试人从“背锅者”蜕变为“风险守门人”。
|
JSON 搜索推荐 机器人
直播间自动发言机器人,抖音快手小红书哔哩哔哩机器人, 自动评论app机器人打字弹幕脚本
多平台支持:整合抖音、哔哩哔哩等平台的自动化操作 智能评论生成:结合视频内容动态生成个性化评论
|
9月前
|
XML JSON 监控
淘宝宝贝详情数据一键获取,item_getAPI接口讲解
taobao.item.get是淘宝开放平台核心API,通过商品ID(num_iid)一键获取结构化详情,涵盖基础信息、SKU、属性、营销及详情页内容,广泛用于反向海淘、ERP同步、比价工具与自建商城。
|
10月前
|
缓存 网络协议 定位技术
蓝易云:CDN海外加速的有效方法_打破地域限制!加速海外访问
总之,通过以上方法可以大大提升CDN的加速效果,并有效地打破由于地域限制而造成的访问差距。使用CDN服务不仅能够改善用户体验,增加访问速度,还能够从安全角度为网站提供保障。选择一个靠谱的CDN服务提供商,合理配置并持续优化,对于全球化的网站来说是至关重要的。
545 9
|
JSON 安全 生物认证
WhatWeb-网站安全扫描指纹识别
WhatWeb 是一款网站指纹识别工具,用于快速识别目标网站的 Web 服务器类型、CMS、脚本语言、中间件及可能存在的漏洞信息,常用于渗透测试与安全审计。
783 2
|
存储 开发工具 git
GIT LFS是什么
【4月更文挑战第21天】GIT LFS是什么
3814 1