diff --git a/morss/feedify.py b/morss/feedify.py index 35d34f2..c82cbd6 100644 --- a/morss/feedify.py +++ b/morss/feedify.py @@ -96,6 +96,13 @@ def PreWorker(url, cache): cache.set('redirect', nurl) cache.set('cache', ncache) + if urlparse.urlparse(url).netloc == 'itunes.apple.com': + match = re.search('/id([0-9]+)(\?.*)?$', url) + if match: + iid = match.groups()[0] + redirect = 'https://itunes.apple.com/lookup?id={id}'.format(id=iid) + cache.set('redirect', redirect) + class Builder(object): def __init__(self, link, data=None, cache=False): self.link = link diff --git a/morss/morss.py b/morss/morss.py index 2a341b1..44d3709 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -543,7 +543,9 @@ def Fetch(url, cache, options): cache.set('etag', con.headers.getheader('etag')) cache.set('lastmodified', con.headers.getheader('last-modified')) - if xml.startswith('