{"id":15203770,"url":"https://github.com/kebenxiaoming/matrix","last_synced_at":"2025-10-02T21:30:30.431Z","repository":{"id":239858789,"uuid":"800801484","full_name":"kebenxiaoming/matrix","owner":"kebenxiaoming","description":"matrix是抖音，快手，视频号，小红书等短视频矩阵内容分发系统的脚本代码，基于python3，旨在借助playwright实现自动化发布视频到各个社交媒体平台","archived":false,"fork":false,"pushed_at":"2025-01-14T06:57:07.000Z","size":5872,"stargazers_count":362,"open_issues_count":2,"forks_count":82,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-14T07:42:46.636Z","etag":null,"topics":["douyin","kuaishou","matrix","video","wechat","xhs"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kebenxiaoming.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-15T02:58:01.000Z","updated_at":"2025-01-14T06:57:11.000Z","dependencies_parsed_at":"2024-05-30T09:50:59.573Z","dependency_job_id":"c9151623-a574-4d97-9c52-3cf003c518f6","html_url":"https://github.com/kebenxiaoming/matrix","commit_stats":null,"previous_names":["kebenxiaoming/matrix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kebenxiaoming%2Fmatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kebenxiaoming%2Fmatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kebenxiaoming%2Fmatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kebenxiaoming%2Fmatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kebenxiaoming","download_url":"https://codeload.github.com/kebenxiaoming/matrix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235043597,"owners_count":18927006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["douyin","kuaishou","matrix","video","wechat","xhs"],"created_at":"2024-09-28T05:01:59.310Z","updated_at":"2025-10-02T21:30:30.424Z","avatar_url":"https://github.com/kebenxiaoming.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# matrix\nmatrix是**视频矩阵内容分发系统**的脚本代码，基于python，旨在借助playwright实现自动化发布视频到抖音、快手、视频号、小红书等各个社交媒体平台\n\n# 注意\n\n- 该项目仅作为个人学习使用，请勿用于非法用途。一切违法行为后果自负\n\n## 版本要求\n \n- Python 3.8 or higher.（作者用的是Python 3.12+）\n- Windows 10+, Windows Server 2016+ or Windows Subsystem for Linux (WSL).\n- MacOS 12 Monterey, MacOS 13 Ventura, or MacOS 14 Sonoma.\n- Debian 11, Debian 12, Ubuntu 20.04 or Ubuntu 22.04.\n\n## 💡Feature\n- 目前支持的中国主流社交媒体平台：\n  - 抖音\n  - 视频号\n  - 小红书\n  - 快手\n\n- 登录(脚本)\n- 自动上传(脚本)\n- cookie 管理(file)\n- 国外平台proxy 设置（todo)\n- 多线程上传（todo)\n- slack 推送（todo)\n\n\n# 💾Installation\n```\npip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple\nplaywright install chromium\n```\n\n# 使用方法\n\n一、修改conf.py配置文件\n```\nBASE_PATH = 根目录绝对路径（用于文件路径处理）\n\nREDIS_CONF : Redis配置（用于记录登录二维码，登录状态等）\n\nMYSQL_CONF : Mysql配置（用于登录或发送视频数据库队列）\n```\n\n二、导入数据库\n主要用于登录和发送数据库队列。\n\n```\n将database目录中的matrix.sql导入数据库,具体表结构也不复杂，请参考sql中的注释\n```\n\n三、需使用supervisor守护进程完成脚本的管理\n\n1、登陆脚本\n\n```\npython3 user_queue_login.py 1 //此字段是登陆类型：1：抖音；2：视频号；3：小红书；4：快手\n\n注：\n\n小红书登录需要开启flask的请求服务，用来获取小红书的x-s和x-t需要将xhs-api目录下的app2024.py服务先启动。\n\n```\n\n2、视频上传脚本\n\n```\npython3 publish_video_queue.py 无需参数，不区分平台，按用户发布顺序逐一发布视频\n\n```\n\n3、可自行在代码中修改headless为True或者False，为False的时候可以看到浏览器界面方便调试\n\n\u003cb\u003e注意，如果为False的时候在linux下运行需要安装xvfb-run来运行脚本\u003c/b\u003e\n\n\u003cb\u003e注意，本脚本运行需要Mysql和Redis，请先开启\u003c/b\u003e\n\n\u003cb\u003e注意，修改代码需要了解css知识，如果代码有问题，一般是css选择器不匹配可以自行修改\u003c/b\u003e\n\n四、如何获取数据\n\n```\n1、登录二维码可以从redis中直接取值(base64的数据)，具体获取数据方式请查阅代码\n\n2、有时候抖音登录会出现需要发送短信的情况，也已经处理，可以从缓存获取标识来处理\n\n3、登陆的cookie都存在各个平台代码（如抖音：douyin_uploader）目录的account目录(如果没有请先创建)中，请注意需要有目录权限，登陆后用户信息会存储到mx_account_info表中\n\n4、自己可以尝试开启或者关闭headless（是否在运行过程开启浏览器界面）\n\n```\n\n五、有任何问题请在issue中留言。\n\n微信群无法通过二维码加入，改为QQ群\n\nQQ交流群，有问题可以群里沟通：\n\nQQ:912370973\n\n六、参考项目：\n- https://github.com/dreammis/social-auto-upload\n- https://github.com/wanghaisheng/tiktoka-studio-uploader\n- https://github.com/Superheroff/douyin_uplod\n- https://github.com/lishang520/DouYin-Auto-Upload.git\n- https://github.com/ReaJason/xhs\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkebenxiaoming%2Fmatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkebenxiaoming%2Fmatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkebenxiaoming%2Fmatrix/lists"}