Rich Media Parser failing on Twitter URLs
Realized I have Twitter URLs that aren't showing link previews in my timeline.
iex(master_769bcc98@127.0.0.1)8> Pleroma.Web.RichMedia.Parser.parse("https://twitter.com/feldpos/status/1174766565335719936")
{:error,
"Cachex error: %FunctionClauseError{args: nil, arity: 2, clauses: nil, function: :set_ttl_based_on_image, kind: nil, module: Pleroma.Web.RichMedia.Parser}"}]
Testing with a different URL:
iex(master_769bcc98@127.0.0.1)19> Pleroma.Web.RichMedia.Parser.parse("https://vimeo.com/331908835")
{:ok,
%{
"app:id:googleplay" => "com.vimeo.android.videoapp",
"app:id:ipad" => "425194759",
"app:id:iphone" => "425194759",
"app:name:googleplay" => "Vimeo",
"app:name:ipad" => "Vimeo",
"app:name:iphone" => "Vimeo",
"app:url:googleplay" => "vimeo://app.vimeo.com/videos/331908835",
"app:url:ipad" => "vimeo://app.vimeo.com/videos/331908835",
"app:url:iphone" => "vimeo://app.vimeo.com/videos/331908835",
"card" => "player",
"description" => "Bookstores have always driven me crazy. So much to read and so little time! And now with our lives chock full of content--Netlflix, podcasts, social media, and the…",
"image" => "https://i.vimeocdn.com/filter/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F777455071_1280x720.jpg&src1=https%3A%2F%2Ff.vimeocdn.com%2Fimages_v6%2Fshare%2Fplay_icon_overlay.png",
"image:height" => "720",
"image:secure_url" => "https://i.vimeocdn.com/filter/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F777455071_1280x720.jpg&src1=https%3A%2F%2Ff.vimeocdn.com%2Fimages_v6%2Fshare%2Fplay_icon_overlay.png",
"image:type" => "image/jpg",
"image:width" => "1280",
"player" => "https://player.vimeo.com/video/331908835",
"player:height" => "720",
"player:width" => "1280",
"site" => "@vimeo",
"site_name" => "Vimeo",
"title" => "BOOKSTORES: How to Read More Books in the Golden Age of Content",
"type" => "video",
"updated_time" => "2020-07-06T10:10:29-04:00",
"url" => "https://vimeo.com/331908835",
"video:height" => "720",
"video:secure_url" => "https://player.vimeo.com/video/331908835?autoplay=1",
"video:type" => "text/html",
"video:url" => "https://player.vimeo.com/video/331908835?autoplay=1",
"video:width" => "1280"
}}
Edited by feld