def download_results(results_url, params, downloaded_scenes, download_dir, image_type):
    data = requests.get(
        results_url,
        params,
        auth=(PLANET_KEY, '')
    )

    for scene_data in data.json()["features"]:
        if image_type == 'planetlabs':
            # Planet Labs ortho satellite
            img_url = scene_data['properties']['links']['full']
        elif image_type == 'rapideye':
            # Rapideye
            img_url = scene_data["properties"]["data"]["products"]["analytic"]["full"]

        if does_download_exist(img_url, download_dir) == True:
            print '\nAlready downloaded %s' % img_url
            continue

        # Sometimes the downloaded image can be corrupted - keep trying until we have
        # an image we can work with.
        finished = False
        while not finished:
            try:
                print '\nDownloading image from %s' % img_url
                image_filename = download_image(img_url, download_dir)

                if image_type == 'rapideye':
                    # RapidEye images are 16-bit non-color corrected images by default.
                    image_filename = from_analytic_to_visual(image_filename, download_dir)

                finished = True
            except:
                print "Unexpected error dealing with image:", sys.exc_info()[0]

        downloaded_scenes.append(image_filename)

    return data.json()["links"]["next"]
Actually downloads from the given URL; if we are dealing with multiple pages of results
dataset/ETHPy150Open BradNeuberg/cloudless/src/annotate/train/scripts/download_planetlabs.py/download_results