platforms.ts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. import type { PlatformType } from '../types/platform.js';
  2. /**
  3. * 平台信息
  4. */
  5. export interface PlatformInfo {
  6. type: PlatformType;
  7. name: string;
  8. nameEn: string;
  9. icon: string;
  10. color: string;
  11. loginUrl: string;
  12. creatorUrl: string;
  13. maxTitleLength: number;
  14. maxDescriptionLength: number;
  15. maxTags: number;
  16. supportedVideoFormats: string[];
  17. maxVideoSize: number; // MB
  18. maxVideoDuration: number; // 秒
  19. /** 是否已适配支持 */
  20. supported: boolean;
  21. }
  22. /**
  23. * 所有支持的平台
  24. */
  25. export const PLATFORMS: Record<PlatformType, PlatformInfo> = {
  26. douyin: {
  27. type: 'douyin',
  28. name: '抖音',
  29. nameEn: 'Douyin',
  30. icon: 'douyin',
  31. color: '#000000',
  32. loginUrl: 'https://creator.douyin.com/',
  33. creatorUrl: 'https://creator.douyin.com/',
  34. maxTitleLength: 55,
  35. maxDescriptionLength: 1000,
  36. maxTags: 5,
  37. supportedVideoFormats: ['mp4', 'mov'],
  38. maxVideoSize: 4096,
  39. maxVideoDuration: 900,
  40. supported: true,
  41. },
  42. kuaishou: {
  43. type: 'kuaishou',
  44. name: '快手',
  45. nameEn: 'Kuaishou',
  46. icon: 'kuaishou',
  47. color: '#FF4906',
  48. loginUrl: 'https://cp.kuaishou.com/',
  49. creatorUrl: 'https://cp.kuaishou.com/',
  50. maxTitleLength: 50,
  51. maxDescriptionLength: 500,
  52. maxTags: 10,
  53. supportedVideoFormats: ['mp4', 'mov'],
  54. maxVideoSize: 4096,
  55. maxVideoDuration: 600,
  56. supported: false,
  57. },
  58. weixin_video: {
  59. type: 'weixin_video',
  60. name: '视频号',
  61. nameEn: 'WeChat Channels',
  62. icon: 'weixin',
  63. color: '#07C160',
  64. loginUrl: 'https://channels.weixin.qq.com/',
  65. creatorUrl: 'https://channels.weixin.qq.com/platform',
  66. maxTitleLength: 30,
  67. maxDescriptionLength: 1000,
  68. maxTags: 5,
  69. supportedVideoFormats: ['mp4'],
  70. maxVideoSize: 1024,
  71. maxVideoDuration: 1800,
  72. supported: true,
  73. },
  74. xiaohongshu: {
  75. type: 'xiaohongshu',
  76. name: '小红书',
  77. nameEn: 'Xiaohongshu',
  78. icon: 'xiaohongshu',
  79. color: '#FE2C55',
  80. loginUrl: 'https://creator.xiaohongshu.com/',
  81. creatorUrl: 'https://creator.xiaohongshu.com/',
  82. maxTitleLength: 20,
  83. maxDescriptionLength: 1000,
  84. maxTags: 10,
  85. supportedVideoFormats: ['mp4', 'mov'],
  86. maxVideoSize: 1024,
  87. maxVideoDuration: 900,
  88. supported: true,
  89. },
  90. bilibili: {
  91. type: 'bilibili',
  92. name: 'B站',
  93. nameEn: 'Bilibili',
  94. icon: 'bilibili',
  95. color: '#00A1D6',
  96. loginUrl: 'https://member.bilibili.com/',
  97. creatorUrl: 'https://member.bilibili.com/platform/home',
  98. maxTitleLength: 80,
  99. maxDescriptionLength: 2000,
  100. maxTags: 12,
  101. supportedVideoFormats: ['mp4', 'flv'],
  102. maxVideoSize: 8192,
  103. maxVideoDuration: 14400,
  104. supported: false,
  105. },
  106. toutiao: {
  107. type: 'toutiao',
  108. name: '头条号',
  109. nameEn: 'Toutiao',
  110. icon: 'toutiao',
  111. color: '#F85959',
  112. loginUrl: 'https://mp.toutiao.com/',
  113. creatorUrl: 'https://mp.toutiao.com/',
  114. maxTitleLength: 30,
  115. maxDescriptionLength: 500,
  116. maxTags: 5,
  117. supportedVideoFormats: ['mp4'],
  118. maxVideoSize: 4096,
  119. maxVideoDuration: 1800,
  120. supported: false,
  121. },
  122. baijiahao: {
  123. type: 'baijiahao',
  124. name: '百家号',
  125. nameEn: 'Baijiahao',
  126. icon: 'baidu',
  127. color: '#2932E1',
  128. loginUrl: 'https://baijiahao.baidu.com/',
  129. creatorUrl: 'https://baijiahao.baidu.com/',
  130. maxTitleLength: 30,
  131. maxDescriptionLength: 500,
  132. maxTags: 10,
  133. supportedVideoFormats: ['mp4'],
  134. maxVideoSize: 4096,
  135. maxVideoDuration: 3600,
  136. supported: true,
  137. },
  138. qie: {
  139. type: 'qie',
  140. name: '企鹅号',
  141. nameEn: 'Qie',
  142. icon: 'qq',
  143. color: '#12B7F5',
  144. loginUrl: 'https://om.qq.com/',
  145. creatorUrl: 'https://om.qq.com/',
  146. maxTitleLength: 30,
  147. maxDescriptionLength: 300,
  148. maxTags: 10,
  149. supportedVideoFormats: ['mp4'],
  150. maxVideoSize: 4096,
  151. maxVideoDuration: 3600,
  152. supported: false,
  153. },
  154. dayuhao: {
  155. type: 'dayuhao',
  156. name: '大鱼号',
  157. nameEn: 'Dayuhao',
  158. icon: 'uc',
  159. color: '#FF6A00',
  160. loginUrl: 'https://mp.uc.cn/',
  161. creatorUrl: 'https://mp.uc.cn/',
  162. maxTitleLength: 30,
  163. maxDescriptionLength: 500,
  164. maxTags: 5,
  165. supportedVideoFormats: ['mp4'],
  166. maxVideoSize: 4096,
  167. maxVideoDuration: 3600,
  168. supported: false,
  169. },
  170. };
  171. /**
  172. * 平台类型列表
  173. */
  174. export const PLATFORM_TYPES = Object.keys(PLATFORMS) as PlatformType[];
  175. /**
  176. * 获取平台信息
  177. */
  178. export function getPlatformInfo(platform: PlatformType): PlatformInfo {
  179. return PLATFORMS[platform];
  180. }