feat: check feed type and incr feed count

This commit is contained in:
lilong.129
2023-05-02 23:29:06 +08:00
parent 1c40f60f4b
commit 7b9e637d87
5 changed files with 130 additions and 10 deletions

View File

@@ -28,7 +28,59 @@
10,
0.3
],
"target_count": 5
"target_count": 5,
"target_labels": [
{
"regex": true,
"scope": [
0,
0.5,
1,
1
],
"text": "^广告$"
},
{
"regex": true,
"scope": [
0,
0.5,
1,
1
],
"text": "^图文$"
},
{
"regex": true,
"scope": [
0,
0.5,
1,
1
],
"text": "^特效\\|"
},
{
"regex": true,
"scope": [
0,
0.5,
1,
1
],
"text": "^模板\\|"
},
{
"regex": true,
"scope": [
0,
0.5,
1,
1
],
"text": "^购物\\|"
}
]
},
"live": {
"sleep_random": [

View File

@@ -23,6 +23,13 @@ func TestAndroidVideoCrawlerTest(t *testing.T) {
"app_package_name": "com.ss.android.ugc.aweme",
"feed": map[string]interface{}{
"target_count": 5,
"target_labels": []map[string]interface{}{
{"text": "^广告$", "scope": []float64{0, 0.5, 1, 1}, "regex": true},
{"text": "^图文$", "scope": []float64{0, 0.5, 1, 1}, "regex": true},
{"text": `^特效\|`, "scope": []float64{0, 0.5, 1, 1}, "regex": true},
{"text": `^模板\|`, "scope": []float64{0, 0.5, 1, 1}, "regex": true},
{"text": `^购物\|`, "scope": []float64{0, 0.5, 1, 1}, "regex": true},
},
"sleep_random": []float64{0, 5, 0.7, 5, 10, 0.3},
},
"live": map[string]interface{}{

View File

@@ -214,7 +214,8 @@ func (wc *WorldCupLive) EnterLive(bundleID string) error {
// 青少年弹窗处理
if ocrTexts, err := wc.driver.GetScreenTextsByOCR(); err == nil {
if points, err := ocrTexts.FindTexts([]string{"青少年模式", "我知道了"}); err == nil {
_ = wc.driver.TapAbsXY(points[1].X, points[1].Y)
point := points[1].Center()
_ = wc.driver.TapAbsXY(point.X, point.Y)
}
}