Getting image URL's from a private gallery anonymously (with password)

DfectsDfects Registered Users Posts: 21 Big grins
Hey :-)

I was just have a play around with the API but i've hit what may be a snag. I'm trying to write a little personal app to download images from an account that i have access to, mainly my friends whos posted about 2-300 photos of a night out we had. Hes put them all in an album thats private with a password. I've managed to get a list of image Id's for the album when logged in anonymously, but it won't let me get a list of image url's for the images.

The API doc seems to say that it'll only work if the albums public, and a passwords provided. I don't see any reason why it makes a difference if the albums public or private in regards to getting a list of image urls, if i have the proper password? Was just wondering if theres any way around this, and if its built this way for a specific reason. I mean, i could login on the page and download each original image manually, so why not automatically? :-)

If it makes any difference, i'm using the REST 1.2 API at http://api.smugmug.com/hack/rest/1.2.0/

Any help/advice appreciated :)

Comments

  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited June 5, 2007
    Dfects wrote:
    Hey :-)

    I was just have a play around with the API but i've hit what may be a snag. I'm trying to write a little personal app to download images from an account that i have access to, mainly my friends whos posted about 2-300 photos of a night out we had. Hes put them all in an album thats private with a password. I've managed to get a list of image Id's for the album when logged in anonymously, but it won't let me get a list of image url's for the images.

    The API doc seems to say that it'll only work if the albums public, and a passwords provided. I don't see any reason why it makes a difference if the albums public or private in regards to getting a list of image urls, if i have the proper password? Was just wondering if theres any way around this, and if its built this way for a specific reason. I mean, i could login on the page and download each original image manually, so why not automatically? :-)

    If it makes any difference, i'm using the REST 1.2 API at http://api.smugmug.com/hack/rest/1.2.0/

    Any help/advice appreciated :)

    It seems logical to me that private galleries should require login first and should not work anonymously. After all, you aren't supposed to be able to anonymously browse to your site and then see the private galleries listed for viewing.

    Have you tried using the APIs that login first and create a session ID and then use that?
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • DfectsDfects Registered Users Posts: 21 Big grins
    edited June 5, 2007
    jfriend wrote:
    It seems logical to me that private galleries should require login first and should not work anonymously. After all, you aren't supposed to be able to anonymously browse to your site and then see the private galleries listed for viewing.

    Have you tried using the APIs that login first and create a session ID and then use that?

    Thanks for the response :-) I tried that and it didn't work.

    See, even when i'm not logged in via my browser, i can follow the link in the email and give the password and view the photos. Isn't that logging in anonymously? and if i do so i can freely save the original images.

    the api is happy to give me a list of image id's for that specific albumid as long as i supply the password, so why not the imageurls for the images? I'm giving the correct password in the call so its clear i have permission to. :)
  • jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited June 5, 2007
    Dfects wrote:
    Thanks for the response :-) I tried that and it didn't work.

    See, even when i'm not logged in via my browser, i can follow the link in the email and give the password and view the photos. Isn't that logging in anonymously? and if i do so i can freely save the original images.

    the api is happy to give me a list of image id's for that specific albumid as long as i supply the password, so why not the imageurls for the images? I'm giving the correct password in the call so its clear i have permission to. :)
    You're beyond my knowledge. Hopefully a developer-type who knows the APIs better than I can weigh in to help.

    Do you realize that once you have the image IDs, you can construct the image URL yourself. It's works like http://userid.smugmug.com/photos/imageID-M.jpg. You can substitute -O, -S, -Ti, etc... for different sizes. You can even replace the userid with "www" and it will work.

    For example, a medium-sized image with imageID of "13115697" has an URL of http://www.smugmug.com/photos/13115697-M.jpg.
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • DfectsDfects Registered Users Posts: 21 Big grins
    edited June 5, 2007
    jfriend wrote:
    You're beyond my knowledge. Hopefully a developer-type who knows the APIs better than I can weigh in to help.

    Do you realize that once you have the image IDs, you can construct the image URL yourself. It's works like http://userid.smugmug.com/photos/imageID-M.jpg. You can substitute -O, -S, -Ti, etc... for different sizes. You can even replace the userid with "www" and it will work.

    For example, a medium-sized image with imageID of "13115697" has an URL of http://www.smugmug.com/photos/13115697-M.jpg.

    Oh wow i didn't know that, thats awesome :) should make it slightly quicker as well as it'll cut out the need for potentially hundreds of calls.

    Thanks for your help, its much appreciated

    Please have a beer or a white wine based fruit drink on me :D :slurp
Sign In or Register to comment.