From 3fabb8e2f6a6ae3643882a10c19d7794b99c524d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 12 Jan 2022 16:18:54 +0000 Subject: [PATCH] Simplify --- newswire.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/newswire.py b/newswire.py index b25267bfc..274b24ab3 100644 --- a/newswire.py +++ b/newswire.py @@ -471,7 +471,6 @@ def xml_podcast_to_dict(xml_str: str) -> {}: def _get_link_from_rss_item(rss_item: str) -> str: """Extracts rss link from rss item string """ - link = None if ' str: ('"audio/' in enclosure or '"video/' in enclosure): link_str = enclosure.split('url="')[1] if '"' in link_str: - link_str = link_str.split('"')[0] - if '://' in link_str: - link = link_str + link = link_str.split('"')[0] + if '://' in link: + return link - if not link: - link = rss_item.split('')[1] - link = link.split('')[0] - if '://' not in link: - return None + link = rss_item.split('')[1] + link = link.split('')[0] + if '://' not in link: + return None return link