dosage/dosagelib/plugins/f.py

132 lines
5.3 KiB
Python
Raw Normal View History

# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2012-11-21 20:57:26 +00:00
# Copyright (C) 2012 Bastian Kleineidam
2012-06-20 19:58:13 +00:00
from re import compile, IGNORECASE, MULTILINE
2012-10-11 10:03:12 +00:00
from ..util import tagre
from ..scraper import _BasicScraper
from ..helpers import indirectStarter
2012-06-20 19:58:13 +00:00
class FalconTwin(_BasicScraper):
latestUrl = 'http://www.falcontwin.com/'
stripUrl = latestUrl + 'index.html?strip=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'"(strips/.+?)"')
prevSearch = compile(r'"prev"><a href="(index.+?)"')
help = 'Index format: nnn'
class FauxPas(_BasicScraper):
latestUrl = 'http://www.ozfoxes.net/cgi/pl-fp1.cgi'
stripUrl = latestUrl + '?%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img .*src="(.*fp/fp.*(png|jpg|gif))"')
prevSearch = compile(r'<a href="(pl-fp1\.cgi\?\d+)">Previous Strip')
help = 'Index format: nnn'
class FeyWinds(_BasicScraper):
2012-11-13 18:10:19 +00:00
stripUrl = 'http://kitsune.rydia.net/comic/page.php?id=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r"(../comic/pages//.+?)'")
prevSearch = compile(r"(page.php\?id=.+?)'.+?navprevious.png")
help = 'Index format: n (unpadded)'
starter = indirectStarter('http://kitsune.rydia.net/index.html',
compile(r'(comic/page.php\?id.+?)"'))
class FilibusterCartoons(_BasicScraper):
latestUrl = 'http://www.filibustercartoons.com/'
stripUrl = latestUrl + 'index.php/%s'
imageSearch = compile(tagre("img", "src", r'(http://www\.filibustercartoons\.com/comics/[^"]+)'))
2012-11-21 20:57:26 +00:00
prevSearch = compile(tagre("a", "href", r'(http://www\.filibustercartoons\.com/[^"]+)', after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyy/mm/dd/name'
class FlakyPastry(_BasicScraper):
latestUrl = 'http://flakypastry.runningwithpencils.com/index.php'
2012-11-21 20:57:26 +00:00
stripUrl = 'http://flakypastry.runningwithpencils.com/comic.php?strip_id=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(comics/.+?)"')
prevSearch = compile(r'<a href="(.+?)".+?btn_back')
help = 'Index format: nnnn'
2012-12-04 06:02:40 +00:00
2012-12-08 20:30:51 +00:00
class Flemcomics(_BasicScraper):
latestUrl = 'http://www.flemcomics.com/'
stripUrl = latestUrl + 'd/%s.html'
imageSearch = compile(tagre("img", "src", r'(/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(/d/\d+\.html)') +
tagre("img", "src", r'/images/previous_day\.jpg'))
help = 'Index format: yyyymmdd'
2012-06-20 19:58:13 +00:00
class Flipside(_BasicScraper):
2012-11-21 20:57:26 +00:00
latestUrl = 'http://flipside.keenspot.com/comic.php'
stripUrl = latestUrl + '?i=%s'
2012-12-04 06:02:40 +00:00
imageSearch = compile(tagre("img", "src", r'(http://cdn\.flipside\.keenspot\.com/comic/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(http://flipside\.keenspot\.com/comic\.php\?i=\d+)', after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: nnnn'
class Footloose(_BasicScraper):
latestUrl = 'http://footloosecomic.com/footloose/today.php'
2012-11-13 18:10:19 +00:00
stripUrl = 'http://footloosecomic.com/footloose/pages.php?page=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="/footloose/(.+?)"')
prevSearch = compile(r'(?:first.+?[^>]).+?(/footloose/.+?)".+?(?:prev)')
help = 'Index format: n (unpadded)'
class Freefall(_BasicScraper):
latestUrl = 'http://freefall.purrsia.com/default.htm'
2012-11-13 18:10:19 +00:00
stripUrl = 'http://freefall.purrsia.com/ff%s/fc%s.htm'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(/ff\d+/.+?.\w{3,4})"')
prevSearch = compile(r'<A HREF="(/ff\d+/.+?.htm)">Previous</A>')
help = 'Index format: nnnn/nnnnn'
class FantasyRealms(_BasicScraper):
2012-11-13 18:10:19 +00:00
stripUrl = 'http://www.fantasyrealmsonline.com/manga/%s.php'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(\d{1,4}.\w{3,4})" width="540"', IGNORECASE)
prevSearch = compile(r'<a href="(.+?)"><img src="../images/nav-back.gif"', IGNORECASE)
help = 'Index format: nnn'
starter = indirectStarter('http://www.fantasyrealmsonline.com/',
compile(r'<a href="(manga/.+?)"><img src="preview.jpg"', IGNORECASE))
class FunInJammies(_BasicScraper):
latestUrl = 'http://www.funinjammies.com/'
stripUrl = latestUrl + 'comic.php?issue=%s'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'(/comics/.+?)"')
prevSearch = compile(r'(/comic.php.+?)" id.+?prev')
help = 'Index format: n (unpadded)'
class Fallen(_BasicScraper):
2012-11-13 18:10:19 +00:00
stripUrl = 'http://www.fallencomic.com/pages/part%s/%s-p%s.htm'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<IMG SRC="(page/.+?)"', IGNORECASE)
prevSearch = compile(r'<A HREF="(.+?)"><FONT FACE="Courier">Back', IGNORECASE)
help = 'Index format: nn-m (comicNumber-partNumber)'
starter = indirectStarter('http://www.fallencomic.com/fal-page.htm',
compile(r'\(NEW \d{2}/\d{2}/\d{2}\)\s*\n*\s*<a href="(pages/part\d+/\d+-p\d+\.htm)">\d+</a>', MULTILINE))
@classmethod
def namer(cls, imageUrl, pageUrl):
num = pageUrl.split('/')[-1].split('-')[0]
part = pageUrl.split('-')[-1].split('.')[0]
return '%s-%s' % (part, num)
def setStrip(self, index):
index, part = index.split('-')
2012-11-13 18:10:19 +00:00
self.currentUrl = self.stripUrl % (part, index, part)
2012-06-20 19:58:13 +00:00
2012-09-27 19:55:16 +00:00
class FredoAndPidjin(_BasicScraper):
homepage = 'http://www.pidjin.net/'
2012-11-21 20:57:26 +00:00
stripUrl = None
2012-09-27 19:55:16 +00:00
help = 'Index format: yyyy/mm/dd/name'
2012-12-04 06:02:40 +00:00
imageSearch = compile(tagre('img', 'src', '(http://cdn\.pidjin\.net/wp-content/uploads/\d+/\d+/[^"]+\.png)'))
multipleImagesPerStrip = True
2012-09-27 19:55:16 +00:00
prevSearch = compile(tagre('a', 'href', '([^"]+)')+"Prev</a>")
starter = indirectStarter(homepage,
compile(tagre('a', 'href', "("+homepage+r'\d\d\d\d/\d\d/\d\d/[^"]+/)')))
2012-11-21 20:57:26 +00:00