new release: programmer friendly gallery downloader
adam.zochowski
Registered Users Posts: 2 Beginner grinner
Hi
Synopsis:
Simple, albeit ugly, console, linux friendly, proxy supporting, passworded gallery downloader
Reason:
All the available downloaders failed me for multiple reasons:
- no support for hidden / password sites
- no proxy support
minor issues:
- no linux support
- no console support
And other libraries out there are geared towards uploading pictures. Not their download ;/
smugmug API used:
login.anonymously
login.withPassword
logout
images.get
images.getInfo
own API:
_getAllImages ( albumId , albumKey , savePath , password = '' )
_downloadImage ( imageUrl , savePath , albumId = '' , password = '' )
_getAllImages
1) uses images.get to get listing of all available images in a gallery
2) for each image, downloads its info with images.getInfo (to get image URL)
2b) tries to save to disk using original filename if available (otherwise, uses smugmug's generated filename)
3) calls _downloadImage for each image
Password can be left out if not needed.
_downloadImage:
download image helps downloading image
You need to pass albumKey if album has a password on it. This is how smugmug expects cookies.
Friendly Recovery:
If any download step fails, the script tries to proceed ignoring failure
image.getInfo responses are cached under imageId_imageKey.info.xml files (similar name as smugmug's auto generated filenames)
Usage:
from libSmugMug import smugmug
mySmugMug = smugmug();
#mySmugMug.PROXY_SERVER = '__proxyServer__'
print mySmugMug.login_anonymously()
print mySmugMug._getAllImages( '__albumId__' , '__albumKey__' , '__savePath__' )
print mySmugMug._getAllImages( '__albumId__' , '__albumKey__' , '__savePath__' , '__password__' )
print mySmugMug.logout()
Epilogue:
I had to download 15gb of pictures from friend's password protected, hidden gallery. Without available tools I wrote my own. In retrospect I could have used some other library for backend and just add image downloader on top of it. But then I would not have learned as much, and would not have had as much fun.
Releasing this to the community. You guys rock, and I wanted to ensure that I do contribute.
Kind regards
Adam Żochowski
Synopsis:
Simple, albeit ugly, console, linux friendly, proxy supporting, passworded gallery downloader
Reason:
All the available downloaders failed me for multiple reasons:
- no support for hidden / password sites
- no proxy support
minor issues:
- no linux support
- no console support
And other libraries out there are geared towards uploading pictures. Not their download ;/
smugmug API used:
login.anonymously
login.withPassword
logout
images.get
images.getInfo
own API:
_getAllImages ( albumId , albumKey , savePath , password = '' )
_downloadImage ( imageUrl , savePath , albumId = '' , password = '' )
_getAllImages
1) uses images.get to get listing of all available images in a gallery
2) for each image, downloads its info with images.getInfo (to get image URL)
2b) tries to save to disk using original filename if available (otherwise, uses smugmug's generated filename)
3) calls _downloadImage for each image
Password can be left out if not needed.
_downloadImage:
download image helps downloading image
You need to pass albumKey if album has a password on it. This is how smugmug expects cookies.
Friendly Recovery:
If any download step fails, the script tries to proceed ignoring failure
image.getInfo responses are cached under imageId_imageKey.info.xml files (similar name as smugmug's auto generated filenames)
Usage:
from libSmugMug import smugmug
mySmugMug = smugmug();
#mySmugMug.PROXY_SERVER = '__proxyServer__'
print mySmugMug.login_anonymously()
print mySmugMug._getAllImages( '__albumId__' , '__albumKey__' , '__savePath__' )
print mySmugMug._getAllImages( '__albumId__' , '__albumKey__' , '__savePath__' , '__password__' )
print mySmugMug.logout()
Epilogue:
I had to download 15gb of pictures from friend's password protected, hidden gallery. Without available tools I wrote my own. In retrospect I could have used some other library for backend and just add image downloader on top of it. But then I would not have learned as much, and would not have had as much fun.
Releasing this to the community. You guys rock, and I wanted to ensure that I do contribute.
Kind regards
Adam Żochowski
0
Comments
Want faster uploading? Vote for FTP!
nice, I think this will be pretty useful
The only suggestion that I might make is to perform logins over https instead http using httplib.HTTPSConnection.
Cheers,
David
SmugMug API Developer
My Photos