How do I download files from a large dropbox folder?

Issue

I want to download each/individual files from a large dropbox folder.

I usually download dropbox folder using wget option and following the link to the folder and append ?dl=1.

However, now I have a folder that is large (more than 20GB) and this method does not work.

Is there any method using which I can list the individual files and download them?

Solution

I saved the dropbox folder from browser as an HMTL file and then used an HTML parser in python to produce an sh file that allowed me to download the whole folder. Here is the python script:

from pyquery import PyQuery as pq

d = pq(filename='dropbox_page.html')

K = d('.sl-link')
N = len(K)

shfile = open("fdn.sh", "w")

for i in range(N):
    link = K.eq(i).attr('href')
    Nl = len(link)
    link = link[:Nl-1] + '1'
    for j in range(Nl-1,-1,-1):
        if link[j] == '/':
            k = j;
            break

    shfile.write('wget ' + link +'\n')
    shfile.write('mv ' + link[k+1:] + ' ' + link[k+1:Nl-5] +'\n')

shfile.close()

Then in terminal

sh fdn.sh

Thanks everyone.

Answered By – ponir

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published