From ea40a14d9095ef6bf64294df3d8c44085cc1666b Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 21 Jan 2015 19:36:58 +0800 Subject: [PATCH] Fix invalid addition of trailing slash to custom torrent RSS URLs --- CHANGES.md | 5 +++++ sickbeard/config.py | 4 ++-- sickbeard/webserve.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 12ef33a9..37b3baf2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +### 0.6.2 (2015-01-21 23:35:00 UTC) + +* Fix invalid addition of trailing slash to custom torrent RSS URLs + + ### 0.6.1 (2015-01-20 14:00:00 UTC) * Fix snatching from TorrentBytes provider diff --git a/sickbeard/config.py b/sickbeard/config.py index 322861d4..0dae4a1d 100644 --- a/sickbeard/config.py +++ b/sickbeard/config.py @@ -313,7 +313,7 @@ def clean_hosts(hosts, default_port=None): return cleaned_hosts -def clean_url(url): +def clean_url(url, add_slash=True): """ Returns an cleaned url starting with a scheme and folder with trailing / or an empty string @@ -330,7 +330,7 @@ def clean_url(url): if not path.endswith('/'): basename, ext = ek.ek(os.path.splitext, ek.ek(os.path.basename, path)) # @UnusedVariable - if not ext: + if not ext and add_slash: path = path + '/' cleaned_url = urlparse.urlunsplit((scheme, netloc, path, query, fragment)) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 0751421b..ddcf4e1d 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -2122,7 +2122,7 @@ class ConfigProviders(MainHandler): continue curName, curURL, curCookies = curTorrentRssProviderStr.split('|') - curURL = config.clean_url(curURL) + curURL = config.clean_url(curURL, False) newProvider = rsstorrent.TorrentRssProvider(curName, curURL, curCookies)