|
|
@@ -60,7 +60,6 @@ func ImgReqUpload(c *gin.Context) { |
|
|
|
e.OutSuc(c, my1, nil) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func File(c *gin.Context) { |
|
|
|
rFile, _ := c.FormFile("file") |
|
|
|
file, err := rFile.Open() |
|
|
@@ -79,7 +78,7 @@ func File(c *gin.Context) { |
|
|
|
c.String(400, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
if line[0] == "上架时间" { |
|
|
|
if i == 0 { |
|
|
|
i++ |
|
|
|
continue |
|
|
|
} |
|
|
@@ -88,10 +87,19 @@ func File(c *gin.Context) { |
|
|
|
t := time.Now() |
|
|
|
var tmp md.TpdarenNew |
|
|
|
material := "" |
|
|
|
if strings.Contains(line[4], " 提取码") == false { |
|
|
|
material = line[4] |
|
|
|
tqm := line[6] |
|
|
|
Description := line[7] |
|
|
|
Episode := line[11] |
|
|
|
Cate := line[8] |
|
|
|
ImageUrl := line[14] |
|
|
|
PayEpisode := line[12] |
|
|
|
OnlineTime := line[0] |
|
|
|
Title := line[4] |
|
|
|
Id := line[3] |
|
|
|
if strings.Contains(tqm, " 提取码") == false { |
|
|
|
material = tqm |
|
|
|
} else { |
|
|
|
ex := strings.Split(line[4], " 提取码: ") |
|
|
|
ex := strings.Split(tqm, " 提取码: ") |
|
|
|
material = ex[0] |
|
|
|
if strings.Contains(material, "?pwd=") == false { |
|
|
|
material += "?pwd=" + ex[1] |
|
|
@@ -101,35 +109,42 @@ func File(c *gin.Context) { |
|
|
|
material = strings.ReplaceAll(material, "链接:", "") |
|
|
|
material = strings.ReplaceAll(material, " ", "") |
|
|
|
tmp = md.TpdarenNew{ |
|
|
|
Description: line[5], |
|
|
|
Episode: utils.StrToInt(line[9]), |
|
|
|
Cate: line[6], |
|
|
|
ImageUrl: line[12], |
|
|
|
Description: Description, |
|
|
|
Episode: utils.StrToInt(Episode), |
|
|
|
Cate: Cate, |
|
|
|
ImageUrl: ImageUrl, |
|
|
|
IsEnd: 0, |
|
|
|
PayEpisode: utils.StrToInt(line[10]), |
|
|
|
PayEpisode: utils.StrToInt(PayEpisode), |
|
|
|
Material: material, |
|
|
|
OnlineTime: time.Date(t.Year(), time.Month(utils.StrToInt(strings.ReplaceAll(line[0], "月", ""))), 1, 0, 0, 0, 0, t.Location()).Format("2006-01-02 15:04:05"), |
|
|
|
OnlineTime: time.Date(t.Year(), time.Month(utils.StrToInt(strings.ReplaceAll(OnlineTime, "月", ""))), 1, 0, 0, 0, 0, t.Location()).Format("2006-01-02 15:04:05"), |
|
|
|
Type: "dianzhong", |
|
|
|
Title: line[2], |
|
|
|
Title: Title, |
|
|
|
Data: utils.SerializeStr(line), |
|
|
|
DouyinTheaterId: 1, |
|
|
|
KuaishouTheaterId: 2, |
|
|
|
UpdateTime: int(time.Now().Unix()) - i*10, |
|
|
|
Time: int(time.Date(t.Year(), time.Month(utils.StrToInt(strings.ReplaceAll(line[0], "月", ""))), 1, 0, 0, 0, 0, t.Location()).Unix()), |
|
|
|
Time: int(time.Date(t.Year(), time.Month(utils.StrToInt(strings.ReplaceAll(OnlineTime, "月", ""))), 1, 0, 0, 0, 0, t.Location()).Unix()), |
|
|
|
Appid: "31517", |
|
|
|
Id: line[1], |
|
|
|
Id: Id, |
|
|
|
IsClose: 0, |
|
|
|
} |
|
|
|
|
|
|
|
i++ |
|
|
|
fmt.Println(tmp) |
|
|
|
var uniqueId = "" |
|
|
|
tmp.VideoType = "douyin" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
commAdd(uniqueId, tmp) |
|
|
|
if utils.InArr(line[1], []string{"快手下架", "版权到期", "全媒体下架", "全平台下架", "版权到期,全平台下架", "只能H5用"}) == false { |
|
|
|
tmp.VideoType = "kuaishou" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
fmt.Println(uniqueId) |
|
|
|
commAdd(uniqueId, tmp) |
|
|
|
} |
|
|
|
if utils.InArr(line[1], []string{"抖音下架", "版权到期", "全媒体下架", "全平台下架", "版权到期,全平台下架", "只能H5用", "抖音/微信下架"}) == false { |
|
|
|
|
|
|
|
tmp.VideoType = "kuaishou" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
commAdd(uniqueId, tmp) |
|
|
|
tmp.VideoType = "douyin" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
fmt.Println(uniqueId) |
|
|
|
commAdd(uniqueId, tmp) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@@ -195,17 +210,19 @@ func FileTwo(c *gin.Context) { |
|
|
|
} |
|
|
|
|
|
|
|
var uniqueId = "" |
|
|
|
if utils.InArr(line[4], []string{"上架", "微信小程序下架", "乔陌漓,颜汐落"}) { |
|
|
|
|
|
|
|
tmp.VideoType = "douyin" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
commAdd(uniqueId, tmp) |
|
|
|
if utils.InArr(line[4], []string{"上架", "微信小程序下架", "乔陌漓,颜汐落"}) == false { |
|
|
|
tmp.IsClose = 1 |
|
|
|
} |
|
|
|
if utils.InArr(line[4], []string{"上架", "微信小程序下架", "乔陌漓,颜汐落", "抖音下架", "抖音下架、其他媒体上架"}) { |
|
|
|
tmp.VideoType = "kuaishou" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
commAdd(uniqueId, tmp) |
|
|
|
tmp.VideoType = "douyin" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
commAdd(uniqueId, tmp) |
|
|
|
tmp.IsClose = 0 |
|
|
|
if utils.InArr(line[4], []string{"上架", "微信小程序下架", "乔陌漓,颜汐落", "抖音下架", "抖音下架、其他媒体上架"}) == false { |
|
|
|
tmp.IsClose = 1 |
|
|
|
} |
|
|
|
tmp.VideoType = "kuaishou" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
commAdd(uniqueId, tmp) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@@ -221,7 +238,7 @@ func FileSecond(c *gin.Context) { |
|
|
|
defer file.Close() |
|
|
|
reader := csv.NewReader(bufio.NewReader(file)) |
|
|
|
i := 0 |
|
|
|
day := 10 |
|
|
|
day := 12 |
|
|
|
for { |
|
|
|
|
|
|
|
line, err := reader.Read() |
|
|
@@ -229,10 +246,7 @@ func FileSecond(c *gin.Context) { |
|
|
|
c.String(400, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
if len(line) < 4 { |
|
|
|
continue |
|
|
|
} |
|
|
|
if line[3] == "剧集ID" || line[3] == "" { |
|
|
|
if i == 0 { |
|
|
|
i++ |
|
|
|
continue |
|
|
|
} |
|
|
@@ -241,10 +255,18 @@ func FileSecond(c *gin.Context) { |
|
|
|
t := time.Now() |
|
|
|
var tmp md.TpdarenNew |
|
|
|
material := "" |
|
|
|
if strings.Contains(line[6], " 提取码") == false { |
|
|
|
material = line[6] |
|
|
|
tqm := line[7] |
|
|
|
Description := line[8] |
|
|
|
Episode := line[11] |
|
|
|
Cate := line[9] |
|
|
|
ImageUrl := line[14] |
|
|
|
PayEpisode := line[12] |
|
|
|
Title := line[4] |
|
|
|
Id := line[3] |
|
|
|
if strings.Contains(tqm, " 提取码") == false { |
|
|
|
material = tqm |
|
|
|
} else { |
|
|
|
ex := strings.Split(line[6], " 提取码") |
|
|
|
ex := strings.Split(tqm, " 提取码") |
|
|
|
material = ex[0] |
|
|
|
if strings.Contains(material, "?pwd=") == false { |
|
|
|
material += "?pwd=" + ex[1] |
|
|
@@ -253,34 +275,35 @@ func FileSecond(c *gin.Context) { |
|
|
|
material = strings.ReplaceAll(material, "链接:", "") |
|
|
|
|
|
|
|
tmp = md.TpdarenNew{ |
|
|
|
Description: line[7], |
|
|
|
Episode: utils.StrToInt(line[11]), |
|
|
|
Cate: line[8], |
|
|
|
ImageUrl: line[14], |
|
|
|
Description: Description, |
|
|
|
Episode: utils.StrToInt(Episode), |
|
|
|
Cate: Cate, |
|
|
|
ImageUrl: ImageUrl, |
|
|
|
IsEnd: 0, |
|
|
|
PayEpisode: utils.StrToInt(line[12]), |
|
|
|
PayEpisode: utils.StrToInt(PayEpisode), |
|
|
|
Material: material, |
|
|
|
OnlineTime: time.Date(t.Year(), time.Month(day), 1, 0, 0, 0, 0, t.Location()).Format("2006-01-02 15:04:05"), |
|
|
|
Type: "dianzhong", |
|
|
|
Title: line[4], |
|
|
|
Title: Title, |
|
|
|
Data: utils.SerializeStr(line), |
|
|
|
DouyinTheaterId: 1, |
|
|
|
KuaishouTheaterId: 2, |
|
|
|
UpdateTime: int(time.Now().Unix()) - i*10, |
|
|
|
Time: int(time.Date(t.Year(), time.Month(day), 1, 0, 0, 0, 0, t.Location()).Unix()), |
|
|
|
Appid: "31517", |
|
|
|
Id: line[3], |
|
|
|
Id: Id, |
|
|
|
IsClose: 0, |
|
|
|
} |
|
|
|
i++ |
|
|
|
var uniqueId = "" |
|
|
|
|
|
|
|
tmp.VideoType = "douyin" |
|
|
|
tmp.VideoType = "kuaishou" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
fmt.Println(uniqueId) |
|
|
|
commAdd(uniqueId, tmp) |
|
|
|
|
|
|
|
tmp.VideoType = "kuaishou" |
|
|
|
tmp.VideoType = "douyin" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
fmt.Println(uniqueId) |
|
|
|
commAdd(uniqueId, tmp) |
|
|
|
} |
|
|
|
|
|
|
@@ -317,13 +340,13 @@ func FileDown(c *gin.Context) { |
|
|
|
|
|
|
|
i++ |
|
|
|
var uniqueId = "" |
|
|
|
if utils.InArr(line[3], []string{"快手下架", "版权到期", "全平台下架", "版权到期,全平台下架", "只能H5用"}) { |
|
|
|
if utils.InArr(line[3], []string{"快手下架", "版权到期", "全媒体下架", "全平台下架", "版权到期,全平台下架", "只能H5用"}) { |
|
|
|
tmp.VideoType = "kuaishou" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|
fmt.Println(uniqueId) |
|
|
|
commDown(uniqueId, tmp) |
|
|
|
} |
|
|
|
if utils.InArr(line[3], []string{"抖音下架", "版权到期", "全平台下架", "版权到期,全平台下架", "只能H5用", "抖音/微信下架"}) { |
|
|
|
if utils.InArr(line[3], []string{"抖音下架", "版权到期", "全媒体下架", "全平台下架", "版权到期,全平台下架", "只能H5用", "抖音/微信下架"}) { |
|
|
|
|
|
|
|
tmp.VideoType = "douyin" |
|
|
|
uniqueId = php2go.Md5(tmp.Appid + "_" + tmp.Type + "_" + tmp.VideoType + "_" + tmp.Id) |
|
|
|