dosage/dosagelib/plugins/y.py

24 lines
829 B
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-11-21 20:57:26 +00:00
from re import compile
2012-10-11 10:03:12 +00:00
from ..scraper import _BasicScraper
2012-11-26 06:13:32 +00:00
from ..util import tagre
2012-06-20 19:58:13 +00:00
class YAFGC(_BasicScraper):
2013-04-14 07:02:14 +00:00
description = u'Yet Another Fantasy Gamer Comic'
url = 'http://yafgc.net/'
stripUrl = url + '?id=%s'
2013-04-10 21:57:09 +00:00
firstStripUrl = stripUrl % '1'
2013-03-19 19:45:18 +00:00
imageSearch = compile(tagre("img", "src", r'(http://(?:www\.)?yafgc\.net/img/comic/\d+\.jpg)'))
prevSearch = compile(tagre("a", "href", r'(http://(?:www\.)?yafgc\.net/\?id=\d+)') +
2012-11-26 06:13:32 +00:00
tagre("img", "src", r'/img/navbar/go_to_previous\.gif'))
2013-03-19 19:45:18 +00:00
help = 'Index format: number'
2014-03-26 18:59:42 +00:00
@classmethod
2013-03-19 19:45:18 +00:00
def prevUrlModifier(cls, prevUrl):
if prevUrl:
return prevUrl.replace("www.yafgc.net", "yafgc.net")