Fix rich media parsers

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-05-03 14:52:37 +02:00
parent 46120b16b6
commit 5b36e71581
5 changed files with 39 additions and 17 deletions

View File

@@ -32,7 +32,9 @@ defmodule Mobilizon.Service.RichMedia.Parsers.OEmbed do
end
defp get_discovery_data(html) do
html |> Floki.find("link[type='application/json+oembed']")
with {:ok, document} <- Floki.parse_document(html) do
Floki.find(document, "link[type='application/json+oembed']")
end
end
defp get_oembed_url(nodes) do