Fix #4262: Exception when using Twitter video image links.

This commit is contained in:
evazion
2020-01-15 15:20:33 -06:00
parent 617e1ca98a
commit e42881fbbf
2 changed files with 9 additions and 2 deletions

View File

@@ -80,8 +80,10 @@ module Sources::Strategies
end
def preview_urls
image_urls.map do |x|
x.sub(%r!\.(jpg|jpeg|png|gif)(?::orig)?\z!i, '.\1:small')
return image_urls if api_response.blank?
api_response.dig(:extended_entities, :media).to_a.map do |media|
media[:media_url_https] + ":small"
end
end