|
@@ -13,6 +13,7 @@ import ( |
|
|
"encoding/json" |
|
|
"encoding/json" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"github.com/jinzhu/copier" |
|
|
"github.com/jinzhu/copier" |
|
|
|
|
|
"github.com/syyongx/php2go" |
|
|
"github.com/tidwall/gjson" |
|
|
"github.com/tidwall/gjson" |
|
|
"strings" |
|
|
"strings" |
|
|
"time" |
|
|
"time" |
|
@@ -78,54 +79,53 @@ func GetTaskDetail(appId string, tmp []int64) { |
|
|
tmpIn.ReferMaCaptures = utils.SerializeStr(v1.ReferMaCaptures) |
|
|
tmpIn.ReferMaCaptures = utils.SerializeStr(v1.ReferMaCaptures) |
|
|
tmpIn.TaskTags = utils.SerializeStr(v1.TaskTags) |
|
|
tmpIn.TaskTags = utils.SerializeStr(v1.TaskTags) |
|
|
tmpIn.ReferVideoCaptures = utils.SerializeStr(v1.ReferVideoCaptures) |
|
|
tmpIn.ReferVideoCaptures = utils.SerializeStr(v1.ReferVideoCaptures) |
|
|
|
|
|
|
|
|
|
|
|
videoTmpStr := "bookId=" |
|
|
if tmpIn.Appid == "tt38e94e54a7d70c4601" { |
|
|
if tmpIn.Appid == "tt38e94e54a7d70c4601" { |
|
|
ex := strings.Split(tmpIn.StartPage, "cid=") |
|
|
|
|
|
if len(ex) > 1 { |
|
|
|
|
|
exSecond := strings.Split(ex[1], "&") |
|
|
|
|
|
tmpIn.VideoId = exSecond[0] |
|
|
|
|
|
} |
|
|
|
|
|
if tmpIn.VideoId == "" { |
|
|
|
|
|
fmt.Println("失败", tmpIn) |
|
|
|
|
|
continue |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
ex := strings.Split(tmpIn.StartPage, "bookId=") |
|
|
|
|
|
if len(ex) > 1 { |
|
|
|
|
|
exSecond := strings.Split(ex[1], "&") |
|
|
|
|
|
tmpIn.VideoId = exSecond[0] |
|
|
|
|
|
} |
|
|
|
|
|
if tmpIn.VideoId == "" { |
|
|
|
|
|
fmt.Println("失败", tmpIn) |
|
|
|
|
|
continue |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
videoTmpStr = "cid=" |
|
|
|
|
|
} else if strings.Contains(tmpIn.StartPage, "novelid=") { |
|
|
|
|
|
videoTmpStr = "novelid=" |
|
|
|
|
|
} else if strings.Contains(tmpIn.StartPage, "video_id=") { |
|
|
|
|
|
videoTmpStr = "video_id=" |
|
|
|
|
|
} |
|
|
|
|
|
ex := strings.Split(tmpIn.StartPage, videoTmpStr) |
|
|
|
|
|
if len(ex) > 1 { |
|
|
|
|
|
exSecond := strings.Split(ex[1], "&") |
|
|
|
|
|
tmpIn.VideoId = exSecond[0] |
|
|
|
|
|
} |
|
|
|
|
|
if tmpIn.VideoId == "" { |
|
|
|
|
|
fmt.Println("失败", tmpIn) |
|
|
|
|
|
continue |
|
|
} |
|
|
} |
|
|
if tmpIn.Status != 2 { |
|
|
if tmpIn.Status != 2 { |
|
|
tmpIn.TaskEndTime = int(time.Now().Unix() - 10) |
|
|
tmpIn.TaskEndTime = int(time.Now().Unix() - 10) |
|
|
} |
|
|
} |
|
|
if tmpIn.Appid == "tt8a93fc2e15affaaa01" { |
|
|
|
|
|
//tmp2 := md.Cinema5bmsData{ |
|
|
|
|
|
// Description: "", |
|
|
|
|
|
// ImageUrl: tmpIn.TaskIcon, |
|
|
|
|
|
// Material: "", |
|
|
|
|
|
// OnlineTime: time.Unix(int64(tmpIn.TaskStartTime), 0).Format("2006-01-02 15:04:05"), |
|
|
|
|
|
// Type: "fenghuang", |
|
|
|
|
|
// Title: tmpIn.TaskName, |
|
|
|
|
|
// UpdateTime: int(time.Now().Unix()), |
|
|
|
|
|
// Time: tmpIn.TaskStartTime, |
|
|
|
|
|
// Appid: "tt8a93fc2e15affaaa01", |
|
|
|
|
|
// Id: utils.StrToInt(tmpIn.VideoId), |
|
|
|
|
|
// IsClose: 0, |
|
|
|
|
|
// IsHot: 0, |
|
|
|
|
|
// FirstCate: "story", |
|
|
|
|
|
// SecondCate: "", |
|
|
|
|
|
// Platform: "tikTok", |
|
|
|
|
|
//} |
|
|
|
|
|
//if tmpIn.TaskEndTime < int(time.Now().Unix()) { |
|
|
|
|
|
// tmp2.IsClose = 1 |
|
|
|
|
|
//} |
|
|
|
|
|
//uniqueId := php2go.Md5(tmp2.Appid + "_" + tmp2.Type + "_" + tmp2.FirstCate + "_" + utils.IntToStr(tmp2.Id)) |
|
|
|
|
|
//fmt.Println(uniqueId) |
|
|
|
|
|
//commAddNew(uniqueId, tmp2) |
|
|
|
|
|
|
|
|
for _, v2 := range md.TaskAddList { |
|
|
|
|
|
if tmpIn.Appid == v2["name"] { // |
|
|
|
|
|
tmp2 := md.Cinema5bmsData{ |
|
|
|
|
|
Description: "", |
|
|
|
|
|
ImageUrl: tmpIn.TaskIcon, |
|
|
|
|
|
Material: "", |
|
|
|
|
|
OnlineTime: time.Unix(int64(tmpIn.TaskStartTime), 0).Format("2006-01-02 15:04:05"), |
|
|
|
|
|
Type: v2["second_type"], |
|
|
|
|
|
Title: tmpIn.TaskName, |
|
|
|
|
|
UpdateTime: int(time.Now().Unix()), |
|
|
|
|
|
Time: tmpIn.TaskStartTime, |
|
|
|
|
|
Appid: v2["name"], |
|
|
|
|
|
Id: utils.StrToInt(tmpIn.VideoId), |
|
|
|
|
|
IsClose: 0, |
|
|
|
|
|
IsHot: 0, |
|
|
|
|
|
FirstCate: v2["type"], |
|
|
|
|
|
SecondCate: "", |
|
|
|
|
|
Platform: "tikTok", |
|
|
|
|
|
} |
|
|
|
|
|
if tmpIn.TaskEndTime < int(time.Now().Unix()) { |
|
|
|
|
|
tmp2.IsClose = 1 |
|
|
|
|
|
} |
|
|
|
|
|
uniqueId := php2go.Md5(tmp2.Appid + "_" + tmp2.Type + "_" + tmp2.FirstCate + "_" + utils.IntToStr(tmp2.Id)) |
|
|
|
|
|
fmt.Println(uniqueId) |
|
|
|
|
|
commAddNew(uniqueId, tmp2) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
CommAddTaskDetail(utils.Int64ToStr(tmpIn.TaskId), tmpIn) |
|
|
CommAddTaskDetail(utils.Int64ToStr(tmpIn.TaskId), tmpIn) |
|
|
} |
|
|
} |
|
|