diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -2,7 +2,7 @@ This python script is a quick hack to download data from Globus via HTTPS and wi # Dependencies -[globus-sdk](https://pypi.org/project/globus-sdk/) is the only dependency. The easiest way is to use GNU Guix. You will need the [guix-bioinformatics channel](https://git.genenetwork.org/guix-bioinformatics/about/). +[globus-sdk](https://pypi.org/project/globus-sdk/) and requests are the only dependencies. The easiest way to obtain them is to use GNU Guix. You will need the [guix-bioinformatics channel](https://git.genenetwork.org/guix-bioinformatics/about/). ``` guix shell -m manifest.scm ``` @@ -11,18 +11,19 @@ guix shell -m manifest.scm Log in to the Globus web app, go to the `Collections` page, and find the collection you are interested in. When you click on it, you will be taken to an `Overview` page which will show the `UUID` of the collection. That is the endpoint ID. -# Authorize app and get HTTPS links for all files in your collection +# Extract cookies from browser -Run the globus-weblinks script passing in your endpoint ID. The script will prompt you for authorization. Once authorized, it will print out HTTPS links to all your files. Write the links to a file. +You will need cookies to authenticate the HTTPS download. You need to extract these cookies from a browser session. This is a somewhat cumbersome process. Here's one way to do it. In the Globus web app, download any file from your collection whilst inspecting network traffic. Copy the HTTPS request for the file by right clicking it and selecting "Copy as cURL". One of the parameters in the copied curl command should be the cookie header we need. Put it in a file `cookies.json` like so: ``` -./globus-weblinks YOUR-ENDPOINT-ID > weblinks +{ + "mod_globus_OIDC": "aloooooooooooongrandomcookiestring" +} ``` -# Download your files using wget +# Download your files -You can now download your files using `wget`. But first, you will need cookies to authenticate the download. We need to extract these cookies from a browser session. This is a somewhat cumbersome process. Here's one way to do it. In the Globus web app, download any file from your collection whilst inspecting network traffic. Copy the HTTPS request for the file by right clicking it and selecting "Copy as cURL". One of the parameters in the copied curl command should be the cookie header we need. Use it with wget like so. +Now, all that remains is to download your files. Do it like so: ``` -wget --header 'Cookie: mod_globus_OIDC=aloooooooooooongrandomcookiestring' -i weblinks +./globus-weblinks YOUR-ENDPOINT-ID cookies.json ``` - Enjoy! |