snacktory icon indicating copy to clipboard operation
snacktory copied to clipboard

wrong imageUrl in youtube url's

Open mufumbo opened this issue 8 years ago • 2 comments

This happens whenever you fetch an Youtube link like: https://www.youtube.com/watch?v=1a6KjDmHbR4

Instead of using the "og:image" from the head, it's setting the imageUrl as the first image in the

, so in the provided example url, it's getting "https://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" instead of the og:image that is the correct one: "https://i.ytimg.com/vi/1a6KjDmHbR4/maxresdefault.jpg"

Is there a work around this?

mufumbo avatar Sep 02 '16 15:09 mufumbo

Not that I know. You would have to look in the sources and provide a pull request for this.

karussell avatar Sep 02 '16 16:09 karussell

@karussell snacktory picks blindly the first <img of the page as the the page imageUrl.

A better approach would probably be to use the provided "og:image" instead.

Not sure I would be able to dig into the code to fix this, but I definitely miss the actual HTML result to be available on the "HtmlFetcher" class, so I could quickly hack a fix to get the og:image using Jsoup.

mufumbo avatar Sep 13 '16 10:09 mufumbo