Hello, my name is Daniel, and I make things! Join me in this exciting journey exploring the world of computers and electronics

Flickr Photo Downloader Script

While on my exchange in Finland, my friends from other countries and I took many pictures. We wanted to share pictures, but most of them didn’t know how to use a computer so well. Some burned CDs with pictures and sent them to everyone but it was a lot of work!!! So my friend Camre from Turkey made a script that allows people to easily download all of the pictures from any photoset in flickr. But his script wasn’t working anymore on his server, so I decided to make a new one. I was looking for a simple flickr library, and I found one in Oberkampf, it’s easy and very configurable.

My objective was to make a script that, when you set a user, it would show all of his photosets, and when clicking on one of those, it would make a list of the photos linking the photo to the maximum size on flickr. So, using a download manager (in Firefox, I used Flashgot and FlashGet) you could simply download all the pictures in max size from a photoset.


I made a lot of changes to the code to get to this. The script is working fine, so I decided to release it on the internet, making it available to everyone.



    Download the latest version of the script from here.



    To install the script on your server, you have to upload all files to the same dir, and create a folder called “cache” with the chmod “777“.


    Open the “library.php” and change the $config[‘user’]=”” to your user ID. To help get this ID, you can go to THIS website.
    For example: $config[‘user’]=”[email protected]″;


    You also need to add the username in $config[‘username’]=””;
    For example: $config[‘username’]=”pasteler0″;


    If you want to show your private photosets, you can set the email you are using on your flickr account in $config[’email’]=””; or your flickr password in $config[‘password’]=””;



    If you want to change the style, you simply edit the flickr.css file.



    How do I download the pictures?

    When you select the photoset, the script will create a list with a link to all photos in the set with a bigger size available. Having flashgot installed, you right click and select the option “Flashgot all“. After that it will open in the download manager you have configured.


    The pictures have strange name, how do I fix this?

    These names are the original names in flickr. You can change the name of the file to the title as a bunch using Flashget.
    After you have downloaded all pictures, go to the Download Folder in Flashget, select the files you want to change the name,Right Mouse -> Rename -> Comment as Filename and you are done!



  • You can find this script working on my pictures here.
  • Remember that it is not legal to download pictures without the permission of the owner/photographer, this script shouldn’t be used to steal pictures.


Hope you enjoyed this script. If you liked, have any question or advice, please, just leave a comment.

10 responses to “Flickr Photo Downloader Script

  1. Hey I love this script. This made it easy to download my pictures and my sister’s pictures.

    I had to change a few lines though

    line 229 of library.php became:
    $set_image = ‘http://static.flickr.com/’. $server . “/” . $primary.’_’.$secret.”.$setup_size.’.jpg’;

    line 320:
    $raw_url = ‘http://static.flickr.com/’. $server . “/” . $photo_id.’_’.$secret;

    line 321
    $photo_url = ‘http://static.flickr.com/’. $server . “/” . $photo_id.’_’.$secret.”.$setup_size.’.jpg’;

    After that worked like a charm. Thanks much

  2. In Geoff’s correction, you need to replace the round quotes and double quotes by straight ones… THEN it really works like a charm. THANKS!!!

  3. Thanks a lot for the script. I’m using it for downloading my contacts’ photos. But i can’t see one of my contact’s photo sets. His gallery is only open for his friends and only his friends can get photos. So this script doesn’t work for his account. Is there any solution for this problem.

  4. thnx for the sc.

    we can’t find the solution about this script.

    we can’t download it :S

    how should we do it? can u send me an e-mail about it.

    we,3 guys tried but can’t find any solution,pls help us

  5. also i changed quotes with the straight ones like sjoerd’s message.


    $set_image = ‘http://static.flickr.com/’. $server . ‘/’ . $primary.’_’.$secret.’.$setup_size.’.jpg’;

    it still didn’t work :S

  6. The script works if you follow Geoff’s and Sjoerd’s corrections if you change the download hostname to http://farm1.static.flickr.com/, but only for photos uploaded before early 2007.
    For all photos uploaded after about March or April, the script calculates the wrong secret, and therefore is unable to point to the correct location.
    I don’t have a solution, except to download those manually…

  7. Yeah, I made this script when there was no farm servers. I’ll try to update the script in the future. But if you make some changes that work, please, share the code with us. 🙂

  8. script working perfect

    problem is dns servers

    change your hosts file in this folder “C:\WINDOWS\system32\drivers\etc\”

    # Copyright (c) 1993-1999 Microsoft Corp.
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host

    # The IP address and the host name should be separated by at least one
    # space.
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a ‘#’ symbol.
    # For example:
    # rhino.acme.com # source server
    # x.acme.com # x client host photos1.flickr.com photos2.flickr.com photos3.flickr.com photos4.flickr.com photos5.flickr.com photos6.flickr.com photos7.flickr.com photos8.flickr.com photos9.flickr.com photos10.flickr.com photos11.flickr.com photos12.flickr.com photos13.flickr.com photos14.flickr.com photos15.flickr.com photos16.flickr.com photos17.flickr.com photos18.flickr.com photos19.flickr.com photos20.flickr.com photos21.flickr.com photos22.flickr.com photos23.flickr.com photos24.flickr.com photos25.flickr.com photos26.flickr.com photos27.flickr.com photos28.flickr.com photos29.flickr.com photos30.flickr.com photos31.flickr.com photos32.flickr.com photos33.flickr.com photos34.flickr.com photos35.flickr.com photos36.flickr.com photos37.flickr.com photos38.flickr.com photos39.flickr.com photos40.flickr.com photos41.flickr.com photos42.flickr.com photos43.flickr.com photos44.flickr.com photos45.flickr.com photos46.flickr.com photos47.flickr.com photos48.flickr.com photos49.flickr.com photos50.flickr.com photos51.flickr.com photos52.flickr.com photos53.flickr.com photos54.flickr.com photos55.flickr.com photos56.flickr.com photos57.flickr.com photos58.flickr.com photos59.flickr.com photos60.flickr.com photos61.flickr.com photos62.flickr.com photos63.flickr.com photos64.flickr.com photos65.flickr.com photos66.flickr.com photos67.flickr.com photos68.flickr.com photos69.flickr.com photos70.flickr.com photos71.flickr.com photos72.flickr.com photos73.flickr.com photos74.flickr.com photos75.flickr.com photos76.flickr.com photos77.flickr.com photos78.flickr.com photos79.flickr.com photos80.flickr.com photos81.flickr.com photos82.flickr.com photos83.flickr.com photos84.flickr.com photos85.flickr.com photos86.flickr.com photos87.flickr.com photos88.flickr.com photos89.flickr.com photos90.flickr.com photos91.flickr.com photos92.flickr.com photos93.flickr.com photos94.flickr.com photos95.flickr.com photos96.flickr.com photos97.flickr.com photos98.flickr.com photos99.flickr.com photos100.flickr.com photos101.flickr.com photos102.flickr.com photos103.flickr.com photos104.flickr.com photos105.flickr.com photos106.flickr.com photos107.flickr.com photos108.flickr.com photos109.flickr.com photos110.flickr.com photos111.flickr.com photos112.flickr.com photos113.flickr.com photos114.flickr.com photos115.flickr.com photos116.flickr.com photos117.flickr.com photos118.flickr.com photos119.flickr.com photos120.flickr.com photos121.flickr.com photos122.flickr.com photos123.flickr.com photos124.flickr.com photos125.flickr.com photos126.flickr.com photos127.flickr.com photos128.flickr.com photos129.flickr.com photos130.flickr.com photos131.flickr.com photos132.flickr.com photos133.flickr.com photos134.flickr.com photos135.flickr.com photos136.flickr.com photos137.flickr.com photos138.flickr.com photos139.flickr.com photos140.flickr.com photos141.flickr.com photos142.flickr.com photos143.flickr.com photos144.flickr.com photos145.flickr.com photos146.flickr.com photos147.flickr.com photos148.flickr.com photos149.flickr.com photos150.flickr.com photos151.flickr.com photos152.flickr.com photos153.flickr.com photos154.flickr.com photos155.flickr.com photos156.flickr.com photos157.flickr.com photos158.flickr.com photos159.flickr.com photos160.flickr.com photos161.flickr.com photos162.flickr.com photos163.flickr.com photos164.flickr.com photos165.flickr.com photos166.flickr.com photos167.flickr.com photos168.flickr.com photos169.flickr.com photos170.flickr.com photos171.flickr.com photos172.flickr.com photos173.flickr.com photos174.flickr.com photos175.flickr.com photos176.flickr.com photos177.flickr.com photos178.flickr.com photos179.flickr.com photos180.flickr.com photos181.flickr.com photos182.flickr.com photos183.flickr.com photos184.flickr.com photos185.flickr.com photos186.flickr.com photos187.flickr.com photos188.flickr.com photos189.flickr.com photos190.flickr.com photos191.flickr.com photos192.flickr.com photos193.flickr.com photos194.flickr.com photos195.flickr.com photos196.flickr.com photos197.flickr.com photos198.flickr.com photos199.flickr.com photos200.flickr.com

  9. Hello,

    What a great script idea. Would it be very complicated to make the script download all the photos from a group rather than a set?

    I would like to compile a book from the photos of a group I set up so that the users of that group can get themselves a cool book of images which they have contributed to.

    Obviously I would ensure that the images in question are ok to be printed, but I am sure they would be 🙂



Leave a Reply

Your email address will not be published. Required fields are marked *