From 9d5a2a788bedb68e99c080ed77e7e0e5051e90d4 Mon Sep 17 00:00:00 2001
From: wangrong <wangrong@shsening.com>
Date: 星期二, 10 十二月 2024 16:56:30 +0800
Subject: [PATCH] Merge branch 'cshenfu' of http://192.168.0.75:10000/r/android/AutoUploadVideos
---
app/src/main/java/com/shsening/autouploadvideos/action/ActionBilibili.kt | 2 +-
app/src/main/java/com/shsening/autouploadvideos/action/ActionRedbook.kt | 19 ++++++++++++-------
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/app/src/main/java/com/shsening/autouploadvideos/action/ActionBilibili.kt b/app/src/main/java/com/shsening/autouploadvideos/action/ActionBilibili.kt
index 51d040f..8dee10a 100644
--- a/app/src/main/java/com/shsening/autouploadvideos/action/ActionBilibili.kt
+++ b/app/src/main/java/com/shsening/autouploadvideos/action/ActionBilibili.kt
@@ -1,4 +1,4 @@
-package com.shsening.autouploadvideos.action
+package com.shsening.autouploadvideos
import android.app.Instrumentation
diff --git a/app/src/main/java/com/shsening/autouploadvideos/action/ActionRedbook.kt b/app/src/main/java/com/shsening/autouploadvideos/action/ActionRedbook.kt
index 7c51459..5c11e4f 100644
--- a/app/src/main/java/com/shsening/autouploadvideos/action/ActionRedbook.kt
+++ b/app/src/main/java/com/shsening/autouploadvideos/action/ActionRedbook.kt
@@ -1,4 +1,4 @@
-package com.shsening.autouploadvideos.action
+package com.shsening.autouploadvideos
import android.app.Instrumentation
@@ -8,8 +8,6 @@
import android.os.Bundle
import android.os.Looper
import androidx.appcompat.app.AppCompatActivity
-import com.shsening.autouploadvideos.UploadSessionActivity
-import com.shsening.autouploadvideos.WebviewUtils
import com.shsening.autouploadvideos.action.PlatformActionInterface
import com.shsening.autouploadvideos.utils.Utils
@@ -35,6 +33,14 @@
private fun updatePostDescription(){
WebviewUtils.addValueToInput(webView,"#publish-container > div > div.body > div.content > div.input.titleInput > div.d-input-wrapper.d-inline-block.c-input_inner > div > input",videoInfo.title)
WebviewUtils.addValueToDiv(webView,"#quillEditor > div > p",videoInfo.description)
+ WebviewUtils.simpleElementClick(webView,"#topicBtn")
+ SystemClock.sleep(500)
+ WebviewUtils.simpleElementClick(webView,"#quill-mention-item-0")
+ WebviewUtils.simpleElementClick(webView,"#topicBtn")
+ SystemClock.sleep(500)
+ WebviewUtils.simpleElementClick(webView,"#quill-mention-item-1")
+
+// WebviewUtils.simpleElementClick(webView,"#el-id-3410-26 > label:nth-child(1)")
WebviewUtils.simpleElementClick(webView,"html > body > div:nth-of-type(1) > div > div:nth-of-type(2) > div > div:nth-of-type(2) > main > div:nth-of-type(3) > div > div > div:nth-of-type(1) > div > div > div > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(10) > div > div:nth-of-type(5) > div:nth-of-type(2) > label:nth-of-type(2)")
addValueToDatePickerInput(true,"html > body > div:nth-of-type(1) > div > div:nth-of-type(2) > div > div:nth-of-type(2) > main > div:nth-of-type(3) > div > div > div:nth-of-type(1) > div > div > div > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(10) > div > div:nth-of-type(5) > div:nth-of-type(2) > div > div:nth-of-type(1) > div",videoInfo.datetime)
// 鍦ㄤ富绾跨▼涓缃欢杩熸墽琛�
@@ -69,12 +75,9 @@
webView.evaluateJavascript(jsCode_CheckVideoUploadFinished) { result ->
if (result == "true") {
// 绛夊緟瑙嗛妫�娴嬪拰鐢熸垚灏侀潰
-// WebviewUtils.simpleElementClick(webView,"#web > div > div > div > div.upload-content > div.upload-wrapper > div > input")
- println("33333333333333333333333333333333333333")
threadHandler.postDelayed({updatePostDescription()},3000)
} else {
- println("11111111111111111111111")
// 鍏冪礌涓嶅瓨鍦紝1绉掑悗鍐嶆妫�鏌�
webView.postDelayed({
checkVideoUploadFinished()
@@ -83,6 +86,7 @@
}
}, 1000) // 姣忕妫�鏌ヤ竴娆�
}
+
private fun checkVideoPublishFinished(){
webView.postDelayed({
webView.evaluateJavascript(jsCode_PublishVideo_Finished) { result ->
@@ -148,9 +152,11 @@
val displayMetrics = activity.resources.displayMetrics
val width = displayMetrics.widthPixels
val height = displayMetrics.heightPixels
+
val startX = width.toFloat() * 0.9f // 浠庡彸渚ф粦鍔�
val endX = width.toFloat() * 0.1f // 婊戝姩鍒板乏渚�
val y = height / 3f // Y 鍧愭爣鍦ㄥ睆骞曚腑闂�
+
Thread {
Utils.instrumentationSwipe(instrumentation, startX, y, endX, y)
SystemClock.sleep(500)
@@ -158,7 +164,6 @@
SystemClock.sleep(500)
Utils.instrumentationClick(instrumentation, width / 2f, height * 2 / 4f)
// back to main thread
-
threadHandler.post {
checkVideoUploadFinished()
}
--
Gitblit v1.9.1