Added Namer to BloomingFaeries since the web comic author doesn't seem intrested in sticking to any kind of file naming convention

This commit is contained in:
Kevin Anthony 2015-09-02 11:01:48 -04:00
parent 1045bb7d4a
commit 6e8231e78a

View file

@ -4,7 +4,7 @@
from re import compile, escape
from ..util import tagre
from ..util import tagre, getPageContent
from ..scraper import _BasicScraper, _ParserScraper
from ..helpers import indirectStarter
@ -167,6 +167,16 @@ class BloomingFaeries(_BasicScraper):
if imageUrl:
return imageUrl.replace("http://www.bloomingfaeries.com/","http://www.bloomingfaeries.com/wp-content/uploads/")
@classmethod
def namer(cls, imageUrl, pageUrl):
bf = imageUrl.split('/')
name = bf[-1]
re = compile(tagre("div","class",r'comic-id-([^"]+)'))
content = getPageContent(pageUrl, cls.session)
match = re.search(content)
if not match:
return None
return "BF%s_%s" % (match.group(1),name)
class BMovieComic(_BasicScraper):
url = 'http://www.bmoviecomic.com/'