From ad02a5b4d900b7ce3f50180862239a5c06af1467 Mon Sep 17 00:00:00 2001 From: eson Date: Mon, 13 Jul 2020 19:11:13 +0800 Subject: [PATCH] =?UTF-8?q?TODO:=20workflow=E6=94=B9=E8=BF=9B,=20=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.go | 2 +- tasks/openrec/openrec_task2/task_openrec.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index 0b62879..1e73967 100644 --- a/config.go +++ b/config.go @@ -17,7 +17,7 @@ func init() { InitConfig.Load() // storeOpenrec = NewStore() - log.SetFlags(log.Lshortfile | log.Ldate) + log.SetFlags(log.Llongfile | log.Ldate) } // Config 配置 diff --git a/tasks/openrec/openrec_task2/task_openrec.go b/tasks/openrec/openrec_task2/task_openrec.go index d8cf2ba..defa483 100644 --- a/tasks/openrec/openrec_task2/task_openrec.go +++ b/tasks/openrec/openrec_task2/task_openrec.go @@ -58,9 +58,10 @@ func (oer *OpenrecExtratorRanking) Execute(cxt *hunter.TaskContext) { scurl := "curl 'https://www.openrec.tv/viewapp/api/v6/supporters?identify_id=sumomo_xqx&month=&Uuid=B96EE988-E3A2-4A44-A543-611A8B4BC683&Token=46598c320408bd69ae3c63298f6f4a3a97354175&Random=AZVXNAAXQVMOSVWNDPIQ&page_number=1' -H 'accept: application/json, text/javascript, */*; q=0.01' -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36' -H 'cookie: uuid=B96EE988-E3A2-4A44-A543-611A8B4BC683;' --compressed" curl := gcurl.ParseRawCURL(scurl) supportersSession := curl.CreateSession() - supportersSession.SetCookies(wf.GetParsedURL(), cookies) + log.Println(curl.ParsedURL) workflow := curl.CreateWorkflow(supportersSession) + supportersSession.SetCookies(workflow.GetParsedURL(), cookies) for { supportersQuery := workflow.GetQuery() @@ -85,7 +86,9 @@ func (oer *OpenrecExtratorRanking) Execute(cxt *hunter.TaskContext) { supportersQuery.Set("identify_id", source.GetSource().String) workflow.SetQuery(supportersQuery) + // workflow.AddCookies(cookies) log.Println(workflow.GetRawURL()) + log.Println(supportersSession.GetCookies(workflow.GetParsedURL())) resp, err := workflow.Execute() if err != nil { log.Println(err)