From 648743f47faa2859eb9d137f32e2b41f509b3a60 Mon Sep 17 00:00:00 2001 From: Dmitry Khalansky Date: Sun, 11 Oct 2020 23:15:51 +0300 Subject: [PATCH] Fix image grids not being recognized as photos --- tweets.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tweets.go b/tweets.go index bd239aa..c8534a9 100644 --- a/tweets.go +++ b/tweets.go @@ -174,6 +174,11 @@ func readTweetsFromHTML(htm *strings.Reader) ([]*Tweet, error) { tweet.Photos = append(tweet.Photos, link+"?format=jpg&name=large") } }) + s.Find(".CroppedImage-image").Each(func(i int, p *goquery.Selection) { + if link, ok := p.Attr("data-image"); ok { + tweet.Photos = append(tweet.Photos, link+"?format=jpg&name=large") + } + }) // s.Find(".PlayableMedia-player").Each(func(i int, v *goquery.Selection) { // if style, ok := v.Attr("style"); ok { // if strings.Contains(style, "background") {