Fix fetching details from Twitter

Due to 429 error. Details: e6dc2ca5f2

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-01-18 12:52:01 +01:00
parent c57d192abe
commit a66f19cc5d
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -308,11 +308,11 @@ defmodule Mobilizon.Service.RichMedia.Parser do
# Twitter requires a well-know crawler user-agent to show server-rendered data
defp default_user_agent("https://twitter.com/" <> _) do
"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
Config.instance_user_agent() <> " (compatible; bot)"
end
defp default_user_agent("https://mobile.twitter.com/" <> _) do
"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
Config.instance_user_agent() <> " (compatible; bot)"
end
defp default_user_agent(_url) do