projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
[akkoma]
/
lib
/
pleroma
/
web
/
rich_media
/
parser.ex
diff --git
a/lib/pleroma/web/rich_media/parser.ex
b/lib/pleroma/web/rich_media/parser.ex
index 62e8fa610bbf6937877eae6c26071aea41013c6e..21cd47890abc8a17fa583241cdd8f970a91d3be4 100644
(file)
--- a/
lib/pleroma/web/rich_media/parser.ex
+++ b/
lib/pleroma/web/rich_media/parser.ex
@@
-18,7
+18,7
@@
defmodule Pleroma.Web.RichMedia.Parser do
def parse(nil), do: {:error, "No URL provided"}
def parse(nil), do: {:error, "No URL provided"}
- if
Mix.env(
) == :test do
+ if
Pleroma.Config.get(:env
) == :test do
def parse(url), do: parse_url(url)
else
def parse(url) do
def parse(url), do: parse_url(url)
else
def parse(url) do
@@
-37,7
+37,10
@@
defmodule Pleroma.Web.RichMedia.Parser do
try do
{:ok, %Tesla.Env{body: html}} = Pleroma.HTTP.get(url, [], adapter: @hackney_options)
try do
{:ok, %Tesla.Env{body: html}} = Pleroma.HTTP.get(url, [], adapter: @hackney_options)
- html |> maybe_parse() |> clean_parsed_data() |> check_parsed_data()
+ html
+ |> maybe_parse()
+ |> clean_parsed_data()
+ |> check_parsed_data()
rescue
e ->
{:error, "Parsing error: #{inspect(e)}"}
rescue
e ->
{:error, "Parsing error: #{inspect(e)}"}