import glob

if __name__ == '__main__':
    # png_lis = glob.glob('imgs_out/tiles_400px/*.png')
    # png_lis = [png.replace('imgs_out/tiles_400px/', '').replace('.png', '') for png in png_lis]
    # url_template = 'https://iiif-test.onb.ac.at/images/MISC/donau/'
    # url_lis = [url_template + png for png in png_lis]
    # with open('tiles_list.txt', 'w') as fh:
    #     for url in url_lis:
    #         fh.write(url + '\n')
    tif_lis = glob.glob('imgs_out/tiles/*.tif')
    with open('tiles_list.txt', 'w') as fh:
        for path in tif_lis:
            fh.write('http://127.0.0.1:5004/tiles' + path.replace('imgs_out/tiles', '') + '\n')
    with open('tiles_list_remote.txt', 'w') as fh:
        for path in tif_lis:
            fh.write('https://edition.onb.ac.at/iiif/donau-tiles' + path.replace('imgs_out/tiles', '') + '\n')