pookz@stme commited on
Commit
24382f9
·
1 Parent(s): 2ebbb3d
Files changed (1) hide show
  1. README.MD +169 -0
README.MD ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 自动化上传视频到社交媒体
2
+ 包含:抖音、视频号、bilibili、小红书等平台
3
+ 1. 自动化上传
4
+ 2. 视频立即发布 or 定时发布
5
+ 3. 自动填写标题、hashtag等
6
+
7
+ ## install
8
+ ```pip install -r requeirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple```
9
+
10
+ ## 核心模块解释
11
+
12
+ ### 文件目录结构
13
+ filepath 为本地视频目录,目录包含视频文件、视频meta信息txt文件
14
+
15
+ file:2023-08-24_16-29-52 - 这位勇敢的男子为了心爱之人每天坚守 .mp4
16
+
17
+ meta_file:2023-08-24_16-29-52 - 这位勇敢的男子为了心爱之人每天坚守 .txt
18
+
19
+ meta_file 内容:
20
+ ```angular2html
21
+ ---Youtube title---
22
+ 这位勇敢的男子为了心爱之人每天坚守 🥺❤️‍🩹
23
+ #坚持不懈 #爱情执着 #奋斗使者 #短视频
24
+ ```
25
+
26
+ 视频发布规则:
27
+ 1. 第一条视频立即发送
28
+ 2. 第二条开始 每日11:00, 16:00定时发布
29
+ 举例:
30
+ filepath 5个视频
31
+ 第一个视频立即发布,第二个视频在第二天11点发布,第三个视频在第二天16点发布,第四个视频在第三天11点发布....
32
+
33
+
34
+ ### bilibili
35
+ 1. 设置好视频目录结构
36
+ 2. 替换filepath本地目录(视频目录)
37
+ 3. 获取bilibili 相应cookie: sessdata, bili_jct, buvid3, dedeuserid, ac_time_value(用于刷新cookie, 见图2)
38
+ ```javascript
39
+ // 获取 cookie 中的值
40
+ function getCookie(name) {
41
+ const value = "; " + document.cookie;
42
+ const parts = value.split("; " + name + "=");
43
+ if (parts.length == 2) return parts.pop().split(";").shift();
44
+ }
45
+
46
+ // 获取 localStorage 中的值
47
+ function getLocalStorage(name) {
48
+ return localStorage.getItem(name);
49
+ }
50
+
51
+ // 获取所需的值
52
+ const values = {
53
+ sessdata: '加密信息, 请通过浏览器获取',
54
+ bili_jct: getCookie('bili_jct'),
55
+ buvid3: getCookie('buvid3'),
56
+ dedeuserid: getCookie('dedeuserid'),
57
+ ac_time_value: getLocalStorage('ac_time_value')
58
+ };
59
+
60
+ // 输出值
61
+ console.log(values);
62
+
63
+ ```
64
+
65
+ 4. 拉取子仓库 `git submodule add https://github.com/Nemo2011/bilibili-api.git bilibili_uploader/bilibili_api`
66
+
67
+ ![Alt text](media/e0df568f16d6447c8a66f672ba37af2f.jpg)
68
+ ![Alt text](media/2023-10-09_105553.png)
69
+
70
+ 其他部分解释:
71
+ ```angular2html
72
+ random_emoji() 标题后增加随机emoji,避免出错后抛出相同标题不允许上传
73
+ time.sleep(30)
74
+ 为什么没使用pypi包,因为有个bug,仓库代码修改了但是pypi并没有更新
75
+ 分区可以在VideoZoneTypes 文件获取
76
+ ```
77
+ todo:
78
+ - [ ] tid 分区id指定
79
+ - [ ] 多账号cookie管理 https://nemo2011.github.io/bilibili-api/#/refresh_cookies
80
+ - [ ] cookie 失效预警
81
+
82
+ 参考项目:
83
+ - https://github.com/Nemo2011/bilibili-api
84
+ - api 文档: https://nemo2011.github.io/bilibili-api/#/homepage
85
+ - 分区 文档:https://biliup.github.io/tid-ref.html
86
+ - https://github.com/biliup/biliup-rs
87
+
88
+ ### 小红书
89
+ 1. 目录结构同上
90
+ 2. cookie获取,可使用chrome插件:EditThisCookie
91
+ - 设置导出格式
92
+ ![Alt text](media/20231009111131.png)
93
+ - 导出
94
+ ![Alt text](media/20231009111214.png)
95
+
96
+ 其他部分解释:
97
+ ```
98
+ 遇到签名问题,可尝试更新cdn.jsdelivr.net_gh_requireCool_stealth.min.js_stealth.min.js文件
99
+ https://github.com/requireCool/stealth.min.js
100
+ 参考:
101
+ - https://reajason.github.io/xhs/basic
102
+ ```
103
+ todo:
104
+ - [ ] 多账号cookie管理
105
+ - [ ] cookie 失效预警
106
+
107
+ 参考项目:https://github.com/ReaJason/xhs
108
+
109
+ ### 抖音
110
+ 1. 目录结构同上
111
+ 2. cookie获取:运行程序,检测无cookie,弹出浏览器,登录后,关于。将会保存cookie,文件名为account1.json
112
+
113
+ 其他部分解释:
114
+ ```
115
+ laywright.chromium.launch 中的headless可以设置为true,不显示浏览器
116
+ ```
117
+
118
+ todo:
119
+ - [ ] cookie 失效预警
120
+ - [ ] 多账号cookie管理
121
+
122
+ 参考项目:
123
+ - https://github.com/wanghaisheng/tiktoka-studio-uploader
124
+ - https://github.com/Superheroff/douyin_uplod
125
+ - https://github.com/lishang520/DouYin-Auto-Upload.git
126
+
127
+
128
+ ### 视频号
129
+ 1. 目录结构同上
130
+ 2. cookie获取:运行程序,检测无cookie,弹出浏览器,登录后,关于。将会保存cookie,文件名为account1.json
131
+
132
+ 其他部分解释:
133
+ ```
134
+ laywright.chromium.launch 中的headless可以设置为true,不显示浏览器
135
+ chromium 不支持h264编码,需要使用chrome,我这里下载的是Canary
136
+ https://www.google.com/intl/en_sg/chrome/canary/
137
+
138
+ 这里设置启动的浏览器地址(你chrome的地址)
139
+ browser = await playwright.chromium.launch(headless=False,
140
+ executable_path="C:/Users/dream/AppData/Local/Google/Chrome SxS/Application/chrome.exe")
141
+ ```
142
+
143
+ todo:
144
+ - [ ] cookie 失效预警
145
+ - [ ] 多账号cookie管理
146
+
147
+
148
+ ### tiktok
149
+ 1. 目录结构同上
150
+ 2. cookie获取:sessionid
151
+ 3. 设置proxy 代理(最好干净代理,避免封号)
152
+ 4. url_prefix 设置tiktok区,default: us, The request domain. Different countries require different domain configurations.
153
+
154
+ proxy = {'socks': 'socks://172.16.22.73:10808'}
155
+ url_prefix = "www"
156
+ 其他部分解释:
157
+ ```
158
+ Note that you cannot schedule a video more than 10 days in advance.
159
+ Note that your TikTok sessionid cookie needs to be updated every 2 months.
160
+ ```
161
+
162
+
163
+
164
+ todo:
165
+ - [ ] cookie 失效预警
166
+ - [ ] 多账号cookie管理
167
+
168
+ 参考项目:https://github.com/546200350/TikTokUploder
169
+