FIX: Dropbox videos were not loading

FIX: Dropbox videos were not loading

diff --git a/lib/onebox/engine/image_onebox.rb b/lib/onebox/engine/image_onebox.rb
index 2d169f6..5be1ec4 100644
--- a/lib/onebox/engine/image_onebox.rb
+++ b/lib/onebox/engine/image_onebox.rb
@@ -18,7 +18,6 @@ module Onebox
         end
 
         escaped_url = ::Onebox::Helpers.normalize_url_for_output(@url)
-
         <<-HTML
           <a href="#{escaped_url}" target="_blank" class="onebox">
             <img src="#{escaped_url}">
diff --git a/lib/onebox/engine/video_onebox.rb b/lib/onebox/engine/video_onebox.rb
index c217f12..e22904f 100644
--- a/lib/onebox/engine/video_onebox.rb
+++ b/lib/onebox/engine/video_onebox.rb
@@ -12,6 +12,11 @@ module Onebox
       end
 
       def to_html
+        # Fix Dropbox image links
+        if @url[/^https:\/\/www.dropbox.com\/s\//]
+          @url.sub!("https://www.dropbox.com", "https://dl.dropboxusercontent.com")
+        end
+
         escaped_url = ::Onebox::Helpers.normalize_url_for_output(@url)
         <<-HTML
           <div class="onebox video-onebox">

GitHub sha: 07eba87d

1 Like

This commit has been mentioned on Discourse Meta. There might be relevant details there: