This commit is contained in:
toom1996
2026-08-25 16:25:28 +08:00
parent 3afd10e049
commit ad83d3d463
6 changed files with 416 additions and 9 deletions

29
cmd/theimpression.go Normal file
View File

@ -0,0 +1,29 @@
package cmd
import (
"github.com/spf13/cobra"
"my-spiders/internal/spider"
)
var theImpressionMaxCo int
var theImpressionCmd = &cobra.Command{
Use: "theimpression",
Short: "启动 The Impression 街拍采集器 (street-style)",
Run: func(cmd *cobra.Command, args []string) {
if theImpressionMaxCo <= 0 {
theImpressionMaxCo = 5
}
// 复用全局 -d/--debug 标志
isDebug := debug
s := spider.NewTheImpressionSpider(DB, theImpressionMaxCo)
s.Debug = isDebug
s.Run()
},
}
func init() {
rootCmd.AddCommand(theImpressionCmd)
theImpressionCmd.Flags().IntVarP(&theImpressionMaxCo, "max-co", "m", 5, "最大并发数限制")
}