Fix photo

This commit is contained in:
Alexander Sheiko 2020-09-19 11:30:05 +03:00
parent 7c415c4373
commit ae913c7d88

View file

@ -170,8 +170,8 @@ func readTweetsFromHTML(htm *strings.Reader) ([]*Tweet, error) {
} }
}) })
s.Find(".NaturalImage-image").Each(func(i int, p *goquery.Selection) { s.Find(".NaturalImage-image").Each(func(i int, p *goquery.Selection) {
if link, ok := p.Attr("src"); ok { if link, ok := p.Attr("data-image"); ok {
tweet.Photos = append(tweet.Photos, link) tweet.Photos = append(tweet.Photos, link+"?format=jpg&name=large")
} }
}) })
// s.Find(".PlayableMedia-player").Each(func(i int, v *goquery.Selection) { // s.Find(".PlayableMedia-player").Each(func(i int, v *goquery.Selection) {