Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few changes to the original code #23

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
output
*.log
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,32 @@ Download all of the pictures from a SmugMug user, including password-protected u
* Run `python smdl.py -u USERNAME` and it will begin downloading your pictures into separate folders in the default output directory. The username is what is found in the URL, i.e. USERNAME.smugmug.com.
* Some SmugMug sites are organized with [folders and hierarchy](https://www.smugmughelp.com/hc/en-us/articles/18212469747604-Organize-with-folders-and-hierarchy); if you would like to restrict your download to certain folders, you can directly put the relevant path into the username (USERNAME.smugmug.com/a/b/c would become `-u USERNAME/a/b/c`).
* To specify the output directory, use the `-o` flag: `python smdl.py -u USERNAME -o output`
* If the user requires an unlock password, you must sign in using the password in your web browser, then copy over the SMSESS cookie. In Google Chrome, you can view your cookies by pressing `Ctrl-Shift-I`, then go to the Application tab, go to the Cookies dropdown, and click on https://USERNAME.smugmug.com. Then copy the value of the SMSESS cookie. You can then paste this cookie as an argument: `python smdl.py -u USERNAME -s
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
* If the user requires an unlock password, you have following two options:
- Specify the password: `python smdl.py -u USERNAME -p PASSWORD`. This works best if 2FA is not enabled.
- Sign in from your web browser, then copy over the SMSESS cookie. In Google Chrome, you can view your cookies by pressing Ctrl-Shift-I, then go to the Application tab, go to the Cookies dropdown, and click on https://USERNAME.smugmug.com. Then copy the value of the SMSESS cookie. You can then paste this cookie as an argument: `python smdl.py -u USERNAME -s xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
* For a full list of command-line options, run `python smdl.py -h`, or see below:
```
usage: smdl.py [-h] [-s SESSION] -u USER [-o OUTPUT] [--albums ALBUMS]
usage: smdl.py [-h] -u USERNAME [-p PASSWORD] [-o OUTPUT] [--albums ALBUMS] [--folder FOLDER]

SmugMug Downloader

optional arguments:
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
username (from URL, USERNAME.smugmug.com)
-p PASSWORD, --password PASSWORD
password (required if user is password protected);
if session ID is provided, password will be ignored
-s SESSION, --session SESSION
session ID (required if user is password protected); log
in on a web browser and paste the SMSESS cookie
-u USER, --user USER username (from URL, USERNAME.smugmug.com)
session ID (required if user is password protected);
log in on a web browser and paste the SMSESS cookie
-o OUTPUT, --output OUTPUT
output directory
--albums ALBUMS specific album names to download, split by $. Defaults
to all. Wrap in single quotes to avoid shell variable
substitutions. (e.g. --albums 'Title 1$Title 2$Title 3')
--albums ALBUMS specific album names to download, split by $.
Defaults to all. Wrap in single quotes to avoid
shell variable substitutions.
(e.g. --albums 'Title 1$Title 2$Title 3')
--folder FOLDER download all the albums under the specific folder
```


Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
beautifulsoup4
requests
retrying
tqdm
urllib3
colored
Loading