TODO: workflow改进, 命名

This commit is contained in:
eson 2020-07-13 19:11:13 +08:00
parent d034647b93
commit ad02a5b4d9
2 changed files with 5 additions and 2 deletions

View File

@ -17,7 +17,7 @@ func init() {
InitConfig.Load()
// storeOpenrec = NewStore()
log.SetFlags(log.Lshortfile | log.Ldate)
log.SetFlags(log.Llongfile | log.Ldate)
}
// Config 配置

View File

@ -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)