mirror of
https://github.com/Geniusay/ChopperBot.git
synced 2026-06-01 03:20:10 +08:00
账号模块视频推送搁置[B站无法上传]
This commit is contained in:
@@ -1,4 +1,2 @@
|
||||
|
||||
{ java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(貌也<E8B28C><E4B99F><EFBFBD><EFBFBD>8공겦<EAB3B5>1
|
||||
g
|
||||
java:S1128"ERemove this unused import 'org.springframework.stereotype.Component'.(邪祺<E982AA><E7A5BA><EFBFBD><EFBFBD><EFBFBD>8淋겦<EFA7B5>1
|
||||
{ java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(貌也<E8B28C><E4B99F><EFBFBD><EFBFBD>8공겦<EAB3B5>1
|
||||
@@ -1,6 +1,18 @@
|
||||
|
||||
m java:S116""XRename this field "pluginName_CN" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(×ø<EFBFBD>Ã
|
||||
s java:S117«"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ºí×ùûÿÿÿÿ8òÉýÖ¾1
|
||||
m java:S116#"XRename this field "pluginName_CN" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(×ø<C397>Ã
|
||||
V
|
||||
java:S5993'"9Change the visibility of this constructor to "protected".(ϸ“ò8<>ÊýÖ¾1
|
||||
V
|
||||
java:S5993/"9Change the visibility of this constructor to "protected".(óïù¨8<>ÊýÖ¾1
|
||||
[
|
||||
java:S59935"9Change the visibility of this constructor to "protected".(Š ùÖüÿÿÿÿ8<>ÊýÖ¾1
|
||||
C
|
||||
java:S1948"(Make "needPlugins" private or transient.(<28>›¦Úüÿÿÿÿ
|
||||
java:S1948"(Make "needPlugins" private or transient.(<28>›¦Úüÿÿÿÿ
|
||||
C
|
||||
java:S1948"(Make "logger" transient or serializable.(<28>ÿ޼ýÿÿÿÿ
|
||||
java:S1948"(Make "logger" transient or serializable.(<28>ÿ޼ýÿÿÿÿ
|
||||
k java:S100¨"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(òèø¯8°ÊýÖ¾1
|
||||
p java:S100«"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ºí×ùûÿÿÿÿ8°ÊýÖ¾1
|
||||
b
|
||||
java:S1128
|
||||
"@Remove this unused import 'org.example.plugin.SpringBootPlugin'.(ÈðÔÿÿÿÿÿ8²ÊýÖ¾1
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
G
|
||||
java:S1068$",Remove this unused "platform" private field.(úêÒ©úÿÿÿÿ
|
||||
@@ -1,3 +1,3 @@
|
||||
|
||||
x java:S116"\Rename this field "is_complete_match" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(‰¡¬“8Öý¥Ä´1
|
||||
w java:S116"VRename this field "platform_id" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ê‹èçùÿÿÿÿ8åý¥Ä´1
|
||||
q java:S116"\Rename this field "is_complete_match" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(‰¡¬“
|
||||
p java:S116"VRename this field "platform_id" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ê‹èçùÿÿÿÿ
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
H
|
||||
java:S1172"+Remove this unused method parameter "name".(ɾµí8½Ú»Ö½1
|
||||
@@ -1,5 +1,9 @@
|
||||
|
||||
T
|
||||
java:S5993"9Change the visibility of this constructor to "protected".(ÂûïÔýÿÿÿÿ
|
||||
Y
|
||||
java:S1128">Remove this unused import 'org.example.log.ChopperLogFactory'.(æ<><C3A6>Áûÿÿÿÿ
|
||||
java:S5993"9Change the visibility of this constructor to "protected".(ÂûïÔýÿÿÿÿ
|
||||
E
|
||||
java:S1185"(Remove this method to simply inherit it.(ËîÅÐ8¯¼þÖ¾1
|
||||
H
|
||||
java:S1168'"+Return an empty collection instead of null.(¥¹ï<C2B9>8³¼þÖ¾1
|
||||
a
|
||||
java:S1128"?Remove this unused import 'org.example.sql.annotation.SQLInit'.(ã‘Ô’ýÿÿÿÿ8´¼þÖ¾1
|
||||
@@ -1,34 +0,0 @@
|
||||
|
||||
k java:S1178"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(áù¬°øÿÿÿÿ
|
||||
k java:S1179"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¯ƒø<C692>úÿÿÿÿ
|
||||
f java:S117;"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(‰ýÅ<C3BD>
|
||||
f java:S117<"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28>Ö΄
|
||||
e java:S117B"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(زÑz
|
||||
k java:S117H"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28>ÆÓ†úÿÿÿÿ
|
||||
l java:S117¡"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ö››Ïûÿÿÿÿ
|
||||
k
|
||||
java:S2095ˆ"MUse try-with-resources or close this "FileInputStream" in a "finally" clause.(ð<>Ä8«û<C2AB>¾³1
|
||||
j
|
||||
java:S2095^"MUse try-with-resources or close this "FileInputStream" in a "finally" clause.(†šî8«û<C2AB>¾³1
|
||||
m
|
||||
java:S3776&"RRefactor this method to reduce its Cognitive Complexity from 18 to the 15 allowed.(ÕÁ‘üùÿÿÿÿ
|
||||
[
|
||||
java:S32527"EUse static access with "com.alibaba.fastjson.JSON" for "parseObject".(Ö—×Ì
|
||||
`
|
||||
java:S3252A"EUse static access with "com.alibaba.fastjson.JSON" for "parseObject".(<28>ô—µþÿÿÿÿ
|
||||
`
|
||||
java:S3252G"EUse static access with "com.alibaba.fastjson.JSON" for "parseObject".(ìܪÒùÿÿÿÿ
|
||||
e
|
||||
java:S2674_"JCheck the return value of the "read" call to see how many bytes were read.(ï‹Æ·þÿÿÿÿ
|
||||
N java:S106j"9Replace this use of System.out or System.err by a logger.(䵨<C2B5>
|
||||
?
|
||||
java:S1481}")Remove this unused "res4" local variable.(–<>ˆï
|
||||
f
|
||||
java:S2674Š"JCheck the return value of the "read" call to see how many bytes were read.(š¿¡´ýÿÿÿÿ
|
||||
a
|
||||
java:S3252–"EUse static access with "com.alibaba.fastjson.JSON" for "parseObject".(¶ê€¹ùÿÿÿÿ
|
||||
\
|
||||
java:S3252¾"EUse static access with "com.alibaba.fastjson.JSON" for "parseObject".(®ðä¥
|
||||
O java:S106Á"9Replace this use of System.out or System.err by a logger.(‡‰ž³
|
||||
N java:S106Ã"9Replace this use of System.out or System.err by a logger.(–“¢
|
||||
R java:S125É"<This block of commented-out lines of code should be removed.(ÑÆäÓ
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
E
|
||||
java:S3740
|
||||
"/Provide the parametrized type for this generic.( ‚<C2A0>ç
|
||||
b java:S101"MRename this class name to match the regular expression '^[A-Z][a-zA-Z0-9]*$'.(¬“á…
|
||||
P
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
` java:S112'"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
|
||||
` java:S112)"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
|
||||
y java:S116"_Rename this field "DOUYIN_PUBLISH_VIDEO" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Üšèüÿÿÿÿ
|
||||
<
|
||||
java:S1170"!Make this final field static too.(Üšèüÿÿÿÿ
|
||||
Z
|
||||
java:S2147("DCombine this catch with the one at line 38, which has the same body.(ä ¹€
|
||||
t
|
||||
java:S2142("^Either re-interrupt this method or rethrow the "InterruptedException" that can be caught here.(ä ¹€
|
||||
N java:S106$"9Replace this use of System.out or System.err by a logger.(Ú<>±Æ
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
P
|
||||
java:S1118":Add a private constructor to hide the implicit public one.(†Í‘¿
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
R
|
||||
java:S1128"5Remove this unused import 'lombok.NoArgsConstructor'.(¸¨›<C2A8>8—ܔֽ1
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
C
|
||||
java:S2699"-Add at least one assertion to this test case.(ˆ›Ñ•
|
||||
§
|
||||
java:S3577"‹Rename class "bilibiliTest" to match the regular expression: '^((Test|IT)[a-zA-Z0-9_]+|[A-Z][a-zA-Z0-9_]*(Test|Tests|TestCase|IT|ITCase))$'(·ÿ²‹ùÿÿÿÿ
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
k java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(©¦ý‡ÿÿÿÿÿ
|
||||
h
|
||||
java:S2095"MUse try-with-resources or close this "FileInputStream" in a "finally" clause.(¬èÏ´úÿÿÿÿ
|
||||
i
|
||||
java:S2095"NUse try-with-resources or close this "FileOutputStream" in a "finally" clause.(ÛÉýãøÿÿÿÿ
|
||||
U
|
||||
java:S1118":Add a private constructor to hide the implicit public one.(”è•Öþÿÿÿÿ
|
||||
N java:S1063"9Replace this use of System.out or System.err by a logger.(ìÃÈš
|
||||
i
|
||||
java:S4042="NUse "java.nio.file.Files#delete" here for better messages on error conditions.(ë“<C3AB>«øÿÿÿÿ
|
||||
N java:S106>"9Replace this use of System.out or System.err by a logger.(¹¿³ÿ
|
||||
N java:S106@"9Replace this use of System.out or System.err by a logger.(¾’¾¤
|
||||
@@ -1,15 +1,30 @@
|
||||
|
||||
R
|
||||
java:S2629O"7Use the built-in formatting to construct this argument.(½û·©üÿÿÿÿ
|
||||
java:S2629W"7Use the built-in formatting to construct this argument.(½û·©üÿÿÿÿ
|
||||
M
|
||||
java:S2629R"7Use the built-in formatting to construct this argument.(ʱä¼
|
||||
java:S2629Z"7Use the built-in formatting to construct this argument.(ʱä¼
|
||||
Y
|
||||
java:S2629^"7Use the built-in formatting to construct this argument.(†÷µ‰þÿÿÿÿ8 €ÿÖ¾1
|
||||
O
|
||||
java:S5993#"9Change the visibility of this constructor to "protected".(ÚŽÅê
|
||||
java:S5993+"9Change the visibility of this constructor to "protected".(ÚŽÅê
|
||||
>
|
||||
java:S1948"(Make "needPlugins" private or transient.(ûì
|
||||
java:S1948"(Make "needPlugins" private or transient.(ûì
|
||||
C
|
||||
java:S1948"(Make "logger" transient or serializable.(º½Ââþÿÿÿÿ
|
||||
java:S1948"(Make "logger" transient or serializable.(º½Ââþÿÿÿÿ
|
||||
\
|
||||
java:S3457O"AFormat specifiers should be used instead of string concatenation.(½û·©üÿÿÿÿ
|
||||
java:S3457W"AFormat specifiers should be used instead of string concatenation.(½û·©üÿÿÿÿ
|
||||
W
|
||||
java:S3457R"AFormat specifiers should be used instead of string concatenation.(ʱä¼
|
||||
java:S3457Z"AFormat specifiers should be used instead of string concatenation.(ʱä¼
|
||||
c
|
||||
java:S3457^"AFormat specifiers should be used instead of string concatenation.(†÷µ‰þÿÿÿÿ8·€ÿÖ¾1
|
||||
N
|
||||
java:S1602u",Remove useless curly braces around statement(ü»¦ÿÿÿÿÿ8º€ÿÖ¾1
|
||||
O
|
||||
java:S1602€",Remove useless curly braces around statement(ü»¦ÿÿÿÿÿ8¾€ÿÖ¾1
|
||||
O
|
||||
java:S1602‹",Remove useless curly braces around statement(ü»¦ÿÿÿÿÿ8À€ÿÖ¾1
|
||||
`
|
||||
java:S1128 ">Remove this unused import 'org.example.log.notice.NoticeType'.(¡™é›ÿÿÿÿÿ8À€ÿÖ¾1
|
||||
W
|
||||
java:S1128
|
||||
";Remove this unused import 'org.example.sql.SQLInitMachine'.(š‹Ÿf8À€ÿÖ¾1
|
||||
56
.idea/sonarlint/issuestore/index.pb
generated
56
.idea/sonarlint/issuestore/index.pb
generated
@@ -12,29 +12,17 @@ Ichopperbot-file/src/main/java/org/example/service/NetworkDiskService.java,8\b\
|
||||
p
|
||||
@chopperbot-file/src/main/java/org/example/api/SystemFileApi.java,3\c\3cb27b333f9f0a0ac71ed34663c147bedca03538
|
||||
s
|
||||
Cchopperbot-test/src/test/java/org/example/account/bilibiliTest.java,b\0\b02cc5a085842500825d66a54a50be704e96f801
|
||||
s
|
||||
Cchopperbot-hot/src/main/java/org/example/bean/HotModuleSetting.java,d\b\dbd0a78c1952a54ce2fc8da11f17dc14ffb6a72d
|
||||
w
|
||||
Gchopperbot-account/src/main/java/org/example/api/AccountChannelApi.java,7\2\72a0b1cc7348a03e9bc701e0d29b2292d2ff08d8
|
||||
w
|
||||
Gchopperbot-hot/src/main/java/org/example/core/guard/HotModuleGuard.java,a\0\a041720980ce8572991a33b197c3d81b7cb2e69d
|
||||
n
|
||||
>chopperbot-account/src/main/java/org/example/pojo/Account.java,6\c\6c85b62adf0b3de350e6586ee1339d3834741c00
|
||||
s
|
||||
Cchopperbot-account/src/main/java/org/example/pojo/vo/AccountVO.java,4\9\49d9462b9b83c1568667ea3227b54c5f54aeae81
|
||||
v
|
||||
Fchopperbot-account/src/main/java/org/example/mapper/AccountMapper.java,a\3\a32502cfbace3f9128c1e380c40cb9b6567a12fa
|
||||
p
|
||||
@chopperbot-common/src/main/java/org/example/sql/SQLInitFunc.java,5\5\55e4b538fcebad2a77f4b658e6d9fd393a158b04
|
||||
s
|
||||
Cchopperbot-common/src/main/java/org/example/sql/SQLiteInitFunc.java,4\b\4b7da9982efec0e5c426f794ccc9fcfbcb53cb2a
|
||||
w
|
||||
Gchopperbot-common/src/main/java/org/example/sql/annotation/SQLInit.java,4\d\4de63211fa1504d90fec33b101e394054f994740
|
||||
r
|
||||
Bchopperbot-common/src/main/java/org/example/sql/SQLInitHelper.java,9\f\9f3f5e8d4f0d8f488ca7b92a30583cc53b568509
|
||||
r
|
||||
Bchopperbot-common/src/main/java/org/example/aop/SQLInitAspect.java,4\2\426f5e6e23d68d4dfb8fbf8c5f61054a72ef4cd5
|
||||
‚
|
||||
Rchopperbot-creeper/src/main/java/org/example/core/processor/AbstractProcessor.java,6\1\6197fc5d630b662f5f7a8447c2e64104ee798ff2
|
||||
<EFBFBD>
|
||||
@@ -51,5 +39,47 @@ e
|
||||
5chopperbot-account/src/main/java/org/example/App.java,d\a\dae8427b5b9598eecdbe492665882f394721a1c1
|
||||
u
|
||||
Echopperbot-account/src/main/java/org/example/utils/GetScriptPath.java,9\3\934468a9e28c80a30870d60852f1b32c7dce9190
|
||||
q
|
||||
Achopperbot-test/src/test/java/org/example/account/DouyinTest.java,1\1\118fb8d43e4078cbd6b3698277d7db3567fafc09
|
||||
J
|
||||
chopperbot-publish/pom.xml,5\b\5bab9c92a88840e07bd3e8677691d0296509a5b2
|
||||
p
|
||||
@chopperbot-account/src/main/java/org/example/api/AccountApi.java,b\1\b161b958f9df0eab7333d43b0c1873d1d8b7470d
|
||||
@chopperbot-common/src/main/java/org/example/sql/SQLInitFunc.java,5\5\55e4b538fcebad2a77f4b658e6d9fd393a158b04
|
||||
r
|
||||
Bchopperbot-common/src/main/java/org/example/aop/SQLInitAspect.java,4\2\426f5e6e23d68d4dfb8fbf8c5f61054a72ef4cd5
|
||||
t
|
||||
Dchopperbot-common/src/main/java/org/example/plugin/CommonPlugin.java,f\a\fa7c1c0ac4f71faff2d46fb4595b96b2be8e0634
|
||||
x
|
||||
Hchopperbot-common/src/main/java/org/example/plugin/SpringBootPlugin.java,7\b\7b90b8c37305ca0f12222df871dabebe3584d94b
|
||||
r
|
||||
Bchopperbot-common/src/main/java/org/example/sql/SQLInitHelper.java,9\f\9f3f5e8d4f0d8f488ca7b92a30583cc53b568509
|
||||
l
|
||||
<chopperbot-common/src/main/java/org/example/util/Result.java,c\2\c265040b8aff8c7725873ae0e34f93ab523529af
|
||||
u
|
||||
Echopperbot-account/src/main/java/org/example/mapper/GPTKeyMapper.java,0\f\0fd8787c9c0aad3406f40bce61a7e10c1f8387d0
|
||||
<EFBFBD>
|
||||
Schopperbot-account/src/main/java/org/example/core/account/AccountManagerPlugin.java,4\6\46bb29701603e77d8d5b9379ac3309e77e86e02f
|
||||
~
|
||||
Nchopperbot-account/src/main/java/org/example/core/factory/PlatformFactory.java,b\3\b3f447d1b0b99be03aea32fd9cdc1597762914b4
|
||||
s
|
||||
Cchopperbot-account/src/main/java/org/example/pojo/PlatformType.java,b\9\b92bb55339f40ce9e3bc9512add109fc378f298f
|
||||
<EFBFBD>
|
||||
Schopperbot-account/src/main/java/org/example/core/account/AccountOperateCenter.java,5\6\566d841f71ebb7038aec63d9f4f5de188a9aea55
|
||||
<EFBFBD>
|
||||
Schopperbot-account/src/main/java/org/example/core/account/Impl/AccountOperator.java,1\2\12caf4f8578395f745ba099d4b2c4e027862b923
|
||||
n
|
||||
>chopperbot-account/src/main/java/org/example/pojo/Account.java,6\c\6c85b62adf0b3de350e6586ee1339d3834741c00
|
||||
‡
|
||||
Wchopperbot-publish/src/main/java/org/example/core/publisher/PlatformVideoPublisher.java,3\6\366e666da922fbd26c7f144aca970506741c8ab1
|
||||
v
|
||||
Fchopperbot-account/src/main/java/org/example/mapper/ChannelMapper.java,1\1\11d6296138a0a5fb5bc922ab3e219c2285062fb6
|
||||
†
|
||||
Vchopperbot-account/src/main/java/org/example/init/AccountManagerPluginInitMachine.java,a\7\a780a957bdd3bfe1cb35bc2a23604ea97d5bb09b
|
||||
w
|
||||
Gchopperbot-common/src/main/java/org/example/init/CommonInitMachine.java,4\8\4885847675d4f3a704edb124a828e4340f674392
|
||||
€
|
||||
Pchopperbot-account/src/main/java/org/example/init/VideoPushGuardInitMachine.java,9\4\945d5bad8e0672d51408965fab61b8b92275805f
|
||||
x
|
||||
Hchopperbot-common/src/main/java/org/example/init/InitPluginRegister.java,5\a\5a133c519459ad4a22878928f82def26862acd31
|
||||
y
|
||||
Ichopperbot-common/src/main/java/org/example/plugin/SpringGuardPlugin.java,b\a\ba5cb834162541080055eddad8765b2e20598fe1
|
||||
56
.idea/sonarlint/securityhotspotstore/index.pb
generated
56
.idea/sonarlint/securityhotspotstore/index.pb
generated
@@ -12,25 +12,13 @@ Ichopperbot-file/src/main/java/org/example/service/NetworkDiskService.java,8\b\
|
||||
p
|
||||
@chopperbot-file/src/main/java/org/example/api/SystemFileApi.java,3\c\3cb27b333f9f0a0ac71ed34663c147bedca03538
|
||||
s
|
||||
Cchopperbot-test/src/test/java/org/example/account/bilibiliTest.java,b\0\b02cc5a085842500825d66a54a50be704e96f801
|
||||
s
|
||||
Cchopperbot-hot/src/main/java/org/example/bean/HotModuleSetting.java,d\b\dbd0a78c1952a54ce2fc8da11f17dc14ffb6a72d
|
||||
w
|
||||
Gchopperbot-account/src/main/java/org/example/api/AccountChannelApi.java,7\2\72a0b1cc7348a03e9bc701e0d29b2292d2ff08d8
|
||||
w
|
||||
Gchopperbot-hot/src/main/java/org/example/core/guard/HotModuleGuard.java,a\0\a041720980ce8572991a33b197c3d81b7cb2e69d
|
||||
n
|
||||
>chopperbot-account/src/main/java/org/example/pojo/Account.java,6\c\6c85b62adf0b3de350e6586ee1339d3834741c00
|
||||
s
|
||||
Cchopperbot-account/src/main/java/org/example/pojo/vo/AccountVO.java,4\9\49d9462b9b83c1568667ea3227b54c5f54aeae81
|
||||
v
|
||||
Fchopperbot-account/src/main/java/org/example/mapper/AccountMapper.java,a\3\a32502cfbace3f9128c1e380c40cb9b6567a12fa
|
||||
r
|
||||
Bchopperbot-common/src/main/java/org/example/aop/SQLInitAspect.java,4\2\426f5e6e23d68d4dfb8fbf8c5f61054a72ef4cd5
|
||||
r
|
||||
Bchopperbot-common/src/main/java/org/example/sql/SQLInitHelper.java,9\f\9f3f5e8d4f0d8f488ca7b92a30583cc53b568509
|
||||
p
|
||||
@chopperbot-common/src/main/java/org/example/sql/SQLInitFunc.java,5\5\55e4b538fcebad2a77f4b658e6d9fd393a158b04
|
||||
s
|
||||
Cchopperbot-common/src/main/java/org/example/sql/SQLiteInitFunc.java,4\b\4b7da9982efec0e5c426f794ccc9fcfbcb53cb2a
|
||||
w
|
||||
@@ -51,5 +39,47 @@ e
|
||||
5chopperbot-account/src/main/java/org/example/App.java,d\a\dae8427b5b9598eecdbe492665882f394721a1c1
|
||||
u
|
||||
Echopperbot-account/src/main/java/org/example/utils/GetScriptPath.java,9\3\934468a9e28c80a30870d60852f1b32c7dce9190
|
||||
q
|
||||
Achopperbot-test/src/test/java/org/example/account/DouyinTest.java,1\1\118fb8d43e4078cbd6b3698277d7db3567fafc09
|
||||
J
|
||||
chopperbot-publish/pom.xml,5\b\5bab9c92a88840e07bd3e8677691d0296509a5b2
|
||||
p
|
||||
@chopperbot-account/src/main/java/org/example/api/AccountApi.java,b\1\b161b958f9df0eab7333d43b0c1873d1d8b7470d
|
||||
@chopperbot-common/src/main/java/org/example/sql/SQLInitFunc.java,5\5\55e4b538fcebad2a77f4b658e6d9fd393a158b04
|
||||
r
|
||||
Bchopperbot-common/src/main/java/org/example/aop/SQLInitAspect.java,4\2\426f5e6e23d68d4dfb8fbf8c5f61054a72ef4cd5
|
||||
t
|
||||
Dchopperbot-common/src/main/java/org/example/plugin/CommonPlugin.java,f\a\fa7c1c0ac4f71faff2d46fb4595b96b2be8e0634
|
||||
x
|
||||
Hchopperbot-common/src/main/java/org/example/plugin/SpringBootPlugin.java,7\b\7b90b8c37305ca0f12222df871dabebe3584d94b
|
||||
r
|
||||
Bchopperbot-common/src/main/java/org/example/sql/SQLInitHelper.java,9\f\9f3f5e8d4f0d8f488ca7b92a30583cc53b568509
|
||||
<EFBFBD>
|
||||
Schopperbot-account/src/main/java/org/example/core/account/AccountManagerPlugin.java,4\6\46bb29701603e77d8d5b9379ac3309e77e86e02f
|
||||
l
|
||||
<chopperbot-common/src/main/java/org/example/util/Result.java,c\2\c265040b8aff8c7725873ae0e34f93ab523529af
|
||||
u
|
||||
Echopperbot-account/src/main/java/org/example/mapper/GPTKeyMapper.java,0\f\0fd8787c9c0aad3406f40bce61a7e10c1f8387d0
|
||||
~
|
||||
Nchopperbot-account/src/main/java/org/example/core/factory/PlatformFactory.java,b\3\b3f447d1b0b99be03aea32fd9cdc1597762914b4
|
||||
<EFBFBD>
|
||||
Schopperbot-account/src/main/java/org/example/core/account/Impl/AccountOperator.java,1\2\12caf4f8578395f745ba099d4b2c4e027862b923
|
||||
s
|
||||
Cchopperbot-account/src/main/java/org/example/pojo/PlatformType.java,b\9\b92bb55339f40ce9e3bc9512add109fc378f298f
|
||||
<EFBFBD>
|
||||
Schopperbot-account/src/main/java/org/example/core/account/AccountOperateCenter.java,5\6\566d841f71ebb7038aec63d9f4f5de188a9aea55
|
||||
n
|
||||
>chopperbot-account/src/main/java/org/example/pojo/Account.java,6\c\6c85b62adf0b3de350e6586ee1339d3834741c00
|
||||
‡
|
||||
Wchopperbot-publish/src/main/java/org/example/core/publisher/PlatformVideoPublisher.java,3\6\366e666da922fbd26c7f144aca970506741c8ab1
|
||||
v
|
||||
Fchopperbot-account/src/main/java/org/example/mapper/ChannelMapper.java,1\1\11d6296138a0a5fb5bc922ab3e219c2285062fb6
|
||||
€
|
||||
Pchopperbot-account/src/main/java/org/example/init/VideoPushGuardInitMachine.java,9\4\945d5bad8e0672d51408965fab61b8b92275805f
|
||||
†
|
||||
Vchopperbot-account/src/main/java/org/example/init/AccountManagerPluginInitMachine.java,a\7\a780a957bdd3bfe1cb35bc2a23604ea97d5bb09b
|
||||
w
|
||||
Gchopperbot-common/src/main/java/org/example/init/CommonInitMachine.java,4\8\4885847675d4f3a704edb124a828e4340f674392
|
||||
x
|
||||
Hchopperbot-common/src/main/java/org/example/init/InitPluginRegister.java,5\a\5a133c519459ad4a22878928f82def26862acd31
|
||||
y
|
||||
Ichopperbot-common/src/main/java/org/example/plugin/SpringGuardPlugin.java,b\a\ba5cb834162541080055eddad8765b2e20598fe1
|
||||
@@ -38,13 +38,6 @@
|
||||
<groupId>org.example</groupId>
|
||||
<artifactId>chopperbot-publish</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId></groupId>
|
||||
<artifactId></artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.hankcs</groupId>
|
||||
<artifactId>hanlp</artifactId>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package org.example.api;
|
||||
|
||||
import org.example.core.account.AccountOperateCenter;
|
||||
import org.example.core.channel.AccountBindChannel;
|
||||
import org.example.pojo.Account;
|
||||
import org.example.pojo.Channel;
|
||||
import org.example.pojo.vo.AccountVO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -18,6 +20,8 @@ public class AccountApi {
|
||||
|
||||
@Resource
|
||||
AccountOperateCenter accountOperator;
|
||||
@Resource
|
||||
AccountBindChannel channel;
|
||||
|
||||
/*
|
||||
* 第一次登陆调用此方法将账号对应cookie存入数据库中
|
||||
@@ -51,4 +55,12 @@ public class AccountApi {
|
||||
public void deleteUser(int uid){
|
||||
accountOperator.deleteAccount(uid);
|
||||
}
|
||||
|
||||
public void bindChannel(String userId,String channelId){
|
||||
channel.bindChannel(channelId,userId);
|
||||
}
|
||||
|
||||
public void unBindChannel(String userId,String channelId){
|
||||
channel.unbindChannel(channelId,userId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
package org.example.api;
|
||||
|
||||
import org.example.core.channel.AccountChannel;
|
||||
import org.example.util.Result;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/17 8:34
|
||||
*/
|
||||
@Component
|
||||
public class AccountChannelApi {
|
||||
|
||||
@Resource
|
||||
AccountChannel accountChannel;
|
||||
|
||||
public Result addChannel(String name){
|
||||
return Result.success(accountChannel.addChannel(name));
|
||||
}
|
||||
|
||||
public Result delChannel(String name){
|
||||
return Result.success(accountChannel.delChannel(name));
|
||||
}
|
||||
|
||||
public Result getChannelAccounts(String name){
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
public Result getChannels(){
|
||||
return Result.success(accountChannel.getChannelList());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.example.api;
|
||||
|
||||
|
||||
import org.example.core.channel.AccountBindChannel;
|
||||
import org.example.util.Result;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/17 8:34
|
||||
*/
|
||||
@Component
|
||||
public class ChannelApi {
|
||||
|
||||
@Resource
|
||||
AccountBindChannel accountChannel;
|
||||
|
||||
public Result addChannel(String name,String route){
|
||||
return Result.success(accountChannel.addChannel(name,route));
|
||||
}
|
||||
|
||||
public Result delChannel(String channelId){
|
||||
return Result.success(accountChannel.delChannel(channelId));
|
||||
}
|
||||
|
||||
public Result getChannelAccounts(String channelId){
|
||||
return Result.success(accountChannel.getAccountList(channelId));
|
||||
}
|
||||
|
||||
public Result getChannels(){
|
||||
return Result.success(accountChannel.getChannelList());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.example.api;
|
||||
|
||||
import org.example.bean.section.PackageSection;
|
||||
import org.example.constpool.PluginName;
|
||||
import org.example.core.guard.VideoPushGuard;
|
||||
import org.example.init.InitPluginRegister;
|
||||
@@ -7,18 +8,21 @@ import org.example.plugin.CommonPlugin;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description 视频推送插件api
|
||||
* @Author welsir
|
||||
* @Date 2023/9/5 22:36
|
||||
*/
|
||||
@Component
|
||||
public class VideoPublishApi {
|
||||
public class VideoPushApi {
|
||||
|
||||
public static void pushVideo(Object obj){
|
||||
VideoPushGuard plugin = InitPluginRegister.getPlugin(PluginName.VIDEO_PUSH_PLUGIN, VideoPushGuard.class);
|
||||
Assert.isNull(plugin,"plugin is null!");
|
||||
plugin.sendVideo(obj);
|
||||
@Resource
|
||||
VideoPushGuard videoPushGuard;
|
||||
|
||||
public void pushVideo(PackageSection obj){
|
||||
videoPushGuard.sendVideo(obj);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package org.example.core.channel;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.example.mapper.AccountChannelMapper;
|
||||
import org.example.mapper.AccountMapper;
|
||||
import org.example.mapper.ChannelMapper;
|
||||
import org.example.plugin.SpringBootPlugin;
|
||||
@@ -46,9 +48,9 @@ public class AccountBindChannel extends SpringBootPlugin {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean delChannel(String name){
|
||||
public boolean delChannel(String channelId){
|
||||
try {
|
||||
channelMapper.delete(new QueryWrapper<Channel>().eq("name",name));
|
||||
channelMapper.deleteById(channelId);
|
||||
}catch (RuntimeException e){
|
||||
log.debug("删除管道失败!");
|
||||
return false;
|
||||
@@ -59,26 +61,26 @@ public class AccountBindChannel extends SpringBootPlugin {
|
||||
public List<Channel> getChannelList(){
|
||||
List<Channel> channelList = channelMapper.selectList(null);
|
||||
for (Channel channel : channelList) {
|
||||
channelRoute.put(channel.getName(),channel.getRoute());
|
||||
channelRoute.putIfAbsent(channel.getId().toString(),channel.getRoute());
|
||||
}
|
||||
return channelMapper.selectList(null);
|
||||
return channelList;
|
||||
}
|
||||
|
||||
public List<Account> getAccountList(String name){
|
||||
List<Channel> channels = channelMapper.selectList(new QueryWrapper<Channel>().eq("name", name));
|
||||
Long channelId = channels.get(0).getId();
|
||||
return channelMapper.getChannelAccounts(channelId);
|
||||
public List<Account> getAccountList(String channelId){
|
||||
Channel channel = channelMapper.selectById(channelId);
|
||||
Long id = channel.getId();
|
||||
return channelMapper.getChannelAccounts(id);
|
||||
}
|
||||
|
||||
public void bindChannel(String channelId,String accountId){
|
||||
public void bindChannel (String channelId,String accountId){
|
||||
try {
|
||||
//todo: 需测试
|
||||
List<Account> accountList = channelAccount.get(channelId);
|
||||
accountList.add(accountMapper.selectById(accountId));
|
||||
AccountChannel accountChannel = new AccountChannel();
|
||||
accountChannel.setAccountId(accountId);
|
||||
accountChannel.setChannelId(channelId);
|
||||
channelMapper.bindChannel(accountChannel);
|
||||
channelAccount.putIfAbsent(channelId,new ArrayList<>());
|
||||
List<Account> accountList = channelAccount.get(channelId);
|
||||
accountList.add(accountMapper.selectById(accountId));
|
||||
}catch (RuntimeException e){
|
||||
log.debug("账号绑定失败:"+e);
|
||||
}
|
||||
@@ -108,22 +110,37 @@ public class AccountBindChannel extends SpringBootPlugin {
|
||||
public boolean init() {
|
||||
channelAccount = new HashMap<>();
|
||||
channelRoute = new HashMap<>();
|
||||
sqlInitHelper.initTable("channel","CREATE TABLE `account_channel` (\n" +
|
||||
" `id` bigint NOT NULL,\n" +
|
||||
" `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,\n" +
|
||||
" `route` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,\n" +
|
||||
" PRIMARY KEY (`id`) USING BTREE,\n" +
|
||||
" UNIQUE INDEX `name`(`name` ASC) USING BTREE\n" +
|
||||
")"+
|
||||
"INSERT INTO `account_channel` (`id`, `name`, `type`) VALUES (1, 'default', '*.*.*');");
|
||||
|
||||
sqlInitHelper.initTable("account_channel","CREATE TABLE `channel` (\n" +
|
||||
" `id` bigint NOT NULL,\n" +
|
||||
" `channel_id` bigint NULL DEFAULT NULL,\n" +
|
||||
" `account_id` bigint NULL DEFAULT NULL,\n" +
|
||||
" PRIMARY KEY (`id`) USING BTREE\n" +
|
||||
sqlInitHelper.initTable("channel","CREATE TABLE `channel` (\n" +
|
||||
" `id` INTEGER NOT NULL,\n" +
|
||||
" `name` TEXT NOT NULL,\n" +
|
||||
" `route` TEXT NOT NULL,\n" +
|
||||
" PRIMARY KEY (id),\n" +
|
||||
" UNIQUE (name)\n" +
|
||||
")");
|
||||
|
||||
ArrayList<Channel> channels = new ArrayList<>();
|
||||
Channel channel = new Channel();
|
||||
channel.setRoute("*.*.*");
|
||||
channel.setName("default");
|
||||
channel.setId(1L);
|
||||
channels.add(channel);
|
||||
sqlInitHelper.initData(channels,channelMapper);
|
||||
sqlInitHelper.initTable("account_channel","CREATE TABLE `account_channel` (\n" +
|
||||
" `id` INTEGER NOT NULL,\n" +
|
||||
" `channel_id` TEXT ,\n" +
|
||||
" `account_id` TEXT ,\n" +
|
||||
" PRIMARY KEY (id)\n" +
|
||||
")");
|
||||
List<Channel> channelList = channelMapper.selectList(null);
|
||||
for (Channel channel1 : channelList) {
|
||||
channelRoute.put(channel1.getId().toString(),channel1.getRoute());
|
||||
}
|
||||
List<AccountChannel> accountChannels = channelMapper.queryAccountChannel();
|
||||
for (AccountChannel accountChannel : accountChannels) {
|
||||
channelAccount.putIfAbsent(accountChannel.getChannelId(),new ArrayList<>());
|
||||
List<Account> accountList = channelAccount.get(accountChannel.getChannelId());
|
||||
Account account = accountMapper.selectById(accountChannel.getAccountId());
|
||||
accountList.add(account);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,65 +1,95 @@
|
||||
package org.example.core.exchange;
|
||||
|
||||
import org.example.api.VedioPublishApi;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.example.api.VideoPublishApi;
|
||||
import org.example.bean.section.PackageSection;
|
||||
import org.example.core.channel.AccountBindChannel;
|
||||
import org.example.core.route.DefaultRouteRuler;
|
||||
import org.example.pojo.Video;
|
||||
import org.example.pojo.VideoQueue;
|
||||
|
||||
import org.example.pojo.Account;
|
||||
import org.example.pojo.VideoToPublish;
|
||||
import org.example.pojo.VideoToPush;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Description 视频管道交换机
|
||||
* @Author welsir
|
||||
* @Date 2023/9/4 22:07
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class Exchange {
|
||||
//存储不同管道对应的切片集合
|
||||
private final Map<String, List<PackageSection>> channels = new HashMap<>();
|
||||
//存储管道的匹配规则
|
||||
private Map<String,String> channelRoute;
|
||||
|
||||
@Resource
|
||||
DefaultRouteRuler defaultRouteRuler;
|
||||
@Resource
|
||||
AccountBindChannel channel;
|
||||
@Resource
|
||||
VideoPublishApi pushVideo;
|
||||
|
||||
ScheduledExecutorService task;
|
||||
public Exchange() {
|
||||
task = Executors.newScheduledThreadPool(1);
|
||||
@Scheduled(fixedDelay = 5000)
|
||||
public void publishVideo(){
|
||||
log.info("listen video to push...");
|
||||
Map<String, List<Account>> channelAccount = channel.getChannelAccount();
|
||||
channels.forEach((k,v)->{
|
||||
if(channels.get(k)==null){
|
||||
return;
|
||||
}
|
||||
log.debug("channel:"+k+" videos:"+ Arrays.toString(v.toArray()));
|
||||
List<Account> accountList = channelAccount.get(k);
|
||||
List<PackageSection> packageSections = channels.get(k);
|
||||
for (Account account : accountList) {
|
||||
for (PackageSection packageSection : packageSections) {
|
||||
VideoToPublish video = new VideoToPublish();
|
||||
video.setCookies(account.getCookies());
|
||||
video.setTitle(packageSection.getTitle());
|
||||
video.setDevicePath(getDevicePath(packageSection.getVideoPath()));
|
||||
video.setVideoPath(packageSection.getVideoPath());
|
||||
video.setContent(packageSection.getContent());
|
||||
video.setCoverPath(packageSection.getCoverPath());
|
||||
video.setDescription(packageSection.getDescription());
|
||||
video.setLabels(packageSection.getLabels());
|
||||
video.setPlatform(packageSection.getPlatform());
|
||||
pushVideo.publishVideo(video);
|
||||
}
|
||||
}
|
||||
channels.get(k).removeAll(v);
|
||||
});
|
||||
}
|
||||
|
||||
public void startListening() {
|
||||
// 每5秒轮询一次消息队列
|
||||
// 检查消息队列并提取消息
|
||||
task.scheduleAtFixedRate(this::checkAndProcessMessages, 0, 5, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
private void checkAndProcessMessages() {
|
||||
// 在这里检查消息队列,提取消息并调用publish方法
|
||||
// for (String channel : channels.keySet()) {
|
||||
// List<PackageSection> packageSections = channels.get(channel);
|
||||
// for (PackageSection packageSection : packageSections) {
|
||||
// VedioPublishApi.publishVideo(VideoToPublish.builder()
|
||||
// .videoPath(packageSection.getVideoPath()).cookies().build())
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
public void publish(String routingKey,PackageSection packageSection) {
|
||||
public void pushToQueue(String routingKey,PackageSection packageSection) {
|
||||
channelRoute = channel.getChannelRoute();
|
||||
for (String key : channelRoute.keySet()) {
|
||||
String route = channelRoute.get(key);
|
||||
boolean flag = defaultRouteRuler.matchRoute(routingKey, route);
|
||||
if (flag){
|
||||
if(channels.get(key)==null){
|
||||
channels.put(key,List.of(packageSection));
|
||||
}else {
|
||||
List<PackageSection> packageSections = channels.get(key);
|
||||
packageSections.add(packageSection);
|
||||
}
|
||||
channels.putIfAbsent(key,new ArrayList<>());
|
||||
List<PackageSection> packageSections = channels.get(key);
|
||||
packageSections.add(packageSection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getDevicePath(String filePath){
|
||||
Path path = FileSystems.getDefault().getPath(filePath);
|
||||
String fileName = path.getFileName().toString();
|
||||
Path directoryPath = path.getParent();
|
||||
String directory = (directoryPath != null) ? directoryPath.toString() : "No Directory";
|
||||
return directory+"\\"+fileName+"\\";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.example.core.guard;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.example.bean.section.PackageSection;
|
||||
import org.example.core.exchange.Exchange;
|
||||
import org.example.mapper.AccountMapper;
|
||||
@@ -22,40 +23,41 @@ import java.util.concurrent.TimeUnit;
|
||||
* @Date 2023/9/4 22:10
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class VideoPushGuard extends SpringGuardPlugin {
|
||||
|
||||
private Exchange exchange;
|
||||
|
||||
private BlockingQueue<Object> receiveVideo;
|
||||
@Resource
|
||||
private AccountMapper accountMapper;
|
||||
@Resource
|
||||
ChannelMapper channelMapper;
|
||||
@Resource
|
||||
SQLInitHelper sqlInitHelper;
|
||||
@Resource
|
||||
Exchange exchange;
|
||||
|
||||
@Override
|
||||
public boolean init() {
|
||||
// 两件事情
|
||||
// 一注册队列
|
||||
// 二启动队列监听
|
||||
exchange = new Exchange();
|
||||
//建表
|
||||
receiveVideo = new ArrayBlockingQueue<>(1024);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
try {
|
||||
log.debug("阻塞队列监听视频...");
|
||||
Object videoMsg = receiveVideo.poll(5, TimeUnit.SECONDS);
|
||||
if (videoMsg instanceof PackageSection) {
|
||||
PackageSection video = (PackageSection) videoMsg;
|
||||
StringBuilder route = new StringBuilder();
|
||||
for (String label : video.getLabels()) {
|
||||
if(route.length()!=0)
|
||||
if(route.length()!=0) {
|
||||
route.append(".");
|
||||
}
|
||||
route.append(label);
|
||||
}
|
||||
exchange.publish(route.toString(),video);
|
||||
exchange.pushToQueue(route.toString(),video);
|
||||
}
|
||||
exchange.startListening();
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -14,23 +14,21 @@ public class DefaultRouteRuler extends AbstractRouteRuler{
|
||||
@Override
|
||||
public boolean matchRoute(String route,String channelRoute) {
|
||||
|
||||
String[] routes = route.split("\\.");
|
||||
String[] channelRoutes = channelRoute.split("\\.");
|
||||
|
||||
String label = routes[0];
|
||||
String anchor = routes[1];
|
||||
String plat = routes[2];
|
||||
|
||||
if(label.isEmpty()||anchor.isEmpty()||plat.isEmpty()){
|
||||
return false;
|
||||
if ("*.*.*".equals(channelRoute)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (String s : channelRoutes) {
|
||||
if(s.equals(label)||("\\*").equals(label)){
|
||||
continue;
|
||||
}
|
||||
String[] routes = route.split("\\.");
|
||||
String[] channelRoutes = channelRoute.split("\\.");
|
||||
if(routes.length!=channelRoutes.length){
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < 3; i++) {
|
||||
// 如果 channelRoute 的这一段不是 "*",则必须与 route 的相应段相等
|
||||
if (!"*".equals(channelRoutes[i]) && !channelRoutes[i].equals(routes[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.example.init;
|
||||
|
||||
import org.example.constpool.ModuleName;
|
||||
import org.example.constpool.PluginName;
|
||||
import org.example.core.channel.AccountBindChannel;
|
||||
import org.example.core.guard.VideoPushGuard;
|
||||
import org.example.plugin.annotation.Plugin;
|
||||
import org.example.pojo.AccountChannel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/20 16:09
|
||||
*/
|
||||
@Plugin(moduleName = ModuleName.ACCOUNT,
|
||||
pluginName = PluginName.CHANNEL,
|
||||
pluginName_CN = "账号管道插件",
|
||||
pluginDescription = "用于对管道的CRUD以及账号绑定",
|
||||
pluginClass= AccountBindChannel.class,
|
||||
springBootPlugin = true,
|
||||
ignore = true
|
||||
)
|
||||
@Component
|
||||
public class AccountChannelPluginInitMachine extends SpringPlugInitMachine{
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.example.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.example.pojo.AccountChannel;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/20 11:29
|
||||
*/
|
||||
public interface AccountChannelMapper extends BaseMapper<AccountChannel> {
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import lombok.Data;
|
||||
* @Date 2023/11/17 9:20
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "channel")
|
||||
@TableName(value = "account_channel")
|
||||
public class AccountChannel {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
|
||||
@@ -16,7 +16,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("account_channel")
|
||||
@TableName("channel")
|
||||
public class Channel {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
|
||||
@@ -15,7 +15,7 @@ import lombok.NoArgsConstructor;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class VideoToPublish {
|
||||
public class VideoToPush {
|
||||
|
||||
private String videoPath;
|
||||
private String cookies;
|
||||
@@ -49,6 +49,8 @@ public class PluginName {
|
||||
|
||||
public static final String LABEL_MANAGER = "LabelManager";
|
||||
|
||||
public static final String CHANNEL = "channel";
|
||||
|
||||
|
||||
public static final String LIVE_CONFIG_PLUGIN= "LiveConfig";
|
||||
public static final String LIVE_MANAGER_PLUGIN= "LiveDownLoadManager";
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.example;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* @author Genius
|
||||
@@ -10,6 +11,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
**/
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
public class ConsoleApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.example.controller;
|
||||
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.example.service.AccountChannelService;
|
||||
import org.example.service.AccountService;
|
||||
import org.example.service.impl.AccountChannelServiceImpl;
|
||||
import org.example.util.Result;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/20 11:04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/channel")
|
||||
public class AccountChannelApi {
|
||||
|
||||
@Resource
|
||||
AccountChannelService channelService;
|
||||
|
||||
@PostMapping("/{name}/{route}")
|
||||
public Result addChannel(@PathVariable String name, @PathVariable String route){
|
||||
return Result.success(channelService.channelApi().addChannel(name,route));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{channelId}")
|
||||
public Result delChannel(@PathVariable String channelId){
|
||||
return Result.success(channelService.channelApi().delChannel(channelId));
|
||||
}
|
||||
|
||||
@GetMapping("/")
|
||||
public Result getChannelList(){
|
||||
return Result.success(channelService.channelApi().getChannels());
|
||||
}
|
||||
|
||||
@GetMapping("/accounts/{channelId}")
|
||||
public Result getChannelAccounts(@PathVariable String channelId){
|
||||
return Result.success(channelService.channelApi().getChannelAccounts(channelId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -97,4 +97,17 @@ public class AccountController {
|
||||
public Result updateLabel(@RequestBody VideoLabel label){
|
||||
return Result.success(Map.of("success",accountService.labelManagerPlugin().updateLabel(label)));
|
||||
}
|
||||
|
||||
@PostMapping("/bind/{userId}/{channelId}")
|
||||
public Result bindAccount(@PathVariable String channelId, @PathVariable String userId){
|
||||
accountService.accountPlugin().bindChannel(userId,channelId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@DeleteMapping("/bind/{userId}/{channelId}")
|
||||
public Result unBindAccount(@PathVariable String channelId, @PathVariable String userId){
|
||||
accountService.accountPlugin().unBindChannel(userId,channelId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.example.controller;
|
||||
|
||||
import org.example.bean.section.PackageSection;
|
||||
import org.example.pojo.VideoToPublish;
|
||||
import org.example.service.VideoService;
|
||||
import org.example.util.Result;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/20 17:38
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/video")
|
||||
public class VideoController {
|
||||
|
||||
@Resource
|
||||
VideoService videoService;
|
||||
|
||||
@PostMapping("/")
|
||||
public Result pushVideo(@RequestBody PackageSection video){
|
||||
videoService.videoApi().pushVideo(video);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.example.service;
|
||||
|
||||
import org.example.api.ChannelApi;
|
||||
import org.example.controller.AccountChannelApi;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/20 11:05
|
||||
*/
|
||||
public interface AccountChannelService {
|
||||
|
||||
ChannelApi channelApi();
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package org.example.service;
|
||||
|
||||
|
||||
import org.example.api.AccountApi;
|
||||
import org.example.api.ChannelApi;
|
||||
import org.example.api.LabelManagerPluginApi;
|
||||
import org.example.api.OpenAPIPluginApi;
|
||||
|
||||
@@ -18,4 +19,5 @@ public interface AccountService {
|
||||
OpenAPIPluginApi chatGptPlugin();
|
||||
|
||||
LabelManagerPluginApi labelManagerPlugin();
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.example.service;
|
||||
|
||||
import org.example.api.VideoPublishApi;
|
||||
import org.example.api.VideoPushApi;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/20 17:39
|
||||
*/
|
||||
public interface VideoService {
|
||||
|
||||
VideoPushApi videoApi();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.example.service.impl;
|
||||
|
||||
import org.example.api.ChannelApi;
|
||||
import org.example.controller.AccountChannelApi;
|
||||
import org.example.service.AccountChannelService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/20 11:07
|
||||
*/
|
||||
@Service
|
||||
public class AccountChannelServiceImpl implements AccountChannelService {
|
||||
|
||||
@Resource
|
||||
ChannelApi channelApi;
|
||||
|
||||
@Override
|
||||
public ChannelApi channelApi() {
|
||||
return channelApi;
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package org.example.service.impl;
|
||||
|
||||
import org.example.api.AccountApi;
|
||||
|
||||
import org.example.api.ChannelApi;
|
||||
import org.example.api.LabelManagerPluginApi;
|
||||
import org.example.api.OpenAPIPluginApi;
|
||||
|
||||
@@ -40,4 +41,5 @@ public class AccountServiceImpl implements AccountService {
|
||||
public LabelManagerPluginApi labelManagerPlugin() {
|
||||
return labelManagerPluginApi;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.example.service.impl;
|
||||
|
||||
import org.example.api.VideoPublishApi;
|
||||
import org.example.api.VideoPushApi;
|
||||
import org.example.service.VideoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/20 17:40
|
||||
*/
|
||||
@Service
|
||||
public class VideoPushServiceImpl implements VideoService {
|
||||
|
||||
@Resource
|
||||
VideoPushApi videoPushApi;
|
||||
|
||||
@Override
|
||||
public VideoPushApi videoApi() {
|
||||
return videoPushApi;
|
||||
}
|
||||
}
|
||||
@@ -3,19 +3,23 @@ package org.example.api;
|
||||
import org.example.core.factory.platformSelectionFactory;
|
||||
import org.example.core.publisher.PlatformVideoPublisher;
|
||||
import org.example.pojo.VideoToPublish;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/10/13 17:14
|
||||
*/
|
||||
public class VedioPublishApi {
|
||||
@Component
|
||||
public class VideoPublishApi {
|
||||
|
||||
public static void publishVideo(VideoToPublish videoEntity){
|
||||
PlatformVideoPublisher publisher = platformSelectionFactory.creatPlatformPublisher(videoEntity.getPlatform().getId());
|
||||
publisher.publishVideo(videoEntity);
|
||||
public void publishVideo(VideoToPublish video){
|
||||
PlatformVideoPublisher publisher = platformSelectionFactory.creatPlatformPublisher(video.getPlatform());
|
||||
|
||||
publisher.publishVideo(video);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -10,14 +10,12 @@ import org.example.core.publisher.impl.DouyinVideoPublisher;
|
||||
* @Date 2023/10/13 21:09
|
||||
*/
|
||||
public class platformSelectionFactory {
|
||||
public static PlatformVideoPublisher creatPlatformPublisher(int platformId) {
|
||||
switch (platformId){
|
||||
case 2:
|
||||
return new BilibiliVideoPublisher();
|
||||
case 3:
|
||||
return new DouyinVideoPublisher();
|
||||
default:
|
||||
throw new IllegalArgumentException("平台参数不正确!");
|
||||
public static PlatformVideoPublisher creatPlatformPublisher(String platform) {
|
||||
if("BILIBILI".equals(platform)){
|
||||
return new BilibiliVideoPublisher();
|
||||
}else if(platform.equals("DOUYIN")){
|
||||
return new DouyinVideoPublisher();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ import org.example.utils.VideoDeviceUtil;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Path;
|
||||
import java.time.LocalTime;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package org.example.pojo;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.example.bean.section.PackageSection;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
@@ -9,17 +11,12 @@ import lombok.Data;
|
||||
* @Date 2023/10/13 19:02
|
||||
*/
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Builder
|
||||
public class VideoToPublish {
|
||||
public class VideoToPublish extends PackageSection {
|
||||
|
||||
private String videoPath;
|
||||
private String cookies;
|
||||
private PlatformType platform;
|
||||
private String coverPath;
|
||||
private String devicePath;
|
||||
private String tag;
|
||||
private String title;
|
||||
private String type;
|
||||
private String devicePath;
|
||||
|
||||
}
|
||||
|
||||
18
chopperbot-test/config/Barrage/barrageModuleConfig.json
Normal file
18
chopperbot-test/config/Barrage/barrageModuleConfig.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"data":{
|
||||
"popularRange":{},
|
||||
"barrageScoreCurve":{
|
||||
"duration":5000,
|
||||
"scoreStrategy":"SCORING",
|
||||
"splitStrategy":"ORDER",
|
||||
"basicBarrageScore":5
|
||||
},
|
||||
"InstantSlicing":{
|
||||
"ScheduleTime":{
|
||||
"duration":1800000
|
||||
},
|
||||
"handler":"ScheduleTime"
|
||||
}
|
||||
},
|
||||
"updateTime":"2023-11-19 15:26:27"
|
||||
}
|
||||
28
chopperbot-test/config/Creeper/creeperConfig.json
Normal file
28
chopperbot-test/config/Creeper/creeperConfig.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"data":{
|
||||
"taskCenter":{
|
||||
"queueCapacity":50,
|
||||
"threads":10,
|
||||
"waitingTime":1000
|
||||
},
|
||||
"spiderConfig":{
|
||||
"bilibili":{
|
||||
"emptySleepTime":100,
|
||||
"retrySleepTime":100,
|
||||
"retryTimes":3,
|
||||
"sleepTime":100,
|
||||
"threadCnt":5,
|
||||
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48"
|
||||
},
|
||||
"douyu":{
|
||||
"emptySleepTime":100,
|
||||
"retrySleepTime":100,
|
||||
"retryTimes":3,
|
||||
"sleepTime":100,
|
||||
"threadCnt":5,
|
||||
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48"
|
||||
}
|
||||
}
|
||||
},
|
||||
"updateTime":"2023-11-19 15:26:26"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"data":{
|
||||
"task":[]
|
||||
},
|
||||
"updateTime":"2023-11-19 15:26:26"
|
||||
}
|
||||
14
chopperbot-test/config/Hot/hotModuleConfig.json
Normal file
14
chopperbot-test/config/Hot/hotModuleConfig.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"data":{
|
||||
"HotGuard":{
|
||||
"GuardNum":10
|
||||
},
|
||||
"LiverFollower":{
|
||||
"focusLive":1,
|
||||
"checkTime":60000,
|
||||
"focusBarrage":1,
|
||||
"focusRecord":1
|
||||
}
|
||||
},
|
||||
"updateTime":"2023-11-19 15:26:27"
|
||||
}
|
||||
8
chopperbot-test/config/LiveRecord/liveConfig.json
Normal file
8
chopperbot-test/config/LiveRecord/liveConfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"data":{
|
||||
"LiveDownload":{
|
||||
"showDownloadTable":false
|
||||
}
|
||||
},
|
||||
"updateTime":"2023-11-19 15:26:26"
|
||||
}
|
||||
44
chopperbot-test/config/chopperBotConfig.json
Normal file
44
chopperbot-test/config/chopperBotConfig.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"data":{
|
||||
"src":{
|
||||
"Account":"./config/Account",
|
||||
"Creeper":"./config/Creeper",
|
||||
"LiveRecord":"./config/LiveRecord",
|
||||
"SectionWork":"./config/SectionWork",
|
||||
"Hot":"./config/Hot",
|
||||
"Section":"./config/Section",
|
||||
"Barrage":"./config/Barrage",
|
||||
"Publish":"./config/Publish"
|
||||
},
|
||||
"pluginStart":{
|
||||
"HotGuard":true,
|
||||
"SectionWorkShop":true,
|
||||
"BarrageConfig":true,
|
||||
"BarrageEvent":true,
|
||||
"BarrageFileListen":false,
|
||||
"LiveConfig":true,
|
||||
"EmotionAnalysis":false,
|
||||
"BarrageScoreCurve":true,
|
||||
"FileCacheManager":true,
|
||||
"LiverFollower":true,
|
||||
"TaskMonitor":true,
|
||||
"HotConfig":true,
|
||||
"TaskCenter":true,
|
||||
"CreeperManager":true,
|
||||
"DescriptionGenerate":true,
|
||||
"InstantSlicing":true,
|
||||
"LiveDownLoadManager":true,
|
||||
"BarragePopularRange":true,
|
||||
"HotRecommendation":true,
|
||||
"NoticePlugin":true,
|
||||
"TitleGenerate":true,
|
||||
"LabelGenerate":true,
|
||||
"VideoPush":true,
|
||||
"AccountManager":true,
|
||||
"LabelManager":true,
|
||||
"CreeperConfig":true,
|
||||
"OpenAPI":true
|
||||
}
|
||||
},
|
||||
"updateTime":"2023-11-19 22:38:29"
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package org.example.account;
|
||||
|
||||
import org.example.ConsoleApplication;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.Cookie;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Scanner;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
* @Author welsir
|
||||
* @Date 2023/11/19 15:18
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = ConsoleApplication.class,webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
public class TiktokTest {
|
||||
|
||||
@Test
|
||||
public void pushVideo() throws Exception {
|
||||
System.setProperty("webdriver.chrome.driver", "D:\\downLoad\\chromedriver_win32\\chromedriver.exe");
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.setBinary("C:\\Program Files (x86)\\Chromebrowser\\Chrome.exe");
|
||||
ChromeDriver webDriver = new ChromeDriver(options);
|
||||
String url = "https://www.tiktok.com/";
|
||||
webDriver.get(url);
|
||||
webDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
scanner.next();
|
||||
Set<Cookie> cookies = webDriver.manage().getCookies();
|
||||
baocun(cookies);
|
||||
webDriver.quit();
|
||||
ChromeDriver chromeDriver = new ChromeDriver(options);
|
||||
chromeDriver.get(url);
|
||||
chromeDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
|
||||
Set<Cookie> cookieSet = read();
|
||||
chromeDriver.manage().deleteAllCookies();
|
||||
for (Cookie cookie : cookieSet) {
|
||||
chromeDriver.manage().addCookie(cookie);
|
||||
}
|
||||
chromeDriver.navigate().refresh();
|
||||
WebElement uploadButton = chromeDriver.findElement(By.xpath("//*[@id=\"app-header\"]/div/div[3]/div[1]/a"));
|
||||
uploadButton.click();
|
||||
WebDriverWait wait = new WebDriverWait(chromeDriver, 10);
|
||||
WebElement iframe = wait.until(ExpectedConditions.visibilityOfElementLocated
|
||||
(By.xpath("/html/body/div/div[2]/div[2]/div/div/iframe")));
|
||||
chromeDriver.switchTo().frame(iframe);
|
||||
System.out.println(iframe);
|
||||
WebElement file = wait.until(ExpectedConditions.visibilityOfElementLocated
|
||||
(By.xpath("/html/body/div[1]/div/div/div/div/div/div/div/div/div[4]/button")));
|
||||
System.out.println(file);
|
||||
String filePath = "D:\\soft\\QQ\\1824379011\\FileRecv\\MobileFile\1_1.mp4";
|
||||
file.sendKeys(filePath);
|
||||
WebElement upload = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("/html/body/div[1]/div/div/div/div/div[2]/div[2]/div[8]/div[2]/button")));
|
||||
upload.click();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateUser() throws Exception {
|
||||
System.setProperty("webdriver.chrome.driver", "D:\\downLoad\\chromedriver_win32\\chromedriver.exe");
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.setBinary("C:\\Program Files (x86)\\Chromebrowser\\Chrome.exe");
|
||||
// ChromeDriver webDriver = new ChromeDriver(options);
|
||||
String url = "https://www.tiktok.com/";
|
||||
ChromeDriver chromeDriver = new ChromeDriver(options);
|
||||
chromeDriver.get(url);
|
||||
chromeDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
|
||||
Set<Cookie> cookieSet = read();
|
||||
chromeDriver.manage().deleteAllCookies();
|
||||
for (Cookie cookie : cookieSet) {
|
||||
chromeDriver.manage().addCookie(cookie);
|
||||
}
|
||||
chromeDriver.navigate().refresh();
|
||||
String account = "@user616845559";
|
||||
chromeDriver.get(url+account);
|
||||
WebDriverWait wait = new WebDriverWait(chromeDriver, 10);
|
||||
WebElement update = wait.until(ExpectedConditions.elementToBeClickable
|
||||
(By.xpath("/html/body/div[1]/div[2]/div[2]/div/div/div[1]/div[1]/div[2]/div/button")));
|
||||
update.click();
|
||||
WebElement form = wait.until(ExpectedConditions.elementToBeClickable
|
||||
(By.xpath("/html/body/div[6]/div/div[2]/div/div/div[2]/div/div/section")));
|
||||
WebElement text = wait.until(ExpectedConditions.elementToBeClickable
|
||||
(By.xpath("/html/body/div[6]/div/div[2]/div/div/div[2]/div/div/section/div/div[2]/div[4]/div[2]/textarea")));
|
||||
text.clear();
|
||||
text.sendKeys("hahahahaha");
|
||||
WebElement save = wait.until(ExpectedConditions.elementToBeClickable
|
||||
(By.xpath("/html/body/div[6]/div/div[2]/div/div/div[2]/div/div/section/div/div[3]/button[2]")));
|
||||
save.click();
|
||||
Thread.sleep(10000L);
|
||||
chromeDriver.navigate().refresh();
|
||||
}
|
||||
public static void baocun(Set<Cookie> cookies) throws Exception {
|
||||
ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream("d:\\4.txt"));
|
||||
objectOutputStream.writeObject(cookies);
|
||||
}
|
||||
|
||||
public static Set<Cookie> read() throws Exception {
|
||||
ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream("d:\\4.txt"));
|
||||
HashSet<Cookie> cookies = (HashSet<Cookie>) objectInputStream.readObject();
|
||||
return cookies;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -80,4 +82,28 @@ public class bilibiliTest {
|
||||
return cookies;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFile(){
|
||||
String filePath = "D://file//a.mp4";
|
||||
|
||||
// 使用 Paths.get 方法创建 Path 对象
|
||||
Path path = FileSystems.getDefault().getPath(filePath);
|
||||
|
||||
// 获取文件名
|
||||
String fileName = path.getFileName().toString();
|
||||
System.out.println("File Name: " + fileName);
|
||||
|
||||
// 获取目录路径
|
||||
Path directoryPath = path.getParent();
|
||||
String directory = (directoryPath != null) ? directoryPath.toString() : "No Directory"; // 处理根目录的情况
|
||||
System.out.println("Directory: " + directory);
|
||||
|
||||
|
||||
HashMap<String, List<String>> objectObjectHashMap = new HashMap<>();
|
||||
objectObjectHashMap.putIfAbsent("123",new ArrayList<>());
|
||||
List<String> strings = objectObjectHashMap.get("123");
|
||||
strings.add("zzzz");
|
||||
System.out.println(objectObjectHashMap.get("123"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
18
config/Barrage/barrageModuleConfig.json
Normal file
18
config/Barrage/barrageModuleConfig.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"data":{
|
||||
"barrageScoreCurve":{
|
||||
"scoreStrategy":"SCORING",
|
||||
"splitStrategy":"ORDER",
|
||||
"basicBarrageScore":5,
|
||||
"duration":5000
|
||||
},
|
||||
"InstantSlicing":{
|
||||
"handler":"ScheduleTime",
|
||||
"ScheduleTime":{
|
||||
"duration":1800000
|
||||
}
|
||||
},
|
||||
"popularRange":{}
|
||||
},
|
||||
"updateTime":"2023-11-20 11:19:28"
|
||||
}
|
||||
28
config/Creeper/creeperConfig.json
Normal file
28
config/Creeper/creeperConfig.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"data":{
|
||||
"taskCenter":{
|
||||
"queueCapacity":50,
|
||||
"threads":10,
|
||||
"waitingTime":1000
|
||||
},
|
||||
"spiderConfig":{
|
||||
"douyu":{
|
||||
"emptySleepTime":100,
|
||||
"retrySleepTime":100,
|
||||
"retryTimes":3,
|
||||
"sleepTime":100,
|
||||
"threadCnt":5,
|
||||
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48"
|
||||
},
|
||||
"bilibili":{
|
||||
"emptySleepTime":100,
|
||||
"retrySleepTime":100,
|
||||
"retryTimes":3,
|
||||
"sleepTime":100,
|
||||
"threadCnt":5,
|
||||
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.48"
|
||||
}
|
||||
}
|
||||
},
|
||||
"updateTime":"2023-11-20 11:19:28"
|
||||
}
|
||||
6
config/Creeper/log/creeper-2023-11-20.log
Normal file
6
config/Creeper/log/creeper-2023-11-20.log
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"data":{
|
||||
"task":[]
|
||||
},
|
||||
"updateTime":"2023-11-20 11:19:28"
|
||||
}
|
||||
14
config/Hot/hotModuleConfig.json
Normal file
14
config/Hot/hotModuleConfig.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"data":{
|
||||
"LiverFollower":{
|
||||
"checkTime":60000,
|
||||
"focusBarrage":1,
|
||||
"focusRecord":1,
|
||||
"focusLive":1
|
||||
},
|
||||
"HotGuard":{
|
||||
"GuardNum":10
|
||||
}
|
||||
},
|
||||
"updateTime":"2023-11-20 11:19:28"
|
||||
}
|
||||
8
config/LiveRecord/liveConfig.json
Normal file
8
config/LiveRecord/liveConfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"data":{
|
||||
"LiveDownload":{
|
||||
"showDownloadTable":false
|
||||
}
|
||||
},
|
||||
"updateTime":"2023-11-20 11:19:28"
|
||||
}
|
||||
45
config/chopperBotConfig.json
Normal file
45
config/chopperBotConfig.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"data":{
|
||||
"src":{
|
||||
"Account":"./config/Account",
|
||||
"Creeper":"./config/Creeper",
|
||||
"LiveRecord":"./config/LiveRecord",
|
||||
"SectionWork":"./config/SectionWork",
|
||||
"Hot":"./config/Hot",
|
||||
"Barrage":"./config/Barrage",
|
||||
"Section":"./config/Section",
|
||||
"Publish":"./config/Publish"
|
||||
},
|
||||
"pluginStart":{
|
||||
"HotGuard":true,
|
||||
"SectionWorkShop":true,
|
||||
"BarrageConfig":true,
|
||||
"BarrageFileListen":false,
|
||||
"BarrageEvent":true,
|
||||
"channel":true,
|
||||
"LiveConfig":true,
|
||||
"BarrageScoreCurve":true,
|
||||
"EmotionAnalysis":false,
|
||||
"FileCacheManager":true,
|
||||
"LiverFollower":true,
|
||||
"TaskMonitor":true,
|
||||
"HotConfig":true,
|
||||
"TaskCenter":true,
|
||||
"CreeperManager":true,
|
||||
"DescriptionGenerate":true,
|
||||
"InstantSlicing":true,
|
||||
"LiveDownLoadManager":true,
|
||||
"BarragePopularRange":true,
|
||||
"HotRecommendation":true,
|
||||
"NoticePlugin":true,
|
||||
"TitleGenerate":true,
|
||||
"LabelGenerate":true,
|
||||
"VideoPush":true,
|
||||
"AccountManager":true,
|
||||
"LabelManager":true,
|
||||
"CreeperConfig":true,
|
||||
"OpenAPI":true
|
||||
}
|
||||
},
|
||||
"updateTime":"2023-11-20 19:09:52"
|
||||
}
|
||||
BIN
database.db
BIN
database.db
Binary file not shown.
Reference in New Issue
Block a user