From: Fredrik Tolf Date: Sat, 13 Jul 2013 05:39:39 +0000 (+0200) Subject: Merge branch 'master' of git.dolda2000.com:/srv/git/r/automanga X-Git-Url: http://dolda2000.com/gitweb/?p=automanga.git;a=commitdiff_plain;h=ddc2438e18c52f938220dae26d21e3150264a3c6;hp=d2f58cfc0a7804bb3aad1cbe190c6b83a2a5cde3 Merge branch 'master' of git.dolda2000.com:/srv/git/r/automanga Conflicts: manga/mangafox.py --- diff --git a/manga/mangafox.py b/manga/mangafox.py index 30329c2..c95a77b 100644 --- a/manga/mangafox.py +++ b/manga/mangafox.py @@ -1,4 +1,4 @@ -import urllib +import urllib, re import BeautifulSoup import lib, htcache soup = BeautifulSoup.BeautifulSoup @@ -117,6 +117,8 @@ def nextel(el): return el class manga(lib.manga): + cure = re.compile(r"/v\d+/c[\d.]+/$") + def __init__(self, lib, id, name, url): self.lib = lib self.id = id @@ -156,7 +158,7 @@ class manga(lib.manga): url = n.a["href"].encode("us-ascii") if url[-7:] == "/1.html": url = url[:-6] - elif url[-1:] == "/": + elif self.cure.search(url) is not None: pass else: raise Exception("parse error: unexpected chapter URL for %r: %s" % (self, url)) diff --git a/manga/profile.py b/manga/profile.py index e8414a1..27bf86e 100644 --- a/manga/profile.py +++ b/manga/profile.py @@ -196,6 +196,9 @@ class profile(object): for nm, (libnm, id) in map.iteritems(): f.write(consline("alias", nm, libnm, id) + "\n") + def file(self, name, mode="r"): + return openwdir(pj(self.dir, name), mode) + def getalias(self, nm): return self.getaliases()[nm]