From f57c8132a003c6035797b8320253536fbb696399 Mon Sep 17 00:00:00 2001 From: Christopher Guess Date: Mon, 18 Dec 2023 13:57:32 -0500 Subject: [PATCH] Fix video files urls and paths --- lib/mosquito/scrapers/tweet_scraper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mosquito/scrapers/tweet_scraper.rb b/lib/mosquito/scrapers/tweet_scraper.rb index 44ebb3e..c68bb27 100644 --- a/lib/mosquito/scrapers/tweet_scraper.rb +++ b/lib/mosquito/scrapers/tweet_scraper.rb @@ -60,9 +60,9 @@ def parse(id) video_preview_image = Mosquito.retrieve_media("#{Capybara.app_host}#{nodes.first["poster"]}", extension: ".jpg") videos << nodes.map do |node| unless node.xpath("//source").empty? - node.xpath("//source").first["src"] + Mosquito.retrieve_media("#{Capybara.app_host}#{node.xpath("//source").first["src"]}", extension: ".mp4") else - Mosquito.retrieve_media(node.xpath("//video").first["data-url"]) + Mosquito.retrieve_media("#{Capybara.app_host}#{node.xpath("//video").first["data-url"]}", extension: ".mp4") end end video_file_type = "video" # This is always video now, sing a gif isn't displayed differently