This commit is contained in:
toom1996
2026-09-20 00:44:47 +08:00
parent d8f667e391
commit fde57984e7
16 changed files with 3908 additions and 123 deletions

View File

@ -6,7 +6,10 @@ import (
"my-spiders/internal/spider"
)
var theImpressionMaxCo int
var (
theImpressionMaxCo int
theImpressionMaxArticles int
)
var theImpressionCmd = &cobra.Command{
Use: "theimpression",
@ -18,6 +21,7 @@ var theImpressionCmd = &cobra.Command{
// 复用全局 -d/--debug 标志
isDebug := debug
s := spider.NewTheImpressionSpider(theImpressionMaxCo, IngestClient)
s.MaxArticles = theImpressionMaxArticles
s.Debug = isDebug
s.Run()
},
@ -26,4 +30,5 @@ var theImpressionCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(theImpressionCmd)
theImpressionCmd.Flags().IntVarP(&theImpressionMaxCo, "max-co", "m", 5, "最大并发数限制")
theImpressionCmd.Flags().IntVarP(&theImpressionMaxArticles, "max-articles", "n", 0, "最多抓取的街拍任务数(0=不限制,小批量试抓用)")
}