Dolda2000 GitWeb
/
automanga.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
automanga: Remove (apparently) depricated init calls.
[automanga.git]
/
manga
/
lib.py
diff --git
a/manga/lib.py
b/manga/lib.py
index
da64e0c
..
849e632
100644
(file)
--- a/
manga/lib.py
+++ b/
manga/lib.py
@@
-158,9
+158,12
@@
class stdimgstream(imgstream):
"""A standard implementation of imgstream, for libraries which
have no particular implementation requirements."""
"""A standard implementation of imgstream, for libraries which
have no particular implementation requirements."""
- def __init__(self, url):
+ def __init__(self, url
, referer=None
):
import urllib.request
import urllib.request
- req = urllib.request.Request(url, headers={"User-Agent": "automanga/1"})
+ headers = {"User-Agent": "automanga/1"}
+ if referer:
+ headers["Referer"] = referer
+ req = urllib.request.Request(url, headers=headers)
self.bk = urllib.request.urlopen(req)
ok = False
try:
self.bk = urllib.request.urlopen(req)
ok = False
try: