Skip to content

Commit

Permalink
Fix video files urls and paths
Browse files Browse the repository at this point in the history
  • Loading branch information
cguess committed Dec 18, 2023
1 parent 0c93286 commit f57c813
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mosquito/scrapers/tweet_scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f57c813

Please sign in to comment.