(self, body)
return s_podcast_url, s_episode_url, update_urls
Parse and normalize the URLs from the request
Parse and normalize the URLs from the request
Parse and normalize the URLs from the request
def get_urls(self, body):
        """Parse and normalize the URLs from the request"""
        podcast_url = body.get("podcast", "")
        episode_url = body.get("episode", "")

        if not podcast_url:
            raise RequestException("Podcast URL missing")

        if not episode_url:
            raise RequestException("Episode URL missing")

        update_urls = []

        # podcast sanitizing
        s_podcast_url = normalize_feed_url(podcast_url)
        if s_podcast_url != podcast_url:
            update_urls.append((podcast_url, s_podcast_url or ""))

        # episode sanitizing
        s_episode_url = normalize_feed_url(episode_url, "episode")
        if s_episode_url != episode_url:
            update_urls.append((episode_url, s_episode_url or ""))

        return s_podcast_url, s_episode_url, update_urls
def get_urls ( self , body ) : podcast_url = body . get ( "podcast" , "" ) episode_url = body . get ( "episode" , "" ) if not podcast_url : raise RequestException ( "Podcast URL missing" ) if not episode_url : raise RequestException ( "Episode URL missing" ) update_urls = [ ] # podcast sanitizing s_podcast_url = normalize_feed_url ( podcast_url ) if s_podcast_url != podcast_url : update_urls . append ( ( podcast_url , s_podcast_url or "" ) ) # episode sanitizing s_episode_url = normalize_feed_url ( episode_url , "episode" ) if s_episode_url != episode_url : update_urls . append ( ( episode_url , s_episode_url or "" ) ) return s_podcast_url , s_episode_url , update_urls