Skip to content

Instantly share code, notes, and snippets.

@Alvtron
Last active January 13, 2020 11:12
Show Gist options
  • Save Alvtron/49458b522936b252cd0df40b2c386b8d to your computer and use it in GitHub Desktop.
Save Alvtron/49458b522936b252cd0df40b2c386b8d to your computer and use it in GitHub Desktop.
Downloads all 411 paintings by Bob Ross from the site Two Inch Brush with Python.

Download 411 Bob Ross Paintings

Download all 411 Bob Ross paintings from the website Two Inch Brush (https://www.twoinchbrush.com) with Python.

This is an update to a similar solution made by Jeffrey Thompson (https://gist.github.com/jeffThompson/6d4c45f89dc907925775972e72d9cf00). I had problems running his code with Python 3, so I wrote my own code that essentially does the same thing.

Code

import requests

NUM_IMAGES = 411
# You must change the output file destination
save_destination = "C:/Users/Thomas/Downloads/"
# Change the output file name prefix if needed
file_name_prefix = "bob_ross_painting"

for i in range(1, NUM_IMAGES + 1):
    try:
        url = f"http://www.twoinchbrush.com/images/painting{i}.png"
        print(f"downloading painting {i} of {NUM_IMAGES}: {url}...")
        with open(f"{save_destination}{file_name_prefix}_{i}.png", 'wb') as f:
            f.write(requests.get(url).content)
    except Exception as e:
        print(e)

How to use

Download the script and edit the save_destionation to one appropriate for your sytem. Run the script with Python 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment