[tmohentai] refactor to str.format for backwards compatibility
This commit is contained in:
@@ -29,7 +29,7 @@ class TmohentaiExtractor(Extractor):
|
|||||||
|
|
||||||
def parse_location(self):
|
def parse_location(self):
|
||||||
if self.contents:
|
if self.contents:
|
||||||
url = f'{self.root}/reader/{self.id_string}/paginated'
|
url = '{}/reader/{}/paginated'.format(self.root, self.id_string)
|
||||||
else:
|
else:
|
||||||
url_str = self.url.rpartition('/')
|
url_str = self.url.rpartition('/')
|
||||||
if url_str[-1].isdigit():
|
if url_str[-1].isdigit():
|
||||||
@@ -58,7 +58,7 @@ class TmohentaiExtractor(Extractor):
|
|||||||
page_src, 'option value="', '"')
|
page_src, 'option value="', '"')
|
||||||
|
|
||||||
for num, page in enumerate(page_nums, start=int(start_num)):
|
for num, page in enumerate(page_nums, start=int(start_num)):
|
||||||
file = f'{file_loc}/{num:>03}.{ext}'
|
file = '{}/{:>03}.{}'.format(file_loc, num, ext)
|
||||||
img = text.nameext_from_url(file, {
|
img = text.nameext_from_url(file, {
|
||||||
'num' : num,
|
'num' : num,
|
||||||
'title' : data['title'],
|
'title' : data['title'],
|
||||||
@@ -67,7 +67,7 @@ class TmohentaiExtractor(Extractor):
|
|||||||
yield Message.Url, file, img
|
yield Message.Url, file, img
|
||||||
|
|
||||||
def metadata(self):
|
def metadata(self):
|
||||||
contents = f'{self.root}/contents/{self.id_string}'
|
contents = '{}/contents/{}'.format(self.root, self.id_string)
|
||||||
contents_src = self.request(text.ensure_http_scheme(contents)).text
|
contents_src = self.request(text.ensure_http_scheme(contents)).text
|
||||||
|
|
||||||
genders_src = text.extr(contents_src, 'Genders</label>', '</ul>')
|
genders_src = text.extr(contents_src, 'Genders</label>', '</ul>')
|
||||||
|
|||||||
Reference in New Issue
Block a user