huangjiajun pirms 7 mēnešiem
vecāks
revīzija
d7783fc9e0
5 mainītis faili ar 349 papildinājumiem un 45 dzēšanām
  1. +211
    -40
      app/hdl/hdl_file_upload.go
  2. +25
    -0
      app/hdl/hdl_kuaishou_auth.go
  3. +3
    -0
      app/md/data.go
  4. +3
    -2
      app/router/router.go
  5. +107
    -3
      app/task/svc/svc_tik_tok_task.go

+ 211
- 40
app/hdl/hdl_file_upload.go
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 25
- 0
app/hdl/hdl_kuaishou_auth.go Parādīt failu

@@ -0,0 +1,25 @@
package hdl

import (
offical "applet/app/db/official"
"applet/app/e"
"github.com/gin-gonic/gin"
)

func KuaishouAuth(c *gin.Context) {
var args map[string]string
if err := c.ShouldBindJSON(&args); err != nil {
e.OutErr(c, 200, e.ERR_INVALID_ARGS)
return
}
kuaishouOfficialAccessToken := offical.MasterListCfgGetOneData("0", "kuaishou_official_access_token")
kuaishouOfficialAccessToken = args["access_token"]
offical.MasterListCfgSave("0", "kuaishou_official_access_token", kuaishouOfficialAccessToken)
kuaishouOfficialExpiresIn := offical.MasterListCfgGetOneData("0", "kuaishou_official_expires_in")
kuaishouOfficialExpiresIn = args["expires_in"]
offical.MasterListCfgSave("0", "kuaishou_official_expires_in", kuaishouOfficialExpiresIn)
kuaishouOfficialRefreshToken := offical.MasterListCfgGetOneData("0", "kuaishou_official_refresh_token")
kuaishouOfficialRefreshToken = args["refresh_token"]
offical.MasterListCfgSave("0", "kuaishou_official_refresh_token", kuaishouOfficialRefreshToken)
return
}

+ 3
- 0
app/md/data.go
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 3
- 2
app/router/router.go Parādīt failu

@@ -10,7 +10,7 @@ import (
"github.com/gin-gonic/gin"
)

//初始化路由
// 初始化路由
func Init() *gin.Engine {
// debug, release, test 项目阶段
mode := "release"
@@ -63,12 +63,13 @@ func routeInternal(r *gin.RouterGroup) {
}
}
func routeZhimeng(r *gin.RouterGroup) {
r.POST("kuaishou/auth", hdl.KuaishouAuth)
r.GET("/test", hdl.Order)
r.GET("/cinema", hdl.Cinema)
r.GET("/task", hdl.TikTokTask)

r.POST("/bihai_file_new", hdl.BihaiFile)
r.GET("/bihai_add", hdl.BihaiAdd)
r.GET("/bihai_add", hdl.BihaiAdds)
r.GET("/bihai_story_add", hdl.BihaiStoryAdd)
r.GET("/beiwo_story_add", hdl.BeiwoStoryAdd)
r.GET("/kujiang_add", hdl.KujiangAdd)


+ 107
- 3
app/task/svc/svc_tik_tok_task.go Parādīt failu

@@ -4,6 +4,7 @@ import (
"applet/app/cfg"
offical "applet/app/db/official"
md2 "applet/app/es/md"
md3 "applet/app/md"
"applet/app/task/md"
"applet/app/utils"
"applet/app/utils/cache"
@@ -55,6 +56,81 @@ func TikTokTask() {
}
}
func GetTaskDetail(appId string, tmp []int64) {
data := md3.KujiangData
var kujiang []md.KuJiang
json.Unmarshal([]byte(data), &kujiang)
kujiangMap := make(map[string]md.KuJiang)
for _, v := range kujiang {
kujiangMap[utils.IntToStr(v.BookId)] = v
}
xinghes := map[string]string{
"7367316323904372772": "https://pan.baidu.com/s/1kf58ZCgI0BgCLQapMfrTbQ?pwd=cceg",
"7367710375317520399": "https://pan.baidu.com/s/1aEaDUhSM-4VDTxn40wXm3A?pwd=6e8b",
"7368329261691961371": "https://pan.baidu.com/s/171ZRDKRRU3aP7ZMBDy0vsQ?pwd=sipq",
"7366906746314555404": "https://pan.baidu.com/s/1MNfbPba3Nt2pTnHTfBUEBA?pwd=ew3v",
"7366102746245726248": "https://pan.baidu.com/s/1WzXSrkemz0Hm0DTNcmTpxA?pwd=y2j0",
"7365004815451062312": "https://pan.baidu.com/s/1q2XYO3GraSEvdX2F3JcX4Q?pwd=glby",
"7363157598629068819": "https://pan.baidu.com/s/1NPtnl5EBK7jRRgk7kSStPg?pwd=86p6",
"7362021099053383714": "https://pan.baidu.com/s/19mqfaAt5zovNO1sb0e-bxw?pwd=qae9",
"7361659856501129279": "https://pan.baidu.com/s/1XtOabN5ZGsxG9x_CjF2Aig?pwd=ztet",
"7361209400553521167": "https://pan.baidu.com/s/10BSo8P9wcxgYa-Li3dUiGA?pwd=6vlf",
"7360937011936510006": "https://pan.baidu.com/s/1WlN5HLmcaADy0jGdiCaGFQ?pwd=tiwb",
"7358322670871576616": "https://pan.baidu.com/s/13RET87iAbgZlj-jn5mUwUg?pwd=y9rd",
"7357194974695391268": "https://pan.baidu.com/s/1cBU9PIXW99Y5W1XhvdPIpA?pwd=uxc6",
"7356840659325583414": "https://pan.baidu.com/s/1znMbDDAnIRQ7PwtiznOvTQ?pwd=9nj7",
"7356392523553636364": "https://pan.baidu.com/s/17YWBPOVbIi1QR-uKAAJEvQ?pwd=pph1",
"7355357328834658319": "https://pan.baidu.com/s/1uoDFjFm9iWt5eXGCYwx0Sg?pwd=9i8p",
"7353386971026309183": "https://pan.baidu.com/s/1LCgvkFblrE43e4JtxSOR4Q?pwd=svb5",
"7350898126372323369": "https://pan.baidu.com/s/1P6E4vYl-2x0s_qw1X5oviQ?pwd=84xz",
"7350859162219184139": "https://pan.baidu.com/s/1mUHucK0x5af8G40hJbLzqw?pwd=0dh1",
"7349282971213512754": "https://pan.baidu.com/s/18QgGyqjzW7aImhQ8a2_SJQ?pwd=aswx",
"7348970835950043147": "https://pan.baidu.com/s/1JEL9kvkrvzcZUKwexlhPhw?pwd=gadt",
"7348684759972724745": "https://pan.baidu.com/s/1sqnsG74rqE8vKVz4-mibgw?pwd=q7us",
"7348649376765460531": "https://pan.baidu.com/s/18AIW_J7XHGZFbEsa4zbEZw?pwd=akgy",
"7348320058776502322": "https://pan.baidu.com/s/1RImOhdsbwT-d58U8x9Cl7g?pwd=5oy1",
"7348220904138227746": "https://pan.baidu.com/s/1WL1ZCM5w9opVJRHq2_tQkg?pwd=08gs",
"7347939532555304972": "https://pan.baidu.com/s/1A3vmJaRPU9YFmNZje9ttDw?pwd=2vjp",
"7347576656296443941": "https://pan.baidu.com/s/106MDSCSM7BCTx_1kex65gA?pwd=t1gm",
"7346064108011257897": "https://pan.baidu.com/s/1NY7JuB-2KUlvtbKZqI7vew?pwd=kpt4",
"7345229086283055156": "https://pan.baidu.com/s/1mkkF_bhOh3E7sZf6ymIv0g?pwd=zl3m",
"7344970667663589410": "https://pan.baidu.com/s/17e5bb0dGQ183zHWkO49cmg?pwd=l193",
"7343744932248600616": "https://pan.baidu.com/s/1vL1g1aGhgXMtNEah4TQFxw?pwd=ub0r",
"7342692698744193063": "https://pan.baidu.com/s/1MOaSBkuHGzvv9n1GPc-B3Q?pwd=69fg",
"7340706698497212455": "https://pan.baidu.com/s/1vB8aG2U3kserxWsm3bR1Zg?pwd=qszf",
"7340019974860914715": "https://pan.baidu.com/s/1bykE9LVcNCePutJ4Rmz14A?pwd=dvrx",
"7338982451538133026": "https://pan.baidu.com/s/10GqBT2oBHTdIrtLvm7C3Mg?pwd=203x",
"7336393071648587816": "https://pan.baidu.com/s/1Zl0zxZg3dcTuGsge8pD-SA?pwd=este",
"7335313319047315456": "https://pan.baidu.com/s/1QQZQlgy-WN9hXKjSe59smg?pwd=klno",
"7334158528300482571": "https://pan.baidu.com/s/1DuWh9nZwec3uTAoqwLzIEA?pwd=qs0v",
"7333417334876454949": "https://pan.baidu.com/s/1l5FvB35F9YPnwllSpYPvSA?pwd=ogdy",
"7333416896286507044": "https://pan.baidu.com/s/1S2E0DXe1w6z5kU5r9fGGoQ?pwd=k0br",
"7332303743809011739": "https://pan.baidu.com/s/1S4I4smzV8I3-jytmua1kLg?pwd=2zhv",
"7331643707597864997": "https://pan.baidu.com/s/1WWMY8bWnNLSxCaD0x_Gv0Q?pwd=scm5",
"7331637776204480575": "https://pan.baidu.com/s/1PAYJUrYhZ71XivTZFSxw5Q?pwd=v1n7",
"7330834016368623657": "https://pan.baidu.com/s/1yB46HJtIjjffc0w8RmeRTQ?pwd=x1v3",
"7330529933564919823": "https://pan.baidu.com/s/1PzKUtgetU8bVTILFYxSrNQ?pwd=ul4a",
"7330518079224512550": "https://pan.baidu.com/s/1I1o9UV89oYCVmzJc5bCe1g?pwd=5nxe",
"7327911477510209548": "https://pan.baidu.com/s/1ebMtvlMV2UCCvTOx7znFsA?pwd=d00o",
"7326049857058177024": "https://pan.baidu.com/s/1WtKwzdeiPQz0AjKzieU_6w?pwd=prkh",
"7324972262531153959": "https://pan.baidu.com/s/1qZCfNogUvYWWlkJ225qNQQ?pwd=l0ui",
"7324518583126753314": "https://pan.baidu.com/s/1yf7X6iI6bPYcJNLKTdd8QQ?pwd=kyvc",
"7324525415568015411": "https://pan.baidu.com/s/1ZxrZMbySTtMX_5F0eW24Aw?pwd=2hht",
"7324518767126429734": "https://pan.baidu.com/s/1J7CJYI76-I-9APIq1pzE5A?pwd=ai6t",
"7324518642941476905": "https://pan.baidu.com/s/1t3tcaGhCjsTwRSTXQJ4_-g?pwd=s9d9",
"7324518215852228644": "https://pan.baidu.com/s/1w7qG9kSfpZD1hCohnU8vUQ?pwd=0a3w",
"7324510965024751650": "https://pan.baidu.com/s/1bzzIqBftk030n8ZRddnnRA?pwd=6k6e",
"7320876050387353611": "https://pan.baidu.com/s/1Y6oe-upHqA72ivDp4MWBUA?pwd=04th",
"7318971545959170058": "https://pan.baidu.com/s/1jEOgXAR7e5Oqd3KZ2e1zyg?pwd=wvb9",
"7313727507914686476": "https://pan.baidu.com/s/1awg3uiLk5t1EJPGiUXhxyQ?pwd=ppwu",
"7313751212422201379": "https://pan.baidu.com/s/1awg3uiLk5t1EJPGiUXhxyQ?pwd=ppwu",
"7312337908660437004": "https://pan.baidu.com/s/1Q-6nsaWTmj3UWCdSdOQErw?pwd=4sl3",
"7312292128947257383": "https://pan.baidu.com/s/1D71HmPOWkAeBmVk9ujU8dQ?pwd=ta3n",
"7312294620745056267": "https://pan.baidu.com/s/1CI0fC50UWsxKLcQ4AIlUhQ?pwd=pi51",
"7312295241607790643": "https://pan.baidu.com/s/1-8w4R1ypihnHw-djYQHXcg?pwd=p5h8",
"7312292122370031670": "https://pan.baidu.com/s/1pZM-FzOQQrZjhgQ_Kn1nAQ?pwd=ryu0",
"7312291614532599843": "https://pan.baidu.com/s/16794mteTYOn6nzu8k1gIBg?pwd=xdsg",
"7312007303753957395": "https://pan.baidu.com/s/1hEyBrPTm0Rtkl1mP-1myxQ?pwd=di9v",
}
for _, v := range tmp {
time.Sleep(time.Microsecond * 1000)
param := map[string]interface{}{
@@ -86,6 +162,8 @@ func GetTaskDetail(appId string, tmp []int64) {
videoTmpStr = "cid="
} else if strings.Contains(tmpIn.StartPage, "novelid=") {
videoTmpStr = "novelid="
} else if strings.Contains(tmpIn.StartPage, "book_id=") {
videoTmpStr = "book_id="
} else if strings.Contains(tmpIn.StartPage, "video_id=") {
videoTmpStr = "video_id="
}
@@ -118,12 +196,38 @@ func GetTaskDetail(appId string, tmp []int64) {
IsHot: 0,
FirstCate: v2["type"],
SecondCate: "",
Platform: "tikTok",
Platform: "",
}
if tmpIn.TaskEndTime < int(time.Now().Unix()) {
tmp2.IsClose = 1
if v2["second_type"] == "xinghe" {
tmp2.Material = xinghes[utils.Int64ToStr(tmpIn.TaskId)]
}
uniqueId := php2go.Md5(tmp2.Appid + "_" + tmp2.Type + "_" + tmp2.FirstCate + "_" + utils.IntToStr(tmp2.Id))
if tmp2.Appid == "ttbed9c86421e54c8501" {
doc, _ := es.FirstDoc(md2.ZhiosNewVideo, uniqueId)
if tmpIn.TaskEndTime > int(time.Now().Unix()) {
tmp2.Platform = "tikTok"
}
if doc != nil && strings.Contains(gjson.Get(string(doc.Source), "platform").String(), "kuaishou") {
if tmpIn.TaskEndTime > int(time.Now().Unix()) {
tmp2.Platform = "tikTok,kuaishou"
} else {
tmp2.Platform = "kuaishou"
}
}

jiang, ok := kujiangMap[tmpIn.VideoId]
if ok {
tmp2.Material = jiang.WebDiskUrl
}
} else {
tmp2.Platform = "tikTok"
if tmpIn.TaskEndTime < int(time.Now().Unix()) {
tmp2.IsClose = 1
}
}
if tmp2.Platform == "" {
tmp2.IsClose = 1
}
fmt.Println(uniqueId)
tmp2.Key = uniqueId
commAddNew(uniqueId, tmp2)


Notiek ielāde…
Atcelt
Saglabāt