diff options
| -rw-r--r-- | ytparser.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ytparser.go b/ytparser.go index 7da87f1..dc6f986 100644 --- a/ytparser.go +++ b/ytparser.go @@ -25,6 +25,7 @@ type Item struct { Title string Url string // The url of the video ThumbUrl string // The thumbnail url + ChannelId string ChannelTitle string ChannelUrl string Published string // The published date provided by youtube as is. @@ -130,6 +131,14 @@ func parsejson(data string) ([]Item, error) { names[depth-1] == "simpleText" { item.Published = t } + if depth >= 5 && + names[depth-5] == "longBylineText" && + names[depth-4] == "runs" && + names[depth-3] == "navigationEndpoint" && + names[depth-2] == "browseEndpoint" && + names[depth-1] == "browseId" { + item.ChannelId = t + } isValue = false } } |
