From a82ec96eb7047482e5f219e065b8e458154f6244 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sun, 5 Apr 2020 22:16:52 +0200 Subject: [PATCH] Delete feedify.py leftover code iTunes integration untested, unreliable and not working... --- morss/feedify.py | 28 ---------------------------- morss/morss.py | 8 -------- 2 files changed, 36 deletions(-) delete mode 100644 morss/feedify.py diff --git a/morss/feedify.py b/morss/feedify.py deleted file mode 100644 index f2affbd..0000000 --- a/morss/feedify.py +++ /dev/null @@ -1,28 +0,0 @@ -import re -import json - -from . import crawler - -try: - basestring -except NameError: - basestring = str - - -def pre_worker(url): - if url.startswith('http://itunes.apple.com/') or url.startswith('https://itunes.apple.com/'): - match = re.search('/id([0-9]+)(\?.*)?$', url) - if match: - iid = match.groups()[0] - redirect = 'https://itunes.apple.com/lookup?id=%s' % iid - - try: - con = crawler.custom_handler(basic=True).open(redirect, timeout=4) - data = con.read() - - except (IOError, HTTPException): - raise - - return json.loads(data.decode('utf-8', 'replace'))['results'][0]['feedUrl'] - - return None diff --git a/morss/morss.py b/morss/morss.py index 473201a..074c75e 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -13,7 +13,6 @@ import lxml.html from bs4 import BeautifulSoup from . import feeds -from . import feedify from . import crawler from . import readabilite @@ -318,13 +317,6 @@ def UrlFix(url): def FeedFetch(url, options): - # allow for code execution for feedify - pre = feedify.pre_worker(url) - if pre: - url = UrlFix(pre) - log('url redirect') - log(url) - # fetch feed delay = DELAY