Delete feedify.py leftover code
iTunes integration untested, unreliable and not working...master
parent
aad2398e69
commit
a82ec96eb7
|
@ -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
|
|
|
@ -13,7 +13,6 @@ import lxml.html
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
from . import feeds
|
from . import feeds
|
||||||
from . import feedify
|
|
||||||
from . import crawler
|
from . import crawler
|
||||||
from . import readabilite
|
from . import readabilite
|
||||||
|
|
||||||
|
@ -318,13 +317,6 @@ def UrlFix(url):
|
||||||
|
|
||||||
|
|
||||||
def FeedFetch(url, options):
|
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
|
# fetch feed
|
||||||
delay = DELAY
|
delay = DELAY
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue