2016-03-31 23:13:54 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
2012-06-20 22:41:04 +02:00
|
|
|
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
|
2014-01-05 16:50:57 +01:00
|
|
|
# Copyright (C) 2012-2014 Bastian Kleineidam
|
2016-03-31 23:13:54 +02:00
|
|
|
# Copyright (C) 2015-2016 Tobias Gruetzmacher
|
2012-06-20 21:58:13 +02:00
|
|
|
|
2016-03-31 23:13:54 +02:00
|
|
|
from __future__ import absolute_import, division, print_function
|
2016-04-02 00:14:31 +02:00
|
|
|
|
2013-04-10 18:19:11 +02:00
|
|
|
from re import compile, escape
|
2016-04-02 00:14:31 +02:00
|
|
|
|
2015-04-26 23:32:22 +12:00
|
|
|
from ..scraper import _BasicScraper, _ParserScraper
|
2014-03-26 19:59:42 +01:00
|
|
|
from ..util import tagre
|
2016-04-10 23:04:34 +02:00
|
|
|
from .common import _WordPressScraper, xpath_class
|
2012-06-20 21:58:13 +02:00
|
|
|
|
|
|
|
|
2015-05-14 23:06:12 +12:00
|
|
|
class OctopusPie(_ParserScraper):
|
2013-02-04 21:00:26 +01:00
|
|
|
url = 'http://www.octopuspie.com/'
|
2013-04-10 18:19:11 +02:00
|
|
|
rurl = escape(url)
|
2013-04-10 23:57:09 +02:00
|
|
|
stripUrl = url + '%s/'
|
|
|
|
firstStripUrl = stripUrl % '2007-05-14/001-pea-wiggle'
|
2015-05-14 23:06:12 +12:00
|
|
|
imageSearch = '//img[@title]'
|
|
|
|
prevSearch = '//a[@rel="prev"]'
|
2012-06-20 21:58:13 +02:00
|
|
|
help = 'Index format: yyyy-mm-dd/nnn-strip-name'
|
|
|
|
|
|
|
|
|
2016-05-21 02:38:07 +02:00
|
|
|
class Oglaf(_ParserScraper):
|
2013-03-06 20:21:10 +01:00
|
|
|
url = 'http://oglaf.com/'
|
|
|
|
stripUrl = url + '%s/'
|
2016-05-21 02:38:07 +02:00
|
|
|
imageSearch = '//img[@id="strip"]'
|
|
|
|
# search for "previous story" only
|
|
|
|
prevSearch = '//a[div[@id="pvs"]]'
|
|
|
|
# search for "next page"
|
|
|
|
nextSearch = '//a[div[@id="nx"]]'
|
|
|
|
multipleImagesPerStrip = True
|
2013-04-04 18:30:02 +02:00
|
|
|
adult = True
|
|
|
|
|
2016-05-21 02:38:07 +02:00
|
|
|
def fetchUrls(self, url, data, search):
|
|
|
|
urls = []
|
|
|
|
urls.extend(super(Oglaf, self).fetchUrls(url, data, search))
|
|
|
|
if search == self.imageSearch:
|
|
|
|
try:
|
|
|
|
nexturls = self.fetchUrls(url, data, self.nextSearch)
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
while nexturls and nexturls[0].startswith(url):
|
|
|
|
data = self.getPage(nexturls[0])
|
|
|
|
urls.extend(super(Oglaf, self).fetchUrls(nexturls, data, search))
|
|
|
|
nexturls = self.fetchUrls(url, data, self.nextSearch)
|
|
|
|
return urls
|
|
|
|
|
2013-03-06 20:21:10 +01:00
|
|
|
|
2016-04-10 23:04:34 +02:00
|
|
|
class OhJoySexToy(_WordPressScraper):
|
2014-01-30 22:45:50 -05:00
|
|
|
url = 'http://www.ohjoysextoy.com/'
|
2016-04-10 23:04:34 +02:00
|
|
|
firstStripUrl = url + 'introduction/'
|
|
|
|
prevSearch = '//a[%s]' % xpath_class('navi-prev')
|
|
|
|
textSearch = '//div[@id="comic"]//img/@alt'
|
2014-01-30 22:45:50 -05:00
|
|
|
adult = True
|
|
|
|
|
|
|
|
|
2013-03-06 20:21:10 +01:00
|
|
|
class OkCancel(_BasicScraper):
|
|
|
|
url = 'http://okcancel.com/'
|
2013-04-10 18:19:11 +02:00
|
|
|
rurl = escape(url)
|
2013-03-06 20:21:10 +01:00
|
|
|
stripUrl = url + 'comic/%s.html'
|
2013-04-10 23:57:09 +02:00
|
|
|
firstStripUrl = stripUrl % '1'
|
2013-04-10 18:19:11 +02:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(%sstrips/okcancel\d{8}\.gif)' % rurl))
|
2016-04-02 00:14:31 +02:00
|
|
|
prevSearch = compile(tagre("div", "class", "previous") +
|
|
|
|
tagre("a", "href", r'(%scomic/\d{1,4}\.html)' % rurl))
|
2013-03-06 20:21:10 +01:00
|
|
|
help = 'Index format: yyyymmdd'
|
|
|
|
|
|
|
|
|
2015-04-26 23:32:22 +12:00
|
|
|
class OmakeTheater(_ParserScraper):
|
2016-05-05 20:55:14 +02:00
|
|
|
url = 'http://omaketheater.com/comic/'
|
|
|
|
stripUrl = url + '%s'
|
2013-04-10 23:57:09 +02:00
|
|
|
firstStripUrl = stripUrl % '1'
|
2015-04-26 23:32:22 +12:00
|
|
|
css = True
|
|
|
|
imageSearch = ".comicImage img"
|
|
|
|
prevSearch = ".previous a"
|
2013-02-06 22:27:40 +01:00
|
|
|
help = 'Index format: number (unpadded)'
|
|
|
|
|
|
|
|
|
2016-04-02 00:14:31 +02:00
|
|
|
class OnTheEdge(_WordPressScraper):
|
|
|
|
url = 'http://ontheedgecomics.com/'
|
|
|
|
firstStripUrl = 'http://ontheedgecomics.com/comic/ote0001/'
|
|
|
|
|
|
|
|
|
2015-05-02 22:27:08 +02:00
|
|
|
class OnTheFastrack(_BasicScraper):
|
2014-11-14 20:09:42 +01:00
|
|
|
url = 'http://onthefastrack.com/'
|
|
|
|
stripUrl = url + 'comics/%s'
|
|
|
|
firstStripUrl = stripUrl % 'november-13-2000'
|
2016-04-21 08:20:49 +02:00
|
|
|
imageSearch = compile(r'(https://safr\.kingfeatures\.com/idn/cnfeed/zone/js/content\.php\?file=.+)"')
|
2014-11-14 20:37:06 +01:00
|
|
|
prevSearch = compile(r'id="previouscomic" class="button white"><a href="(%scomics/[a-z0-9-]+/)"' % url)
|
2014-11-14 20:09:42 +01:00
|
|
|
help = 'Index format: monthname-dd-yyyy'
|
2016-03-31 23:13:54 +02:00
|
|
|
|
2016-04-21 08:20:49 +02:00
|
|
|
def namer(self, image_url, page_url):
|
|
|
|
name = page_url.rsplit('/', 3)[2]
|
2014-11-14 20:09:42 +01:00
|
|
|
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 20:19:33 +02:00
|
|
|
|
|
|
|
|
2016-04-10 23:04:34 +02:00
|
|
|
class Optipess(_WordPressScraper):
|
2014-09-28 19:41:29 -07:00
|
|
|
url = 'http://www.optipess.com/'
|
2016-03-31 23:13:54 +02:00
|
|
|
firstStripUrl = url + '2008/12/01/jason-friend-of-the-butterflies/'
|
2016-04-10 23:04:34 +02:00
|
|
|
prevSearch = '//a[%s]' % xpath_class('navi-prev')
|
|
|
|
textSearch = '//div[@id="comic"]//img/@alt'
|
2016-05-16 23:16:29 +02:00
|
|
|
textOptional = True
|
2014-09-28 19:41:29 -07:00
|
|
|
|
|
|
|
|
2012-06-20 21:58:13 +02:00
|
|
|
class OurHomePlanet(_BasicScraper):
|
2013-02-04 21:00:26 +01:00
|
|
|
url = 'http://gdk.gd-kun.net/'
|
|
|
|
stripUrl = url + '%s.html'
|
2013-04-10 23:57:09 +02:00
|
|
|
firstStripUrl = stripUrl % '01'
|
2012-06-20 21:58:13 +02: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-02-04 21:00:26 +01:00
|
|
|
url = 'http://www.overcompensating.com/'
|
2013-11-12 18:33:14 +01:00
|
|
|
stripUrl = url + 'oc/index.php?comic=%s'
|
2013-07-18 20:39:53 +02:00
|
|
|
firstStripUrl = stripUrl % '0'
|
2013-11-12 18:33:14 +01:00
|
|
|
imageSearch = compile(tagre("img", "src", r'(/oc/comics/[^"]+)'))
|
2016-03-31 23:13:54 +02:00
|
|
|
prevSearch = compile(tagre("a", "href", r'(/oc/index\.php\?comic=\d+)',
|
|
|
|
after="go back"))
|
2013-07-18 20:39:53 +02:00
|
|
|
help = 'Index format: number'
|