gallery.accords-library.com/server/szurubooru/func/net.py

9 lines
219 B
Python
Raw Normal View History

2016-05-05 11:23:15 +00:00
import urllib.request
def download(url):
2016-08-14 08:45:00 +00:00
assert url
2016-05-05 11:23:15 +00:00
request = urllib.request.Request(url)
request.add_header('Referer', url)
with urllib.request.urlopen(request) as handle:
return handle.read()