dosage/dosagelib/plugins/o.py

149 lines
5.7 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
2013-04-04 16:30:02 +00:00
from ..util import tagre, urlopen
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
@classmethod
def starter(cls):
# click the "I am 18" button
data = {"over18": " "}
2013-04-11 16:27:43 +00:00
urlopen(cls.url, cls.session, data=data, referrer=cls.url)
2013-04-04 16:30:02 +00:00
return cls.url
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://www.onthefastrack.com/'
rurl = escape(url)
2013-07-09 20:21:17 +00:00
stripUrl = url + '?webcomic1=%s'
2013-06-24 18:19:33 +00:00
firstStripUrl = stripUrl % '2010-08-09'
imageSearch = compile(tagre("img", "src", r'(%swp-content/uploads/\d+/\d+/[^"]+-\d+-\d+\.[^"]+)' % rurl))
prevSearch = compile(tagre("a", "href", r'(%s\?webcomic1=[^"]+)' % rurl, after="prev"))
description = u'On The Fasttrack by Bill Holbrook'
help = 'Index format: yyyy-mm-dd'
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)'
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):
2013-04-14 07:02:14 +00:00
description = u'OVERCOMPENSATING: The Journal Comic With a Seething Disdain for Reality.'
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'