diff --git a/gen_feed.py b/gen_feed.py index 23bcf06..86c6224 100644 --- a/gen_feed.py +++ b/gen_feed.py @@ -80,7 +80,13 @@ def generate_feed(town_url, feed_url, feed_path): print(f"Found {len(small_articles)} articles...") for small_article in small_articles: t = small_article.find_all("span")[1].text - link = "https://" + main_domain + small_article.find("a").get("href") + if small_article.find("a").get("href").startswith("https"): + link = small_article.find("a").get("href") + else: + link = "https://" + main_domain + small_article.find("a").get("href") + if "/videos/" in link: + print(f" Skipping {link} since it's a video") + continue is_paid = len(small_article.find_all("span", class_="flagPaid")) > 0 articles.append(Article(t, link, is_paid))