Remove Dropbox Onebox For Audio Links

Hi All,

The Dropbox Onebox works great generally - the pretty box with the folder/file name etc … but with some individual files (like mp3 etc) it attempts to ‘play’ the file with the inbuilt audio player.

https://www.dropbox.com/s/5n413v2420pgslc/James%20and%20Ric%202017.mp3?dl=0

Becomes

Now, Dropbox kind of doesn’t allow that kind of off-site streaming thing - it prefers you to land on their page and play it with their audio player.

  • Is there a way to remove the onebox formatting on a link?
  • Or, can the media player not attempt to play files from the Dropbox (and probably other cloud formats?) domain(s)
5 Likes

https://www.dropbox.com/s/5n413v2420pgslc/James%20and%20Ric%202017.mp3?dl=1

dl=1 works.

It’s a very strange quirky at Dropbox side, they should use the imgur convention (with file externsion is hotlinking and without a html page).

8 Likes

Odd - good tip for now … I’ll try to edit posts to dl=1.

I guess they are all going to have different conventions.

3 Likes

I know I’m zombie’ing an old thread… but uh, latest everything here in Big Sur… and these dropbox URLs no longer play in Safari. *sigh* . . .

1 Like

Maybe it’s because the files got removed? I got some new ones in my Dropbox so we can test:

5 Likes

@Falco that audio file in your reply, when I click play the loading spinner just, spins.

If I grab the address…

it’s

https://www.dropbox.com/s/yerjh0ddm6rjs21/Wakka%20Wakka.mp3?dl=1
1 Like

It does work fine on both my desktop and phone, but I can see how the multiple redirects can break it easily. I’d recommend anyone to upload those files directly to Discourse.

2 Likes

oh! good point…

HTTP/2 301 cache-control: no-cache,no-cache, no-store content-security-policy: sandbox content-type: text/html; charset=utf-8 date: Tue, 02 Mar 2021 16:17:05 GMT location: /s/dl/yerjh0ddm6rjs21/Wakka%20Wakka.mp3 pragma: no-cache referrer-policy: strict-origin-when-cross-origin server: envoy set-cookie: locale=en; Domain=dropbox.com; expires=Sun, 01 Mar 2026 16:17:05 GMT; Path=/; secure set-cookie: gvc=OTUwNzQ0Mzc3NzU2NjkxODM4OTE4NDk0MDgxMjAwNjgxMDIxMA%3D%3D; expires=Sun, 01 Mar 2026 16:17:05 GMT; httponly; Path=/; secure set-cookie: flash=; Domain=dropbox.com; expires=Tue, 02 Mar 2021 16:17:05 GMT; Path=/; secure set-cookie: puc=; expires=Tue, 02 Mar 2021 16:17:05 GMT; httponly; Path=/; secure set-cookie: bang=; Domain=dropbox.com; expires=Tue, 02 Mar 2021 16:17:05 GMT; Path=/; secure set-cookie: t=A0zo8e5fjm3PXvoUm3_M8Ore; Domain=dropbox.com; expires=Fri, 01 Mar 2024 16:17:05 GMT; httponly; Path=/; secure set-cookie: __Host-js_csrf=A0zo8e5fjm3PXvoUm3_M8Ore; expires=Fri, 01 Mar 2024 16:17:05 GMT; Path=/; secure x-content-type-options: nosniff x-frame-options: DENY x-permitted-cross-domain-policies: none x-robots-tag: noindex, nofollow, noimageindex x-xss-protection: 1; mode=block strict-transport-security: max-age=31536000; includeSubDomains strict-transport-security: max-age=31536000; includeSubDomains vary: Accept-Encoding x-dropbox-response-origin: far_remote x-dropbox-request-id: 014773fffd9744368958f7bd03e74ae3

tells me DB would prefer we use (for the file you shared above, dropping a dl=1 URL into your replly) …

https://www.dropbox.com/s/dl/yerjh0ddm6rjs21/Wakka%20Wakka.mp3

which just redirects again…

HTTP/2 302 cache-control: no-cache,no-cache, no-store content-security-policy: sandbox content-type: text/html; charset=utf-8 date: Tue, 02 Mar 2021 16:18:51 GMT location: https://uc210b381124f7e2c595f0144180.dl.dropboxusercontent.com/cd/0/get/BJ5026I61AGfxjUZw4UAy6BoWHpQbSEN0gROgXEQDAhej5g_ws5PGpMKoAWm2TFZ78wPD3W3jnOfiuXDCymHTnohQYszoTuUH5QxZXpRt3Ebjgzx5kywk-ucuWZRdlX1RC0/file?dl=1# pragma: no-cache referrer-policy: strict-origin-when-cross-origin server: envoy set-cookie: locale=en; Domain=dropbox.com; expires=Sun, 01 Mar 2026 16:18:51 GMT; Path=/; secure set-cookie: gvc=NjAxMjA0ODM0MjU5NzUxOTc0NzM5NTA4Mzk1NTUxODQ1NTYxMzI%3D; expires=Sun, 01 Mar 2026 16:18:51 GMT; httponly; Path=/; secure set-cookie: flash=; Domain=dropbox.com; expires=Tue, 02 Mar 2021 16:18:51 GMT; Path=/; secure set-cookie: puc=; expires=Tue, 02 Mar 2021 16:18:51 GMT; httponly; Path=/; secure set-cookie: bang=; Domain=dropbox.com; expires=Tue, 02 Mar 2021 16:18:51 GMT; Path=/; secure set-cookie: t=h92aZNHZPxQ0OvaeouTFBVK-; Domain=dropbox.com; expires=Fri, 01 Mar 2024 16:18:51 GMT; httponly; Path=/; secure set-cookie: __Host-js_csrf=h92aZNHZPxQ0OvaeouTFBVK-; expires=Fri, 01 Mar 2024 16:18:51 GMT; Path=/; secure x-content-type-options: nosniff x-frame-options: DENY x-permitted-cross-domain-policies: none x-xss-protection: 1; mode=block strict-transport-security: max-age=31536000; includeSubDomains strict-transport-security: max-age=31536000; includeSubDomains vary: Accept-Encoding x-dropbox-response-origin: far_remote x-dropbox-request-id: 29b87eb2e3ef458f9490ba6f202d95af

to

https://uc210b381124f7e2c595f0144180.dl.dropboxusercontent.com/cd/0/get/BJ5026I61AGfxjUZw4UAy6BoWHpQbSEN0gROgXEQDAhej5g_ws5PGpMKoAWm2TFZ78wPD3W3jnOfiuXDCymHTnohQYszoTuUH5QxZXpRt3Ebjgzx5kywk-ucuWZRdlX1RC0/file?dl=1#

let’s see, what does that do if I drop it in here . . .

https://uc210b381124f7e2c595f0144180.dl.dropboxusercontent.com/cd/0/get/BJ5026I61AGfxjUZw4UAy6BoWHpQbSEN0gROgXEQDAhej5g_ws5PGpMKoAWm2TFZ78wPD3W3jnOfiuXDCymHTnohQYszoTuUH5QxZXpRt3Ebjgzx5kywk-ucuWZRdlX1RC0/file?dl=1#

¯\_(ツ)_/¯ yet another reason I’ll add to my list of reasons why I don’t use Dropbox

2 Likes

To be fair, Dropbox never claims to be a hotlink storage service like, for example, Imgur is.

If you will use Discourse extensively with media files like that you have plenty of alternatives:

  • Direct upload to Discourse (that can optionally be backed by an Object Storage service and shielded by a CDN)

  • Dozens of specialized services for media hosting with embeds allowed, like Youtube, Vimeo, Soundcloud, Peertube, etc.

3 Likes

Hi @craigconstantine (nice to see you) have you remembered about dropbox shares where the original dropbox share link has dl=0 at the end - if you edit this to raw=1 it should work as a player that works for most people using different OS and browsers. The details are on DB but I may be slightly missing the point about multiple redirects. Hope it helps.

https://www.dropbox.com/s/yerjh0ddm6rjs21/Wakka%20Wakka.mp3?raw=1

2 Likes

…no that’s the whole point here. It doesn’t work any more on Safari. You’re dropbox URL to the mp3, generates what looks like an audio player, but it doesn’t actually play.

1 Like

My bad - didn’t read far enough back

In Chrome on a Mac it sometimes won’t play but a hard reload (Cmd-Shift-R in Chrome) reloads the page and makes it playable. On Safari it is Shift-reload but it doesn’t make it playable.

Got it now - in Safari I see spinning, then this

Screenshot 2021-03-10 at 11.55.18

I am still on Catalina and it doesn’t work - wonder where the change has happened?

maybe we have to avoid pretty players which would be a shame - if you include the link as an inline HTML hypertext the dropbox shared link ending of dl=0 produces a new browser window and Dropbox preview and play page; dl=1 forces a download; and raw=1 produces a new browser window with a pretty player as in Discourse and starts playing. Not sure that helps but may give a useful option for you.

Hi @Falco would that need adjustment to the upload file size limit in admin? or use of an Object Storage service/CDN as you mentioned earlier?

If you plan on uploading files larger than the default limit you can increase it following Changing Max Attachment Size

If you can afford to pay for an Object Storage service and you community will be uploading large files it’s certainly the correct choice :+1:

1 Like