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 committed by tykayn
parent cb1e348665
commit 77945c8236

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 # Twitter requires a well-know crawler user-agent to show server-rendered data
defp default_user_agent("https://twitter.com/" <> _) do 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 end
defp default_user_agent("https://mobile.twitter.com/" <> _) do 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 end
defp default_user_agent(_url) do defp default_user_agent(_url) do