From 64ced635cc3916978ccd266d4f79e15618426489 Mon Sep 17 00:00:00 2001 From: Jason Schwarzenberger Date: Thu, 12 Nov 2020 17:15:29 +1300 Subject: [PATCH] fix mistake. --- apiserver/feeds/news.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apiserver/feeds/news.py b/apiserver/feeds/news.py index ab0fd11..bc54e6d 100644 --- a/apiserver/feeds/news.py +++ b/apiserver/feeds/news.py @@ -248,7 +248,7 @@ class Category(_Base): self.tz = tz self.category_url = url - def _filter_links(self, links, excludes=None): + def _filter_links(self, links, category_url, excludes=None): links = list(filter(None, [link if link.startswith(category_url) else None for link in links])) links = list(filter(None, [link if link != category_url else None for link in links])) links = list(set(links)) @@ -264,7 +264,7 @@ class Category(_Base): links = soup.find_all('a', href=True) links = [link.get('href') for link in links] links = [f"{base_url}{link}" if link.startswith('/') else link for link in links] - links = self._filter_links(links, excludes) + links = self._filter_links(links, category_url, excludes) return links def feed(self, excludes=None):