fix: stable

This commit is contained in:
eson
2020-09-17 18:55:01 +08:00
parent 9e90c80702
commit d2494a8881
7 changed files with 25 additions and 476 deletions

View File

@@ -18,7 +18,7 @@ import (
type UserInfo struct {
UserName string `exp:"//p[ contains(@class, 'c-global__user__profile__list__name__text')]"`
Followers int64 `exp:"//p[@class='c-global__user__count__row__right js-userCountFollowers']" mth:"r:ParseNumber"`
Views int64 `exp:"//ul[@class='c-contents']//p[@class='c-thumbnailVideo__footer__liveCount']" mth:"r:ExtractNumber"`
PCU int64 `exp:"//ul[@class='c-contents']//p[@class='c-thumbnailVideo__footer__liveCount']" mth:"r:ExtractNumber"`
}
//UserLive 提取信息的结构体
@@ -27,6 +27,7 @@ type UserLive struct {
LiveStartTime string `exp:"//meta[@itemprop='uploadDate']/@content"`
LiveEndTime string `exp:"//meta[@itemprop='duration']/@content"`
Tags []string `exp:"//div[contains(@class,'MovieMetaContent__TagContainer')]//a[@role ='button']"`
Views int64 `exp:"//meta[@itemprop='interactionCount']/@content"`
}
// Execute 执行
@@ -173,10 +174,7 @@ func Extractor(streamer *intimate.Streamer, userId string, htmlUser, htmlLive st
if ok1 {
clog.Followers = &sql.NullInt64{Int64: ui.Followers, Valid: true}
clog.Views = &sql.NullInt64{Int64: ui.Views, Valid: true}
if ui.Views != 0 {
clog.IsLiveStreaming = true
}
clog.PCU = &sql.NullInt64{Int64: ui.PCU, Valid: true}
streamer.UserName = &sql.NullString{String: ui.UserName, Valid: true}
// giverjson := jsonSupporters
@@ -208,6 +206,7 @@ func Extractor(streamer *intimate.Streamer, userId string, htmlUser, htmlLive st
//log.Println(ul)
if ok2 {
clog.Views = &sql.NullInt64{Int64: ul.Views, Valid: true}
clog.LiveTitle = &sql.NullString{String: ul.Title, Valid: true}
startTime, err := time.ParseInLocation("2006-01-02T15:04:05Z07:00", ul.LiveStartTime, time.Local)