nk9 / get_dropbox_link

Code to get the URL of a file in the Dropbox folder
MIT License
7 stars 1 forks source link

Support Dropbox /scl/ type links #11

Open porg opened 1 year ago

porg commented 1 year ago

A link which I created just one week ago

https://www.dropbox.com/s/f7oy7f3ydh0kpyo/WordPress-Greenshift-v6-4-3-Breakpoint-Desktop-is-normal.png?raw=1

A link which I created today

https://www.dropbox.com/scl/fi/uvcdieskhipwbmernql8h/WordPress-Greenshift-Grid-item-order-New-UI.png?raw=1

Related News

https://www.dropboxforum.com/t5/Create-upload-and-share/Shared-Link-quot-scl-quot-to-quot-s-quot/td-p/689070

Proposal / Request

In face of those Dropbox API upgrade, could you please make the generated links to work as the old links?

porg commented 1 year ago

Some personal note

porg commented 1 year ago

Your script:

Workaround for now:

nk9 commented 1 year ago

Huh, thanks for alerting me to this. It's strange that the API is returning the wrong links, I wonder if Dropbox is aware of this. Anyway, I can have a look.

porg commented 1 year ago
nk9 commented 1 year ago

Hmm. It's true that if you use the --query argument to manipulate the returned query, it will just overwrite what was there before. I've pushed a code change to address that issue, which will be important now that the rlkey= query argument will be required.

However, that may not be the problem in this particular case. For me, anyway, when I fetch links, I'm not getting the /scl version, so there is no rlkey. They work, though. I guess I can check if they are still wokring later, but if they aren't it seems like that's likely to be a Dropbox API issue, not anything with this script.

Thanks for the link to the Forum post, it points to this other post. Still a bit confused , TBH. That second post gives details about what types of links are being generated in the new vs old style, and when. Although it sounds like, at least as of a month ago, the rollout had been paused.

porg commented 1 year ago

For me, anyway, when I fetch links, I'm not getting the /scl version, so there is no rlkey.

1) Old files and their links remained untouched.

nk9 commented 1 year ago

Good points, thanks. I tried on a new file, but same old link style. So I may not be part of the rollout. LMK if you learn any more.

porg commented 1 year ago

"Dry swimming" exercise:

porg commented 1 year ago

Btw, I was one of the very early users of Dropbox, maybe a criteria which got me included.

porg commented 1 year ago

From what I learned meanwhile I propose the following for get_dropbox_link.

From what's officially summarized here

Then on top of that apply the preference from #3.

Dropbox "New Link" Base Formats

link-new-preview

https://www.dropbox.com/scl/fi/<identifier>/filename.png?rlkey=<content-key>&dl=0

link-new-download

https://www.dropbox.com/scl/fi/<identifier>/filename.png?rlkey=<content-key>&dl=1

link-new-raw-redirect

https://www.dropbox.com/scl/fi/<identifier>/filename.png?rlkey=<content-key>&raw=1

link-new-raw-direct

https://dl.dropboxusercontent.com/scl/fi//filename.png?rlkey=

porg commented 1 year ago

Aditionally I asked Dropbox to offer a rlkey-free URL pattern for files located in the special location ~/Dropbox/Public/ which should continue to get read:everybody as their default "hassle-free easygoing permission":

https://dropbox.com/scl/fi/<flag>/<identifier>/file-within-dropbox-public.png where flag could be: n (normal) | dl | raw.

I very much hope they keep the possibility for a laissez fair link type.

nk9 commented 1 year ago

OK, you can now amend the arguments without overwriting the rlkey. I've also moved the APP_KEY and ACCOUNT_TYPE variables into the config file to simplify upgrading. This should be working now, but you'll have to let me know since I still can't create rlkey links yet.

porg commented 1 year ago

News: Dropbox has totally rolled back the /scl/ link type

porg commented 1 year ago

Dropbox Base Formats

link-preview

https://www.dropbox.com/s/<identifier>/filename.png

link-download-argument

https://www.dropbox.com/s/<identifier>/filename.png?&dl=1

link-download-subdomain

https://dl.dropbox.com/s/<identifier>/filename.png

link-raw-redirect

https://www.dropbox.com/s/<identifier>/filename.png?&raw=1

link-raw-direct

https://dl.dropboxusercontent.com/s/<identifier>/filename.png>

porg commented 1 year ago

Issue: Kept "open" until having a confirmed test - Reports welcome

porg commented 1 year ago

The other proposals raised in the comments above are now a standalone followup issue: