| 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: Jul 2005
Posts: 9
|
iView Applescript?
Quote:
Thanks! Michael |
|
|
|
|
|
|
#8 |
|
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 |
|
|
|
|
|
#9 | |
|
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? |
|
|
|
|
|
|
#10 | |
|
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:
|
|
|
|
|
|
|
#11 | |
|
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. |
|
|
|
|
|
|
#12 |
|
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
|
|
|
|
|
|
#13 | |
|
Cave canem!
Join Date: Jan 2004
Location: Boston
Posts: 6,395
|
Quote:
|
|
|
|
|
|
|
#14 | |
|
Beginner grinner
Join Date: Apr 2005
Location: Woodland Hills,CA
Posts: 3
|
Quote:
**Caution** python.com is very different then python.org
|
|
|
|
|
|
|
#15 |
|
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! |
|
|
|
|
|
#16 | |
|
Cave canem!
Join Date: Jan 2004
Location: Boston
Posts: 6,395
|
Quote:
|
|
|
|
|
|
|
#17 | |
|
Big grins
Join Date: Feb 2006
Posts: 20
|
.smugmugrc
rutt,
I am new to python, and smugmug. I have some unix experience and plan on using sm_tool under windows 2000. It is not clear to me, what you expect in the .smugmugrc file....I wondered if you could help me with the syntax. thanks gymshots Quote:
|
|
|
|
|
|
|
#18 | |
|
Big grins
Join Date: Jun 2005
Posts: 13
|
Quote:
password: smugmugpassword public: True That's all I used! Good luck....you'll probably have to try it a few times and experiment before you get it exactly how you want it. It's a good tool! Scott |
|
|
|
|
|
|
#19 | |
|
Big grins
Join Date: Feb 2006
Posts: 20
|
all set
thanks scott! It's working like a charm. great tool!
Quote:
|
|
|
|
|
|
|
#20 |
|
Beginner grinner
Join Date: Mar 2006
Posts: 3
|
Ok, trying to get this working under xp.
I start in the directory with the images I want to upload. I type "c:\sm_tool.py create b17 *" It creates the b17 album, but does not upload images. It works if I give it a specific filename instead of *. Are wildcards allowed? |
|
|
|
![]() |
| Tell The World! |
| Thread Tools | |
| Display Modes | |
|
|