1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 12:12:34 +01:00

fixed various bugs

- forgot "self." before "name_fmt"
- image keys where off by one
This commit is contained in:
Mike Fährmann 2014-10-15 16:17:59 +02:00
parent deef91eddc
commit 7588974306

View File

@ -33,13 +33,14 @@ class Extractor(BasicExtractor):
url , pos = e(text, '<img id="img" src="', '"', pos) url , pos = e(text, '<img id="img" src="', '"', pos)
name , pos = e(text, '<div id="i4"><div>', ' :: ', pos) name , pos = e(text, '<div id="i4"><div>', ' :: ', pos)
orgurl , pos = e(text, 'http://exhentai.org/fullimg.php', '"', pos) orgurl , pos = e(text, 'http://exhentai.org/fullimg.php', '"', pos)
if orgurl: url = "http://exhentai.org/fullimg.php" + unescape(orgurl)
yield url, name_fmt.format(self.gid, 1, imgkey, name)
gid , pos = e(text, 'var gid=' , ';', pos) gid , pos = e(text, 'var gid=' , ';', pos)
startkey, pos = e(text, 'var startkey="', '";', pos) startkey, pos = e(text, 'var startkey="', '";', pos)
showkey , pos = e(text, 'var showkey="' , '";', pos) showkey , pos = e(text, 'var showkey="' , '";', pos)
#
if orgurl: url = "http://exhentai.org/fullimg.php" + unescape(orgurl)
yield url, self.name_fmt.format(self.gid, 1, startkey, name)
# use json-api for further pages # use json-api for further pages
request = { request = {
"method" : "showpage", "method" : "showpage",
@ -60,7 +61,7 @@ class Extractor(BasicExtractor):
name , pos = e(info["i" ], '<div>', ' :: ') name , pos = e(info["i" ], '<div>', ' :: ')
orgurl, pos = e(info["i7"], '<a href="', '"') orgurl, pos = e(info["i7"], '<a href="', '"')
if orgurl: url = unescape(orgurl) if orgurl: url = unescape(orgurl)
yield url, name_fmt.format(gid, request["page"], imgkey, name) yield url, self.name_fmt.format(gid, request["page"], request["imgkey"], name)
if request["imgkey"] == imgkey: if request["imgkey"] == imgkey:
return return