dosage/dosagelib/plugins/o.py

159 lines
6.1 KiB
Python
Raw Normal View History

# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
2014-01-05 15:50:57 +00:00
# Copyright (C) 2012-2014 Bastian Kleineidam
2012-06-20 19:58:13 +00:00
from re import compile, escape
2012-10-11 10:03:12 +00:00
from ..scraper import _BasicScraper
from ..helpers import indirectStarter
2014-03-26 18:59:42 +00:00
from ..util import tagre
2012-06-20 19:58:13 +00:00
class OctopusPie(_BasicScraper):
url = 'http://www.octopuspie.com/'
rurl = escape(url)
starter = indirectStarter(url,
compile(tagre("a", "href", r'(%s[^"]+)' % rurl) +
tagre("img", "src", r'%sjunk/latest\.png' % rurl)))
2013-04-10 21:57:09 +00:00
stripUrl = url + '%s/'
firstStripUrl = stripUrl % '2007-05-14/001-pea-wiggle'
imageSearch = compile(tagre("img", "src", r'(%sstrippy/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="prev"))
2012-06-20 19:58:13 +00:00
help = 'Index format: yyyy-mm-dd/nnn-strip-name'
class OddFish(_BasicScraper):
url = 'http://www.odd-fish.net/'
rurl = escape(url)
stripUrl = url + '%s/'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % 'tv-tentacles'
imageSearch = compile(tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after="navi-prev"))
2012-11-21 20:57:26 +00:00
help = 'Index format: stripname'
2012-06-20 19:58:13 +00:00
2013-03-06 19:21:10 +00:00
class Oglaf(_BasicScraper):
url = 'http://oglaf.com/'
stripUrl = url + '%s/'
2013-04-04 16:30:02 +00:00
imageSearch = compile(tagre("img", "src", r'(http://media\.oglaf\.com/comic/[^"]+)', before="strip"))
2013-11-07 19:47:31 +00:00
prevSearch = (
# first search for "next page" URLs
compile(tagre("a", "href", r'(/[^"]+/\d+/)') + tagre("div", "id", "nx")),
# then for "prev story"
compile(tagre("a", "href", r'(/[^"]+)') + tagre("div", "id", "pvs?")),
)
help = 'Index format: stripname'
2013-04-04 16:30:02 +00:00
adult = True
2013-03-06 19:21:10 +00:00
2014-01-31 03:45:50 +00:00
class OhJoySexToy(_BasicScraper):
url = 'http://www.ohjoysextoy.com/'
rurl = escape(url)
stripUrl = url + '%s/'
firstStripUrl = stripUrl % 'introduction'
imageSearch = compile(tagre("div", "class", r'comicpane') + "\s*.*\s*" + tagre("img", "src", r'(%scomics/[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s[^"]+)' % rurl, after='navi navi-prev'))
textSearch = compile(tagre("div", "class", r'comicpane') + "\s*.*\s*" + tagre("img", "alt", r'([^"]+)'))
help = 'Index Format: name'
adult = True
2013-03-06 19:21:10 +00:00
class OkCancel(_BasicScraper):
url = 'http://okcancel.com/'
rurl = escape(url)
2013-03-06 19:21:10 +00:00
stripUrl = url + 'comic/%s.html'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '1'
imageSearch = compile(tagre("img", "src", r'(%sstrips/okcancel\d{8}\.gif)' % rurl))
prevSearch = compile(tagre("div", "class", "previous") + tagre("a", "href", r'(%scomic/\d{1,4}\.html)' % rurl))
2013-03-06 19:21:10 +00:00
starter = indirectStarter(url, prevSearch)
help = 'Index format: yyyymmdd'
2013-02-06 21:27:40 +00:00
class OmakeTheater(_BasicScraper):
url = 'http://omaketheater.com/'
rurl = escape(url)
2013-04-10 21:57:09 +00:00
stripUrl = url + 'comic/%s/'
firstStripUrl = stripUrl % '1'
2013-02-06 21:27:40 +00:00
imageSearch = compile(tagre("img", "src", r'(http://media\.omaketheater\.com/4koma/[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(%scomic/\d+/)' % rurl, after="prev"))
2013-02-06 21:27:40 +00:00
starter = indirectStarter(url,
compile(tagre("a", "href", r'(%scomic/\d+/)' % rurl)))
2013-02-06 21:27:40 +00:00
help = 'Index format: number (unpadded)'
2012-06-20 19:58:13 +00:00
class OnTheEdge(_BasicScraper):
url = 'http://ontheedgecomics.com/'
rurl = escape(url)
2013-04-10 21:57:09 +00:00
stripUrl = url + 'comic/%s/'
firstStripUrl = stripUrl % 'ote0001'
imageSearch = compile(r'<img src="(%scomics/.+?)"' % rurl)
2012-06-20 19:58:13 +00:00
prevSearch = compile(r'<a href="([^"]+)" rel="prev">')
help = 'Index format: nnn (unpadded)'
2013-06-24 18:19:33 +00:00
class OnTheFasttrack(_BasicScraper):
url = 'http://onthefastrack.com/'
stripUrl = url + 'comics/%s'
firstStripUrl = stripUrl % 'november-13-2000'
imageSearch = compile(tagre("img", "src", r'(http://safr\.kingfeatures\.com/idn/test/zone/xml/content\.php\?file=.+?)'))
prevSearch = compile(r'id="previouscomic" class="button white"><a href="(%scomics/[a-z0-9-]+/)"' % url)
help = 'Index format: monthname-dd-yyyy'
@classmethod
def namer(cls, imageUrl, pageUrl):
name = pageUrl.rsplit('/', 3)[2]
if name == "onthefastrack.com":
import datetime
name = datetime.date.today().strftime("%B-%d-%Y")
# name.title ensures that the comics are named the same
# as in the previous scraper
return "%s.gif" % name.title()
2013-06-24 18:19:33 +00:00
2012-06-20 19:58:13 +00:00
class OneQuestion(_BasicScraper):
2013-11-12 17:33:14 +00:00
url = 'http://onequestioncomic.com/'
stripUrl = url + 'comic.php?strip_id=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '1'
2013-04-11 16:27:43 +00:00
imageSearch = compile(tagre("img", "src", r'((?:\.\./)?istrip_files/strips/\d+\.\w{3,4})'))
2012-11-21 20:57:26 +00:00
prevSearch = compile(tagre("a", "href", r'(comic\.php\?strip_id=\d+)') + tagre("img", "src", r'img/arrow_prev\.jpg'))
2012-06-20 19:58:13 +00:00
help = 'Index format: n (unpadded)'
2014-09-29 02:41:29 +00:00
class Optipess(_BasicScraper):
url = 'http://www.optipess.com/'
stripUrl = url + '%s'
firstStripUrl = url + '2008/12/01/jason-friend-of-the-butterflies/'
imageSearch = compile(tagre("img", "src", r'(%scomics/[x|\d]+[^"]+\.[^"]+)' % url))
prevSearch = compile(tagre("a", "href", r'([^"]+)', after="navi navi-prev"))
textSearch = compile(tagre("img", "alt", r'([^"]+)', before=url))
help = 'Index format: yyyy/mm/dd/stripname'
2013-03-12 20:23:26 +00:00
class OrnerBoy(_BasicScraper):
url = 'http://www.orneryboy.com/'
rurl = escape(url)
2013-03-12 20:23:26 +00:00
stripUrl = url + 'index.php?comicID=%s'
firstStripUrl = stripUrl % '1'
imageSearch = compile(tagre("img", "src", r'(comics/\d+\.[^"]+)'))
prevSearch = compile(tagre("a", "href", r'(%sindex\.php\?comicID=\d+)' % rurl) +
2013-03-12 20:23:26 +00:00
tagre("img", "src", r'images/prev_a\.gif'))
help = 'Index format: number'
2012-06-20 19:58:13 +00:00
class OurHomePlanet(_BasicScraper):
url = 'http://gdk.gd-kun.net/'
stripUrl = url + '%s.html'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '01'
2012-06-20 19:58:13 +00:00
imageSearch = compile(r'<img src="(pages/comic.+?)"')
prevSearch = compile(r'coords="50,18,95,65".+?href="(.+?\.html)".+?alt=')
help = 'Index format: n (unpadded)'
class OverCompensating(_BasicScraper):
url = 'http://www.overcompensating.com/'
2013-11-12 17:33:14 +00:00
stripUrl = url + 'oc/index.php?comic=%s'
2013-07-18 18:39:53 +00:00
firstStripUrl = stripUrl % '0'
2013-11-12 17:33:14 +00:00
imageSearch = compile(tagre("img", "src", r'(/oc/comics/[^"]+)'))
prevSearch = compile(tagre("a", "href",
r'(/oc/index\.php\?comic=\d+)', after="go back"))
2013-07-18 18:39:53 +00:00
help = 'Index format: number'