feeds: remove mimetype from function call as no longer used
parent
749acc87fc
commit
a1dc96cb50
|
@ -71,7 +71,7 @@ def parse_rules(filename=None):
|
||||||
return rules
|
return rules
|
||||||
|
|
||||||
|
|
||||||
def parse(data, url=None, mimetype=None, encoding=None):
|
def parse(data, url=None, encoding=None):
|
||||||
" Determine which ruleset to use "
|
" Determine which ruleset to use "
|
||||||
|
|
||||||
rulesets = parse_rules()
|
rulesets = parse_rules()
|
||||||
|
@ -760,7 +760,7 @@ if __name__ == '__main__':
|
||||||
from . import crawler
|
from . import crawler
|
||||||
|
|
||||||
data, con, contenttype, encoding = crawler.adv_get(sys.argv[1] if len(sys.argv) > 1 else 'https://www.nytimes.com/', follow='rss')
|
data, con, contenttype, encoding = crawler.adv_get(sys.argv[1] if len(sys.argv) > 1 else 'https://www.nytimes.com/', follow='rss')
|
||||||
feed = parse(data, url=con.geturl(), mimetype=contenttype, encoding=encoding)
|
feed = parse(data, url=con.geturl(), encoding=encoding)
|
||||||
|
|
||||||
if not sys.flags.interactive:
|
if not sys.flags.interactive:
|
||||||
for item in feed.items:
|
for item in feed.items:
|
||||||
|
|
|
@ -330,7 +330,7 @@ def FeedFetch(url, options):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
rss = feeds.parse(xml, url, contenttype, encoding=encoding)
|
rss = feeds.parse(xml, url, encoding=encoding)
|
||||||
rss = rss.convert(feeds.FeedXML)
|
rss = rss.convert(feeds.FeedXML)
|
||||||
# contains all fields, otherwise much-needed data can be lost
|
# contains all fields, otherwise much-needed data can be lost
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue