itransferwee.py: Improve documentation - transferwee - Download/upload file via wetransfer.com Err tccr.it 70 hgit clone https://github.com/iamleot/transferwee URL:https://github.com/iamleot/transferwee tccr.it 70 1Log /r/transferwee/log.gph tccr.it 70 1Files /r/transferwee/files.gph tccr.it 70 1Refs /r/transferwee/refs.gph tccr.it 70 1README /r/transferwee/file/README.md.gph tccr.it 70 i--- Err tccr.it 70 1commit 70f63eeb899a215c897ea0a8fb7cefd3945d27c6 /r/transferwee/commit/70f63eeb899a215c897ea0a8fb7cefd3945d27c6.gph tccr.it 70 1parent 421546ff5f1b226f9088dd62b6b2d3aa5ae1ba9e /r/transferwee/commit/421546ff5f1b226f9088dd62b6b2d3aa5ae1ba9e.gph tccr.it 70 hAuthor: Leonardo Taccari URL:mailto:iamleot@gmail.com tccr.it 70 iDate: Tue, 8 May 2018 15:18:52 +0200 Err tccr.it 70 i Err tccr.it 70 itransferwee.py: Improve documentation Err tccr.it 70 i Err tccr.it 70 i - Add a description to briefly describe what transferwee does Err tccr.it 70 i - Document the type of URLs supported by download_url() Err tccr.it 70 i - Add a reference to download_url() to download() Err tccr.it 70 i Err tccr.it 70 iDiffstat: Err tccr.it 70 i M transferwee.py | 27 +++++++++++++++++++++++++-- Err tccr.it 70 i Err tccr.it 70 i1 file changed, 25 insertions(+), 2 deletions(-) Err tccr.it 70 i--- Err tccr.it 70 1diff --git a/transferwee.py b/transferwee.py /r/transferwee/file/transferwee.py.gph tccr.it 70 i@@ -28,6 +28,17 @@ Err tccr.it 70 i # Err tccr.it 70 i Err tccr.it 70 i Err tccr.it 70 i+""" Err tccr.it 70 i+Download/upload files via wetransfer.com Err tccr.it 70 i+ Err tccr.it 70 i+transferwee is a script/module to download/upload files via wetransfer.com. Err tccr.it 70 i+ Err tccr.it 70 i+It exposes `download' and `upload' subcommands, respectively used to download Err tccr.it 70 i+files from a `we.tl' or `wetransfer.com/downloads' URLs and upload files that Err tccr.it 70 i+will be shared via emails or link. Err tccr.it 70 i+""" Err tccr.it 70 i+ Err tccr.it 70 i+ Err tccr.it 70 i from typing import List Err tccr.it 70 i import os.path Err tccr.it 70 i import urllib.parse Err tccr.it 70 i@@ -56,6 +67,17 @@ def download_url(url: str) -> str: Err tccr.it 70 i redirect is followed in order to retrieve the corresponding Err tccr.it 70 i `wetransfer.com/downloads/' URL. Err tccr.it 70 i Err tccr.it 70 i+ The following type of URLs are supported: Err tccr.it 70 i+ - `https://we.tl/`: Err tccr.it 70 i+ received via link upload, via email to the sender and printed by Err tccr.it 70 i+ `upload` action Err tccr.it 70 i+ - `https://wetransfer.com//`: Err tccr.it 70 i+ directly not shared in any ways but the short URLs actually redirect to Err tccr.it 70 i+ them Err tccr.it 70 i+ - `https://wetransfer.com///`: Err tccr.it 70 i+ received via email by recipients when the files are shared via email Err tccr.it 70 i+ upload Err tccr.it 70 i+ Err tccr.it 70 i Return the download URL (AKA `direct_link') as a str. Err tccr.it 70 i """ Err tccr.it 70 i # Follow the redirect if we have a short URL Err tccr.it 70 i@@ -85,8 +107,9 @@ def download_url(url: str) -> str: Err tccr.it 70 i def download(url: str) -> None: Err tccr.it 70 i """Given a `we.tl/' or `wetransfer.com/downloads/' download it. Err tccr.it 70 i Err tccr.it 70 i- First a direct link is retrieved, the filename will be extracted to it and Err tccr.it 70 i- it will be fetched and stored on the current working directory. Err tccr.it 70 i+ First a direct link is retrieved (via download_url()), the filename will Err tccr.it 70 i+ be extracted to it and it will be fetched and stored on the current Err tccr.it 70 i+ working directory. Err tccr.it 70 i """ Err tccr.it 70 i dl_url = download_url(url) Err tccr.it 70 i file = urllib.parse.urlparse(dl_url).path.split('/')[-1] Err tccr.it 70 .