From a66f19cc5d14759bdb0da259887e2b9fdaf7195e Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 18 Jan 2022 12:52:01 +0100 Subject: [PATCH] Fix fetching details from Twitter Due to 429 error. Details: https://github.com/flusio/flusio/commit/e6dc2ca5f286eb08c488ae9e96976fbdf80795fc Signed-off-by: Thomas Citharel --- lib/service/rich_media/parser.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/service/rich_media/parser.ex b/lib/service/rich_media/parser.ex index ae735901..19196527 100644 --- a/lib/service/rich_media/parser.ex +++ b/lib/service/rich_media/parser.ex @@ -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