Home > bash, python > Get the public Dropbox links of several files

Get the public Dropbox links of several files

Problem

When you install Dropbox, you get a Public directory. It has the advantage that if you put a file in it, you can get a public http:// link on it, thus sharing files with your friends is very easy. To get the public link, just navigate to the file in Nautilus, right click on the file, then Dropbox -> Copy Public Link.

However, if you want to share several files, getting their public links via Nautilus can be a PITA. How to get the public links for all the files in the current directory?

Solution

I made a simple Python script for this task. It can show the public link of (1) one file, or (2) all files in the current directory.

Usage:

$ get_public_link share.zip
http://dl.dropbox.com/u/XXXXXX/share.zip
$ get_public_link -a
http://dl.dropbox.com/u/XXXXXX/share/movie.r01
http://dl.dropbox.com/u/XXXXXX/share/movie.r02
http://dl.dropbox.com/u/XXXXXX/share/movie.rar

If you want to copy the links to the clipboard, combine it with my tocb script:

$ get_public_link share.zip | tocb

Download

The script (together with tocb.py) is available here, in the dropbox/ folder.

About these ads
Categories: bash, python Tags: ,
  1. iain.mckeand@gmail.com
    June 1, 2011 at 04:11

    Hi
    Thanks for the great little script. I am a Kubuntu user and the Public links right mouse click does not work for Dolphin. This script solves the problem beautifully and now I can get the public links without going to the Dropbox website.
    Many thanks

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 78 other followers

%d bloggers like this: