From 1045bb7d4ae9846b041e99d38d5af47aa4fa7666 Mon Sep 17 00:00:00 2001 From: Kevin Anthony Date: Wed, 2 Sep 2015 10:13:42 -0400 Subject: [PATCH 1/4] added comic Blooming Faeries --- dosagelib/plugins/b.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dosagelib/plugins/b.py b/dosagelib/plugins/b.py index 8ef5fd4ac..35c0c7596 100644 --- a/dosagelib/plugins/b.py +++ b/dosagelib/plugins/b.py @@ -151,6 +151,22 @@ class Blip(_BasicScraper): if prevUrl: return prevUrl.replace("www.blipcomic.com", "blipcomic.com") +class BloomingFaeries(_BasicScraper): + adult = True + url = 'http://www.bloomingfaeries.com/' + rurl = escape(url) + stripUrl = url + 'comic/public/%s/' + firstStripUrl = stripUrl % "pit-stop" + imageSearch = compile(tagre("img", "src", r'http://www.bloomingfaeries.com/wp-content/uploads([^"]+)', after='title')) + prevSearch = compile(tagre("a", "href", r'([^"]+)', after='comic-nav-base comic-nav-previous')) + help = 'Index format: stripname' + + @classmethod + def imageUrlModifier(cls, imageUrl, data): + print imageUrl + if imageUrl: + return imageUrl.replace("http://www.bloomingfaeries.com/","http://www.bloomingfaeries.com/wp-content/uploads/") + class BMovieComic(_BasicScraper): url = 'http://www.bmoviecomic.com/' From 6e8231e78a6106676292a68e8ab01bbff8e1097f Mon Sep 17 00:00:00 2001 From: Kevin Anthony Date: Wed, 2 Sep 2015 11:01:48 -0400 Subject: [PATCH 2/4] Added Namer to BloomingFaeries since the web comic author doesn't seem intrested in sticking to any kind of file naming convention --- dosagelib/plugins/b.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dosagelib/plugins/b.py b/dosagelib/plugins/b.py index 35c0c7596..02eb2d3f9 100644 --- a/dosagelib/plugins/b.py +++ b/dosagelib/plugins/b.py @@ -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 @@ -160,13 +160,23 @@ class BloomingFaeries(_BasicScraper): imageSearch = compile(tagre("img", "src", r'http://www.bloomingfaeries.com/wp-content/uploads([^"]+)', after='title')) prevSearch = compile(tagre("a", "href", r'([^"]+)', after='comic-nav-base comic-nav-previous')) help = 'Index format: stripname' - + @classmethod def imageUrlModifier(cls, imageUrl, data): print imageUrl 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/' From d7180eaf99143422fc1d417260753e547d9753ad Mon Sep 17 00:00:00 2001 From: Kevin Anthony Date: Wed, 2 Sep 2015 11:04:32 -0400 Subject: [PATCH 3/4] removed bad whitespace --- dosagelib/plugins/b.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dosagelib/plugins/b.py b/dosagelib/plugins/b.py index 02eb2d3f9..757ae6aeb 100644 --- a/dosagelib/plugins/b.py +++ b/dosagelib/plugins/b.py @@ -160,7 +160,7 @@ class BloomingFaeries(_BasicScraper): imageSearch = compile(tagre("img", "src", r'http://www.bloomingfaeries.com/wp-content/uploads([^"]+)', after='title')) prevSearch = compile(tagre("a", "href", r'([^"]+)', after='comic-nav-base comic-nav-previous')) help = 'Index format: stripname' - + @classmethod def imageUrlModifier(cls, imageUrl, data): print imageUrl From 62ec1f1d181f1e32c3c4b7bbb9eb3aec1f29222b Mon Sep 17 00:00:00 2001 From: Kevin Anthony Date: Wed, 2 Sep 2015 11:22:24 -0400 Subject: [PATCH 4/4] Removed debugging print state --- dosagelib/plugins/b.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dosagelib/plugins/b.py b/dosagelib/plugins/b.py index 757ae6aeb..d350e6730 100644 --- a/dosagelib/plugins/b.py +++ b/dosagelib/plugins/b.py @@ -163,7 +163,6 @@ class BloomingFaeries(_BasicScraper): @classmethod def imageUrlModifier(cls, imageUrl, data): - print imageUrl if imageUrl: return imageUrl.replace("http://www.bloomingfaeries.com/","http://www.bloomingfaeries.com/wp-content/uploads/")