text: #!/usr/bin/env python
  # Generated by BigMap 2. Permalink: http://bigmap.osmz.ru/bigmap.php?xmin=557&xmax=559&ymin=354&ymax=356&zoom=10&scale=256&tiles=mapnik
  import requests
  from pathlib import Path
  import io, urllib.request, datetime, time, re, random
  from PIL import Image, ImageDraw
  # ^^^^^^ install "python-pillow" package | pip install Pillow | easy_install Pillow
  
  (zoom, xmin, ymin, xmax, ymax) = (14, 8912, 5664, 8959, 5703)
  layers = ["http://tile.openstreetmap.org/!z/!x/!y.png"]
  attribution = 'Map data (c) OpenStreetMap'
  xsize = xmax - xmin + 1
  ysize = ymax - ymin + 1
  tilesize = 256
  
  counter = 0
  for x in range(xmin, xmax+1):
  	for y in range(ymin, ymax+1):
  		for layer in layers:
  			url = layer.replace("!x", str(x)).replace("!y", str(y)).replace("!z", str(zoom))
  			match = re.search("{([a-z0-9]+)}", url)
  			if match:
  				url = url.replace(match.group(0), random.choice(match.group(1)))
  			print(url, "... ");
  			
  			Path(f"/home/akrim/tiles/{zoom}/{x}").mkdir(parents=True, exist_ok=True)
  
  			try:
  				r = requests.get(url, headers={'User-Agent': 'BigMap/2.0'})
  			except Exception as e:
  				time.sleep(2);
  				r = requests.get(url, headers={'User-Agent': 'BigMap/2.0'})
  
  			with open(f"/home/akrim/tiles/{zoom}/{x}/{y}.png", 'wb') as f:
  				f.write(r.content)
  
  			counter += 1
  			if counter == 10:
  				time.sleep(2);
  				counter = 0
  