rich media: oembed: return data in the same format as the other parsers

This commit is contained in:
William Pitcock 2019-01-28 21:07:36 +00:00
commit 61d6715714
2 changed files with 25 additions and 22 deletions

View file

@ -22,6 +22,10 @@ defmodule Pleroma.Web.RichMedia.Parsers.OEmbed do
defp get_oembed_data(url) do
{:ok, %Tesla.Env{body: json}} = Pleroma.HTTP.get(url)
{:ok, Poison.decode!(json)}
{:ok, data} = Jason.decode(json)
data = data |> Map.new(fn {k, v} -> {String.to_atom(k), v} end)
{:ok, data}
end
end