refactor: VideoCrawlerConfigs struct

This commit is contained in:
lilong.129
2023-04-30 01:17:40 +08:00
parent 6bc5e11e2d
commit bb52abf579
5 changed files with 65 additions and 30 deletions

View File

@@ -19,7 +19,8 @@
"method": "video_crawler",
"params": {
"app_package_name": "com.ss.android.ugc.aweme",
"sleep_random": [
"feed": {
"sleep_random": [
0,
5,
0.7,
@@ -27,9 +28,14 @@
10,
0.3
],
"target_count": {
"feed_count": 5,
"live_count": 3
"target_count": 5
},
"live": {
"sleep_random": [
15,
20
],
"target_count": 3
}
}
}

View File

@@ -21,11 +21,14 @@ func TestAndroidVideoCrawlerTest(t *testing.T) {
Android().
VideoCrawler(map[string]interface{}{
"app_package_name": "com.ss.android.ugc.aweme",
"target_count": map[string]interface{}{
"feed_count": 5,
"live_count": 3,
"feed": map[string]interface{}{
"target_count": 5,
"sleep_random": []float64{0, 5, 0.7, 5, 10, 0.3},
},
"live": map[string]interface{}{
"target_count": 3,
"sleep_random": []float64{15, 20},
},
"sleep_random": []float64{0, 5, 0.7, 5, 10, 0.3},
}),
hrp.NewStep("exit").
Android().