galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.35k stars 979 forks source link

Direct upload from dropbox #5330

Open bernt-matthias opened 6 years ago

bernt-matthias commented 6 years ago

Dropbox download links do not work per default since the default link generated by dropbox ends in http….?dl=0 which brings up a webpage with a download option.

One possibility to get this working the suffix could to be changed to ?dl=1 in the link.

I observed that wget downloads the file irrespective of dl=0 or dl=1. So I guess setting the user might help as well. This might be the cleaner option that could also work in other cases without the need to maintain a list of patterns and necessary replacements.

bernt-matthias commented 6 years ago

For the second option it could work like this:

import urllib2
req = urllib2.Request('http://192.168.1.2/')
req.add_header('User-agent', 'Mozilla 5.10')
res = urllib2.urlopen(req)