component-shipinlv 2.2.26 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,6 +103,15 @@ var VideoPublishAccountManageHomePage = function VideoPublishAccountManageHomePa
103
103
  // accountDetail.proxyInfo,
104
104
  // );
105
105
  var settingConfig = AccountManageSettingConfig();
106
+ var openUrl = '';
107
+ switch (key) {
108
+ case 'douyin-create':
109
+ openUrl = 'https://creator.douyin.com/creator-micro/content/manage';
110
+ break;
111
+ case 'kuaishou-create':
112
+ openUrl = 'https://cp.kuaishou.com/article/manage/video';
113
+ break;
114
+ }
106
115
  openChrome({
107
116
  action: 'view',
108
117
  platform: accountDetail.platform,
@@ -110,7 +119,7 @@ var VideoPublishAccountManageHomePage = function VideoPublishAccountManageHomePa
110
119
  nickname: accountDetail.nickname,
111
120
  chromeProfileName: accountDetail.chromeProfileName,
112
121
  taskId: 0,
113
- url: 'https://creator.douyin.com/creator-micro/content/manage',
122
+ url: openUrl,
114
123
  proxyInfo: accountDetail.proxyInfo,
115
124
  isOpen: true
116
125
  }, false, env);
@@ -124,6 +133,12 @@ var VideoPublishAccountManageHomePage = function VideoPublishAccountManageHomePa
124
133
  key: 'douyin-create'
125
134
  }]);
126
135
  break;
136
+ case 'kuaishou':
137
+ setOpenMenuItems([{
138
+ label: '快手-创作者中心',
139
+ key: 'kuaishou-create'
140
+ }]);
141
+ break;
127
142
  case 'tiktok':
128
143
  setOpenMenuItems([{
129
144
  label: 'Tiktok',
@@ -13,7 +13,7 @@ import PageContentWarp from "../../UI/PageContentWarp";
13
13
  // import goAuth from "../../lib/goAuth";
14
14
  import getLocalUserInfo from "../../lib/getLocalUserInfo";
15
15
  import event from "../../lib/event";
16
- import { VideoPlatformList } from "../../component/video-platform/logo";
16
+ import { VideoPlatformDict, VideoPlatformList } from "../../component/video-platform/logo";
17
17
  import toast from "../../lib/toast";
18
18
  import Money from "../../UI/Money";
19
19
  import AccountManageSettingConfig from "../../lib/accountManageSettingConfig";
@@ -178,7 +178,7 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
178
178
  };
179
179
  var onAdd = /*#__PURE__*/function () {
180
180
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(platform) {
181
- var settingConfig, chromeProfileName;
181
+ var settingConfig, chromeProfileName, videoPlatformInfo;
182
182
  return _regeneratorRuntime().wrap(function _callee$(_context) {
183
183
  while (1) switch (_context.prev = _context.next) {
184
184
  case 0:
@@ -200,11 +200,11 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
200
200
  onMenu('setting');
201
201
  return _context.abrupt("return");
202
202
  case 10:
203
- if (!(listData.length >= 500)) {
203
+ if (!(listData.length >= 200)) {
204
204
  _context.next = 13;
205
205
  break;
206
206
  }
207
- notification.notificationError('这电脑绑定到上限了', '每台电脑最多绑定 500 个账号');
207
+ notification.notificationError('这电脑绑定到上限了', '每台电脑最多绑定 200 个账号');
208
208
  return _context.abrupt("return");
209
209
  case 13:
210
210
  toast('正在启动浏览器,请扫码登录', 12);
@@ -216,6 +216,14 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
216
216
 
217
217
  // 固定长度,必须 16位数
218
218
  chromeProfileName = Date.now() + '-' + Tool.math.randWord(16);
219
+ videoPlatformInfo = VideoPlatformDict[platform];
220
+ if (videoPlatformInfo) {
221
+ _context.next = 19;
222
+ break;
223
+ }
224
+ toast('请配置信息:' + platform);
225
+ return _context.abrupt("return");
226
+ case 19:
219
227
  openChrome({
220
228
  action: 'add-account',
221
229
  platform: platform,
@@ -224,49 +232,12 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
224
232
  taskId: 0,
225
233
  chromePath: settingConfig.chromePath,
226
234
  chromeProfileName: chromeProfileName,
227
- url: 'https://www.douyin.com/user/self?from_tab_name=main',
235
+ url: videoPlatformInfo.loginWebSiteUrl,
236
+ // 'https://www.douyin.com/user/self?from_tab_name=main',
228
237
  proxyInfo: proxyInfo,
229
238
  isOpen: true // settingConfig.isChromeOpen,
230
239
  }, true, env);
231
-
232
- // event.run('publish-video-account-add', {
233
- // ...openChromeQuery,
234
- // // onFinish( inChromeProfileName: string, accountDetail: PublishNpm.AccountResult ){
235
- // // if( inChromeProfileName != chromeProfileName ){
236
- // // return;
237
- // // }
238
- // // const postData: VideoPublishVideoAccount.CreateQuery = {
239
- // // detail: accountDetail, // addAccountResult as PublishNpm.AccountResult,
240
- // // proxyId: proxyInfo.id || 0,
241
- // // };
242
- // // runCreate(postData);
243
- // // },
244
- // // onFail( inChromeProfileName: string, err: Error ){
245
- // // if( inChromeProfileName != chromeProfileName ){
246
- // // return;
247
- // // }
248
- // // Notification.notificationError( '获取账号信息错误'+ ( err?.message || JSON.stringify( err ) ) );
249
- // // }
250
- // });
251
-
252
- // const addAccountResult = await window.getBridge?.()?.ipcRenderer
253
- // .invoke('shipinlv-video-account-add', platform, proxyInfo, settingConfig.isChromeOpen )
254
- // .catch( ( err: Error ) => {
255
- // Notification.notificationError( '获取账号信息错误'+ ( err?.message || JSON.stringify( err ) ) )
256
- // });
257
-
258
- // if( ! addAccountResult ){
259
- // return;
260
- // }
261
-
262
- // console.log('addAccountResult:', addAccountResult, env );
263
- //
264
- // const postData: VideoPublishVideoAccount.CreateQuery = {
265
- // detail: addAccountResult as PublishNpm.AccountResult,
266
- // proxyId: proxyInfo.id || 0,
267
- // };
268
- // runCreate(postData);
269
- case 16:
240
+ case 20:
270
241
  case "end":
271
242
  return _context.stop();
272
243
  }
@@ -4,6 +4,7 @@ declare class PublishTaskPlanClass {
4
4
  env: Global.Env | '';
5
5
  clientIdentity: string;
6
6
  lastPublishHeart: number;
7
+ MaxNotHeartSecond: number;
7
8
  taskDetail: PublishTaskPlan.TaskDetail;
8
9
  options: PublishTaskPlan.Options;
9
10
  constructor(env: Global.Env | '', clientIdentity: string | undefined, options: PublishTaskPlan.Options);
@@ -17,6 +17,7 @@ import * as LocalVideoPublishTaskController from "../../service/local/VideoPubli
17
17
  import isFileExist from "../../component/isFileExist";
18
18
  import Tool from "../../lib/Tool";
19
19
  import chromeQuit from "../lib/chrome-quit";
20
+ import platform from "../../lib/platform";
20
21
  var PublishTaskPlanClass = /*#__PURE__*/function () {
21
22
  function PublishTaskPlanClass(env) {
22
23
  var clientIdentity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
@@ -27,6 +28,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
27
28
  _defineProperty(this, "env", '');
28
29
  _defineProperty(this, "clientIdentity", '');
29
30
  _defineProperty(this, "lastPublishHeart", 0);
31
+ _defineProperty(this, "MaxNotHeartSecond", 2 * 60);
30
32
  _defineProperty(this, "taskDetail", {
31
33
  emptyLoopTimeSecond: 10,
32
34
  platformVideoAccountId: '',
@@ -78,12 +80,11 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
78
80
  _context.next = 12;
79
81
  break;
80
82
  }
81
- if (!(_this.lastPublishHeart + 60e3 < Date.now())) {
83
+ if (!(_this.lastPublishHeart + _this.MaxNotHeartSecond * 1e3 < Date.now())) {
82
84
  _context.next = 12;
83
85
  break;
84
86
  }
85
87
  _this.lastPublishHeart = 0;
86
-
87
88
  // 浏览器卡住了
88
89
  errLog = {
89
90
  platform: _this.taskDetail.platform,
@@ -448,7 +449,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
448
449
  case 0:
449
450
  settingConfig = AccountManageSettingConfig();
450
451
  console.log('settingConfig 1:', settingConfig);
451
- _this3.lastPublishHeart = Date.now();
452
+ _this.lastPublishHeart = Date.now();
452
453
  _context8.next = 5;
453
454
  return _this.onPublishVideoDo(proxyInfo, {
454
455
  platformVideoAccountId: platformVideoAccountId,
@@ -528,7 +529,7 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
528
529
  }());
529
530
  case 5:
530
531
  publishResult = _context8.sent;
531
- _this3.lastPublishHeart = 0;
532
+ _this.lastPublishHeart = 0;
532
533
  if (publishResult) {
533
534
  _context8.next = 10;
534
535
  break;
@@ -629,13 +630,17 @@ var PublishTaskPlanClass = /*#__PURE__*/function () {
629
630
  taskId: query.taskInfo.taskId,
630
631
  eventType: 'publish-video'
631
632
  });
633
+ var openUrlDict = {
634
+ douyin: 'https://creator.douyin.com/creator-micro/content/upload',
635
+ kuaishou: 'https://cp.kuaishou.com/article/publish/video'
636
+ };
632
637
  openChrome({
633
638
  action: 'publish',
634
639
  platform: query.platform || 'douyin',
635
640
  platformAccountId: query.platformVideoAccountId,
636
641
  nickname: query.nickname,
637
642
  taskId: query.taskInfo.taskId,
638
- url: 'https://creator.douyin.com/creator-micro/content/upload',
643
+ url: openUrlDict[query.platform] || '',
639
644
  chromePath: settingConfig.chromePath,
640
645
  chromeProfileName: query.chromeProfileName,
641
646
  isOpen: query.open
@@ -11,7 +11,7 @@ interface VideoPlatformList {
11
11
  platform: Global.VideoPlatformKind;
12
12
  name: string;
13
13
  disabled?: boolean;
14
- videoWebSiteUrl: string;
14
+ loginWebSiteUrl: string;
15
15
  allowMainDomainList: string[];
16
16
  }
17
17
  interface VideoPlatformDict {
@@ -7,66 +7,24 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  export var VideoPlatformList = [{
8
8
  platform: 'douyin',
9
9
  name: '抖音',
10
- videoWebSiteUrl: 'https://www.douyin.com/user/self?showTab=post',
10
+ loginWebSiteUrl: 'https://www.douyin.com/user/self?from_tab_name=main',
11
11
  // auth login
12
12
  allowMainDomainList: ['douyin.com', 'iesdouyin.com']
13
+ }, {
14
+ platform: 'kuaishou',
15
+ name: '快手',
16
+ loginWebSiteUrl: 'https://cp.kuaishou.com/article/publish/video',
17
+ // auth login
18
+ allowMainDomainList: ['kuaishou.com']
19
+ // disabled: true,
13
20
  }, {
14
21
  platform: 'tiktok',
15
22
  name: 'Tiktok',
16
- videoWebSiteUrl: 'https://www.tiktok.com/',
23
+ loginWebSiteUrl: 'https://www.tiktok.com/',
17
24
  // auth login
18
25
  allowMainDomainList: ['tiktok.com'],
19
26
  disabled: true
20
- },
21
- // {
22
- // platform: 'buyin',
23
- // name: '巨量百应',
24
- // videoWebSiteUrl: 'https://buyin.jinritemai.com/dashboard/merch-picking-library', // auth login
25
- // allowMainDomainList: [
26
- // 'buyin.jinritemai.com',
27
- // ],
28
- // },
29
- {
30
- platform: 'kuaishou',
31
- name: '快手',
32
- videoWebSiteUrl: 'https://www.kuaishou.com/',
33
- allowMainDomainList: ['kuaishou.com'],
34
- disabled: true
35
- }
36
- // {
37
- // platform: 'bilibili',
38
- // name: '哔哩哔哩',
39
- // videoWebSiteUrl: 'https://www.bilibili.com/',
40
- // allowMainDomainList: [
41
- // 'bilibili.com',
42
- // ],
43
- // },
44
- // {
45
- // platform: 'douyu',
46
- // name: '斗鱼',
47
- // videoWebSiteUrl: 'https://www.douyu.com/',
48
- // allowMainDomainList: [
49
- // 'douyu.com',
50
- // ],
51
- // },
52
- // {
53
- // platform: 'huya',
54
- // name: '虎牙',
55
- // videoWebSiteUrl: 'https://www.huya.com/',
56
- // allowMainDomainList: [
57
- // 'huya.com',
58
- // ],
59
- // },
60
- // {
61
- // platform: 'youtube',
62
- // name: 'YouTuBe',
63
- // videoWebSiteUrl: 'https://www.youtube.com/',
64
- // allowMainDomainList: [
65
- // 'youtube.com',
66
- // ],
67
- // },
68
- ];
69
-
27
+ }];
70
28
  export var VideoPlatformDict = function () {
71
29
  var dict = {};
72
30
  VideoPlatformList.forEach(function (item) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "2.2.26",
3
+ "version": "2.3.0",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",