Skip to content

Commit

Permalink
Merge pull request midgetspy#560 from thezoggy/dev--tvdb-FQDN
Browse files Browse the repository at this point in the history
Use FQDN for thetvdb url
  • Loading branch information
midgetspy committed Jan 4, 2013
2 parents f8b76f9 + 79e521b commit a078394
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sickbeard/webapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ def __init__(self, args, kwargs):
def run(self):
""" search for show at tvdb with a given string and language """
if self.name and not self.tvdbid: # only name was given
baseURL = "http://thetvdb.com/api/GetSeries.php?"
baseURL = "http://www.thetvdb.com/api/GetSeries.php?"
params = {"seriesname": str(self.name).encode('utf-8'), 'language': self.lang}
finalURL = baseURL + urllib.urlencode(params)
urlData = sickbeard.helpers.getURL(finalURL)
Expand Down
8 changes: 4 additions & 4 deletions sickbeard/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ def getTVDBLanguages(self):
if 'en' in result:
del result[result.index('en')]
result.sort()
result.insert(0,'en')
result.insert(0, 'en')

return json.dumps({'results': result})

Expand All @@ -1513,7 +1513,7 @@ def searchTVDBForShowName(self, name, lang="en"):
if not lang or lang == 'null':
lang = "en"

baseURL = "http://thetvdb.com/api/GetSeries.php?"
baseURL = "http://www.thetvdb.com/api/GetSeries.php?"
nameUTF8 = name.encode('utf-8')

logger.log(u"Trying to find Show on thetvdb.com with: " + nameUTF8.decode('utf-8'), logger.DEBUG)
Expand All @@ -1535,7 +1535,7 @@ def searchTVDBForShowName(self, name, lang="en"):

finalURL = baseURL + urllib.urlencode(params)

logger.log(u"Searching for Show with searchterm: \'" + searchTerm.decode('utf-8')+ u"\' on URL " + finalURL, logger.DEBUG)
logger.log(u"Searching for Show with searchterm: \'" + searchTerm.decode('utf-8') + u"\' on URL " + finalURL, logger.DEBUG)
urlData = helpers.getURL(finalURL)

if urlData is None:
Expand All @@ -1549,7 +1549,7 @@ def searchTVDBForShowName(self, name, lang="en"):

except Exception, e:
# use finalURL in log, because urlData can be too much information
logger.log(u"Unable to parse XML for some reason: "+ex(e)+" from XML: "+finalURL, logger.ERROR)
logger.log(u"Unable to parse XML for some reason: " + ex(e) + " from XML: " + finalURL, logger.ERROR)
series = ''

# add each result to our list
Expand Down

0 comments on commit a078394

Please sign in to comment.