Add "Bot" to User Agent to coerce Twitter into serving OGP <meta> tags.
This commit is contained in:
parent
4b53499bdc
commit
18438a9bf0
2 changed files with 5 additions and 1 deletions
|
|
@ -86,7 +86,10 @@ defmodule Pleroma.Web.RichMedia.Parser do
|
|||
end
|
||||
|
||||
try do
|
||||
{:ok, %Tesla.Env{body: html}} = Pleroma.HTTP.get(url, [], adapter: opts)
|
||||
rich_media_agent = Pleroma.Application.user_agent() <> "; Bot"
|
||||
|
||||
{:ok, %Tesla.Env{body: html}} =
|
||||
Pleroma.HTTP.get(url, [{"user-agent", rich_media_agent}], adapter: opts)
|
||||
|
||||
html
|
||||
|> parse_html()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue