remove "http://%s%%s" % DOMAIN workaround and shorten
This commit is contained in:
parent
f4b9d08ff7
commit
2993efcf55
6 changed files with 10 additions and 11 deletions
|
|
@ -27,8 +27,7 @@ class EatmangaBackend(GenericComicReaderBackend):
|
||||||
DOMAIN = 'www.eatmanga.com'
|
DOMAIN = 'www.eatmanga.com'
|
||||||
BROWSER_PARAMS = dict(
|
BROWSER_PARAMS = dict(
|
||||||
img_src_xpath="//img[@class='eatmanga_bigimage']/@src",
|
img_src_xpath="//img[@class='eatmanga_bigimage']/@src",
|
||||||
page_list_xpath="(//select[@id='pages'])[1]/option/@value",
|
page_list_xpath="(//select[@id='pages'])[1]/option/@value")
|
||||||
page_to_location="http://%s%%s" % DOMAIN)
|
|
||||||
ID_REGEXP = r'[^/]+/[^/]+'
|
ID_REGEXP = r'[^/]+/[^/]+'
|
||||||
URL_REGEXP = r'.+eatmanga.com/(?:index.php/)?Manga-Scan/(%s).+' % ID_REGEXP
|
URL_REGEXP = r'.+eatmanga.com/(?:index.php/)?Manga-Scan/(%s).+' % ID_REGEXP
|
||||||
ID_TO_URL = 'http://www.eatmanga.com/index.php/Manga-Scan/%s'
|
ID_TO_URL = 'http://www.eatmanga.com/index.php/Manga-Scan/%s'
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,7 @@ class MangahereBackend(GenericComicReaderBackend):
|
||||||
DOMAIN = 'www.mangahere.com'
|
DOMAIN = 'www.mangahere.com'
|
||||||
BROWSER_PARAMS = dict(
|
BROWSER_PARAMS = dict(
|
||||||
img_src_xpath="//img[@id='image']/@src",
|
img_src_xpath="//img[@id='image']/@src",
|
||||||
page_list_xpath="(//select[@onchange='change_page(this)'])[1]/option/@value",
|
page_list_xpath="(//select[@onchange='change_page(this)'])[1]/option/@value")
|
||||||
page_to_location="%s")
|
|
||||||
ID_REGEXP = r'[^/]+/[^/]+/[^/]+'
|
ID_REGEXP = r'[^/]+/[^/]+/[^/]+'
|
||||||
URL_REGEXP = r'.+mangahere.com/manga/(%s).+' % ID_REGEXP
|
URL_REGEXP = r'.+mangahere.com/manga/(%s).+' % ID_REGEXP
|
||||||
ID_TO_URL = 'http://www.mangahere.com/manga/%s'
|
ID_TO_URL = 'http://www.mangahere.com/manga/%s'
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,7 @@ class MangareaderBackend(GenericComicReaderBackend):
|
||||||
DOMAIN = 'www.mangareader.net'
|
DOMAIN = 'www.mangareader.net'
|
||||||
BROWSER_PARAMS = dict(
|
BROWSER_PARAMS = dict(
|
||||||
img_src_xpath="//img[@id='img']/@src",
|
img_src_xpath="//img[@id='img']/@src",
|
||||||
page_list_xpath="//select[@id='pageMenu']/option/@value",
|
page_list_xpath="//select[@id='pageMenu']/option/@value")
|
||||||
page_to_location="http://%s%%s" % DOMAIN)
|
|
||||||
ID_REGEXP = r'[^/]+/[^/]+'
|
ID_REGEXP = r'[^/]+/[^/]+'
|
||||||
URL_REGEXP = r'.+mangareader.net/(%s).+' % ID_REGEXP
|
URL_REGEXP = r'.+mangareader.net/(%s).+' % ID_REGEXP
|
||||||
ID_TO_URL = 'http://www.mangareader.net/%s'
|
ID_TO_URL = 'http://www.mangareader.net/%s'
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,7 @@ class MangatoshokanBackend(GenericComicReaderBackend):
|
||||||
DOMAIN = "www.mangatoshokan.com"
|
DOMAIN = "www.mangatoshokan.com"
|
||||||
BROWSER_PARAMS = dict(
|
BROWSER_PARAMS = dict(
|
||||||
img_src_xpath="//img[@id='readerPage']/@src",
|
img_src_xpath="//img[@id='readerPage']/@src",
|
||||||
page_list_xpath="(//select[@class='headerSelect'])[1]/option/@value",
|
page_list_xpath="(//select[@class='headerSelect'])[1]/option/@value")
|
||||||
page_to_location='http://%s%%s' % DOMAIN)
|
|
||||||
ID_TO_URL = 'http://www.mangatoshokan.com/read/%s'
|
ID_TO_URL = 'http://www.mangatoshokan.com/read/%s'
|
||||||
ID_REGEXP = r'[^/]+(?:/[^/]+)*'
|
ID_REGEXP = r'[^/]+(?:/[^/]+)*'
|
||||||
URL_REGEXP = r'.+mangatoshokan.com/read/(%s)' % ID_REGEXP
|
URL_REGEXP = r'.+mangatoshokan.com/read/(%s)' % ID_REGEXP
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,7 @@ class SimplyreaditBackend(GenericComicReaderBackend):
|
||||||
DESCRIPTION = 'Simplyreadit manga reading site'
|
DESCRIPTION = 'Simplyreadit manga reading site'
|
||||||
BROWSER_PARAMS = dict(
|
BROWSER_PARAMS = dict(
|
||||||
img_src_xpath="//img[@class='open']/@src",
|
img_src_xpath="//img[@class='open']/@src",
|
||||||
page_list_xpath="(//div[contains(@class,'dropdown_right')]/ul[@class='dropdown'])[1]/li/a/@href",
|
page_list_xpath="(//div[contains(@class,'dropdown_right')]/ul[@class='dropdown'])[1]/li/a/@href")
|
||||||
page_to_location="%s")
|
|
||||||
ID_TO_URL = 'http://www.simplyread.it/reader/read/%s'
|
ID_TO_URL = 'http://www.simplyread.it/reader/read/%s'
|
||||||
ID_REGEXP = r'[^/]+(?:/[^/]+)*'
|
ID_REGEXP = r'[^/]+(?:/[^/]+)*'
|
||||||
URL_REGEXP = r'.+simplyread.it/reader/read/(%s)/page/.+' % ID_REGEXP
|
URL_REGEXP = r'.+simplyread.it/reader/read/(%s)/page/.+' % ID_REGEXP
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,11 @@ class GenericComicReaderBrowser(BaseBrowser):
|
||||||
assert self.is_on_page(DisplayPage)
|
assert self.is_on_page(DisplayPage)
|
||||||
|
|
||||||
for p in self.page.page_list():
|
for p in self.page.page_list():
|
||||||
self.location(self.params['page_to_location'] % p)
|
if 'page_to_location' in self.params:
|
||||||
|
self.location(self.params['page_to_location'] % p)
|
||||||
|
else:
|
||||||
|
self.location(p)
|
||||||
|
|
||||||
assert self.is_on_page(DisplayPage)
|
assert self.is_on_page(DisplayPage)
|
||||||
yield self.page.get_page(gallery)
|
yield self.page.get_page(gallery)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue