| Lurk all you'd like, but why not register and post some pics? Registering also makes it easier to find the good stuff. Need help? |
|
|||||||
| Register | FAQ | Shooters | Calendar | Reviews | Tutorials | Gallery | Books | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Cave canem!
Join Date: Jan 2004
Location: Boston
Posts: 6,395
|
smugmug command line tool in python
I have written a command line tool that uses the smugmug labs API to create gallereis, upload photos to them, and keep them updated as images change and new images are added locally. This is very useful if you want to treat you smugmug account as a mirror of a local directory tree. It also is not subject to the 100MB limit of the various browser based upload tools.
Who is this for? The brave, people who want to deal with a lot of photos and galleries, rogrammers; in short people like me. If you are not comfortable with command line programs, you won't like this. If you are aggressively non-technical, this isn't for you. But if you like to tinker and you aren't afraid of what's under the hood of your computer, this might be just the thing for you. I have been using variants of this program for almost a year, but this version has been radically revised in hopes that it can be more than personal software. As such, I'm sure there will be bugs. Please email me with these. (please don't PM.) The program text contains a disclaimer, but I suppose I'd better add one here as well. Use this thing at your own risk. I won't be responsible for any damage it inflicts. I have used and tested on OS X and on Linux. I have not tried on windows, but there really is no reason that it shouldn't work there. I have tried to be as portable as possible (and python allows a lot of this.) I'd like to hear about experiences on windows. Best of all, I'd like a python programmer on windows to smooth out the rough corners there. Download sm_tool.py Smugmug.py requires python 2.3 or better. [Edited to reflect the true correct home of the script.] Last edited by rutt; Mar-25-2006 at 07:57 AM. |
|
|
|
|
|
#2 |
|
Cave canem!
Join Date: Jan 2004
Location: Boston
Posts: 6,395
|
Gallery creation issues
Gallery creation customizations don't work properly. I fixed a bug with my script. Pick up a new version. You want at least version 1.4 (look near the top of the script.)
Nevertheless, gallery creation currently ignores all parameters except the category. I strongly suspect an API bug and have submitted a bug. Stay tuned. |
|
|
|
|
|
#3 |
|
Beginner grinner
Join Date: Nov 2004
Posts: 5
|
Thanks very much for posting this great tool!
So far, all I can get to work under Mac OS X is the simple upload command, but that's all I was looking for. By invoking your script within a do shell script command in applescript, I can now automate uploads to smugmug from within iView Media Pro. DE. |
|
|
|
|
|
#4 | |
|
Cave canem!
Join Date: Jan 2004
Location: Boston
Posts: 6,395
|
Quote:
|
|
|
|
|
|
|
#5 | |
|
Beginner grinner
Join Date: Nov 2004
Posts: 5
|
Quote:
Traceback (most recent call last): File "/Users/dephron/Library/Application Support/SmugMug/smugmug.py", line 625, in ? main() File "/Users/dephron/Library/Application Support/SmugMug/smugmug.py", line 616, in main update(Options(argv[2:])) File "/Users/dephron/Library/Application Support/SmugMug/smugmug.py", line 577, in update update_dir(smugmug,".",opts,listdir(".")) NameError: global name 'listdir' is not defined The upload command works fine. |
|
|
|
|
|
|
#7 |
|
Beginner grinner
Join Date: Jan 2005
Posts: 1
|
Using on Windows
The script works fine on Windows(so far) using python included the cygwin unix environment. I haven't used it for much other than uploading.. Haven't played with the creation stuff yet.
Cygwin gives you a bash shell, complete with unix style path's, home dirtectory, etc. Get it at http://www.cygwin.com NOTE: While you are in the cygwin environment, you need to use unix style path names. All windows drives are mounted under /cygdrive/ . So, to access files on the c: drive, you would access them through /cygdrive/c/ . ie., the path "c:\mypic.jpg" would be translated to "/cygdrive/c/mypic.jpg". Also, if there are any spaces in the path, like in "My Pictures", you need to escape the spaces, or wrap quotation marks around the entire path. Thanks for the script! -Matt M. |
|
|
|
|
|
#8 |
|
Beginner grinner
Join Date: Feb 2005
Posts: 4
|
Script down?
Hi,
I'd love to try this out. The java uploader is annoying for Linux... but when trying to download the script and get a file not found error. Can someone email me the file or tell me where to find it? I could host it on my site if needed also... Thanks, Brian |
|
|
|
|
|
#9 | |
|
Cave canem!
Join Date: Jan 2004
Location: Boston
Posts: 6,395
|
Quote:
|
|
|
|
|
|
|
#10 |
|
Beginner grinner
Join Date: Feb 2005
Posts: 4
|
Working Now
Sorry, I was at work earlier and they block all ports other than 80.
Got it now. Thanks! |
|
|
|
|
|
#11 |
|
Beginner grinner
Join Date: Mar 2005
Posts: 2
|
Is there any reason why smugmug.py would stop working? I just subscribed to smugmug and found this script which is just what I was looking for. I ran it under linux and I can create empty galleries with it fine, and I can apparently upload photos with it, but the photos don't appear in the galleries! I uploaded quite a few photos overnight (with OK's at the end of each files upload) and they seem to have vanished. I've tried to do single file uploads as well with no luck. smugmug.py put out no errors or any other suspicous output.
Would the March 4th API changes have broken this? I tried changing the URL as descriped in the API change annoucement and the script still worked the same way. Uploads pictures, but they don't show up anywhere. Thanks for any assistance! This is just the tool I need so I hope to be able to get it working one way for another |
|
|
|
|
|
#12 | |
|
Cave canem!
Join Date: Jan 2004
Location: Boston
Posts: 6,395
|
Quote:
In the function post_multipart, you'll find some print statements that have been commented out. Try uncommenting them and try to upload just one file. What happens? |
|
|
|
|
|
|
#13 | |
|
Beginner grinner
Join Date: Mar 2005
Posts: 2
|
Did that, saw that the error was 'system error (nogallery) ' . When I saw that I realized that maybe I should be using the numeric ID of the gallery rather than the alphanumeric name. Tried that and it worked. Chalk one up to being a smugmug newbie. Thanks so much for the quick help!
Rich Quote:
|
|
|
|
|
|
|
#14 | |
|
Cave canem!
Join Date: Jan 2004
Location: Boston
Posts: 6,395
|
Quote:
Suppose "VacationShots" is a directory full of jpgs from your trip. Cd there and do: smugmug.py create "My Trip" *.jpgAfter this, suppose you add a new shot to the directory VacationShots, perhaps a PS edit of one of the originals. You can always cd to VacationShots and do: smugmug.py updateand it will find and upload any shots that are new or have changed since the last upload. It remembers the gallery from the create. It has an even more high level usage model. Suppose you have a directory tree of galleries, each containing some shots and perhaps other directories. If you cd to the root of this tree and do: smugmug.py full_updateit will crawl the entire directory tree making sure that a gallery exists for each directory in the tree that contains shots and uploading the shots not already uploaded. Neither of these modes requires you to know the gallery_id. |
|
|
|
|
|
|
#15 |
|
Beginner grinner
Join Date: Apr 2005
Location: Woodland Hills,CA
Posts: 3
|
The link is broken.http://www.chezrutt.com/sm_tool/sm_tool.py
|
|
|
|
|
|
#16 | |
|
Cave canem!
Join Date: Jan 2004
Location: Boston
Posts: 6,395
|
Quote:
|
|
|
|
|
|
|
#17 | |
|
Beginner grinner
Join Date: Apr 2005
Location: Woodland Hills,CA
Posts: 3
|
Quote:
**Caution** python.com is very different then python.org
|
|
|
|
|
|
|
#18 |
|
Big grins
Join Date: Dec 2004
Posts: 12
|
I'm looking forward to using this plugin. However, no matter what I do it always gives me the error message:
No login and/or password. Both are required I've tried putting the password/username on the command line as well as in .smugmugrc. Any suggestions? Thanks! |
|
|
|
|
|
#19 | |
|
Cave canem!
Join Date: Jan 2004
Location: Boston
Posts: 6,395
|
Quote:
|
|
|
|
|
|
|
#20 | |
|
Big grins
Join Date: Dec 2004
Posts: 12
|
Hey,
Sorry for not providing any details.I'm running Linux (Debiain), Python 2.3.5, and the .smugmugrc is in the same directory as sm_tool.py, (the directory with the pictures). The syntax was: ./sm_tool.py --login=LOGIN --password=PASSWORD create Trip (and I've tried combos of this with quotes around login/pass and gallery name. Thanks for your help, Scott Quote:
|
|
|
|
|
![]() |
| Tell The World! |
| Thread Tools | |
| Display Modes | |
|
|