跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 懂的大佬来, Python +DrissionPage 库写的自动上传视频脚本导致封号/违规检测

发表于

如题,最近使用 python+DrissionPage 库,写了一个视频自动分发视频到各种平台的脚本 如百家号、抖音、快手、企鹅号等等,就是想偷懒,然后收到了各种违规提示,我不知道是不是因为脚本引起的,视频在 A 平台不违规,在 B 平台违规,而且好几个平台都提示违规了,违规的视频也不一样,每个平台管理规则不一样,可能是视频问题。就想问懂的大佬,这跟脚本有没有关系,以下是代码写法,就问这样是否会检测

# baidu.py
from DrissionPage import ChromiumPage, ChromiumOptions
from config import metadata  # 导入配置信息
import os
from DrissionPage.common import Keys

def upload():
    """视频上传函数"""
    co = ChromiumOptions().use_system_user_path() # 创建一个 ChromiumOptions 对象并设置使用系统用户路径
    page = ChromiumPage(co) # 使用 ChromiumOptions 对象创建一个 ChromiumPage 对象

    # 打开或者新建一个网页
    tab_id = page.get_tab(url='baidu.com', as_id=True) # 尝试获取已有的百度标签页 ID
    if tab_id:
        tab = page.get_tab(tab_id)
        page.set.tab_to_front(tab)
        # tab.get('https://www.baidu.com/')
    else:
        tab = page.new_tab('https://baijiahao.baidu.com/builder/rc/edit?type=videoV2')       
        tab('tag:input@type=file').input(os.path.join(metadata.get('path'), '视频.mp4'))# 输入视频文件路径上传视频
        tab.wait(2)  # 等待 2 秒钟,确保视频文件输入完成
        
    # 输入内容
    n_title = metadata.get('title')
    if len(n_title) > 80:
        n_title = n_title[:80]
    tab('tag:input@type=text').input(n_title)
    tab.wait(2)
    
    接下来就是各种在元素里输入标题,点击按钮等等

    print('baidu 视频上传成功')

if __name__ == '__main__':
    upload()

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.