diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-07-05 16:38:26 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-07-06 09:04:58 +0200 |
commit | d08cc46087d3349aff7b06908c70d97fecbdec8f (patch) | |
tree | eed30e3659312afabaff44d5009b5063df08a83d /pyaggr3g470r/lib | |
parent | fixing bug on reset link for feeds and hidding feed title for eXtraSmall device (diff) | |
download | newspipe-d08cc46087d3349aff7b06908c70d97fecbdec8f.tar.gz newspipe-d08cc46087d3349aff7b06908c70d97fecbdec8f.tar.bz2 newspipe-d08cc46087d3349aff7b06908c70d97fecbdec8f.zip |
constructing feed from normal url also
Diffstat (limited to 'pyaggr3g470r/lib')
-rw-r--r-- | pyaggr3g470r/lib/utils.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pyaggr3g470r/lib/utils.py b/pyaggr3g470r/lib/utils.py index 041a2d29..6d6725c8 100644 --- a/pyaggr3g470r/lib/utils.py +++ b/pyaggr3g470r/lib/utils.py @@ -77,7 +77,7 @@ def construct_feed_from(url=None, fp_parsed=None, feed=None, query_site=True): response = requests.get(feed['site_link'], verify=False) bs_parsed = BeautifulSoup(response.content, 'html.parser', - parse_only=SoupStrainer('head')) + parse_only=SoupStrainer('head')) if not feed.get('title'): try: @@ -115,9 +115,8 @@ def construct_feed_from(url=None, fp_parsed=None, feed=None, query_site=True): alternate = bs_parsed.find_all(check_keys(rel=['alternate'], type=['application/rss+xml'])) if len(alternate) == 1: - feed['link'] = rebuild_url(alternate[0].attrs['href'], split) + feed['link'] = alternate[0].attrs['href'] elif len(alternate) > 1: - feed['link'] = rebuild_url(alternate[0].attrs['href'], split) - feed['other_link'] = [rebuild_url(al.attrs['href'], split) - for al in alternate[1:]] + feed['link'] = alternate[0].attrs['href'] + feed['other_link'] = [al.attrs['href'] for al in alternate[1:]] return feed |