[generic] Implement basic check that downloaded page is an RSS or Atom feed.
This commit is contained in:
parent
499c9e660a
commit
a1475943a7
|
@ -36,11 +36,12 @@ def try_common_paths (verbosity, url, args):
|
|||
for path in common_paths:
|
||||
page,response_code = download (platform, url + '/' + path, args, verbosity, True)
|
||||
if response_code == 200:
|
||||
# TODO: verify it is a valid RSS feed
|
||||
# Some pages serve response 200 for invalid pages
|
||||
|
||||
# assume we found a feed
|
||||
return url + '/' + path
|
||||
# basic check that it looks like an RSS or Atom file
|
||||
if "<rss" in page or "<feed" in page:
|
||||
# assume we found a feed
|
||||
return url + '/' + path
|
||||
else:
|
||||
debug ("Server returned 200, but it does not appear to be an RSS/Atom feed.", verbosity, platform)
|
||||
|
||||
# failed to find
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue