Skip to content

Commit

Permalink
Add escaping of periods at the beginning of a movie title, to work
Browse files Browse the repository at this point in the history
around security mechanism in TMDB API.
  • Loading branch information
wagnerrp committed Jul 12, 2011
1 parent a38fd4f commit 1c34d57
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mythtv/bindings/python/MythTV/tmdb/tmdb_api.py
Expand Up @@ -591,7 +591,18 @@ def searchTitle(self, title, lang=False):
else:
URL = self.config[u'urls'][u'movie.search']
org_title = title

# strip out leading periods
if title.startswith('.'):
prepend = ''
for char in title:
if char != '.':
break
prepend += '\.'
title = prepend + title.lstrip('.')

title = urllib.quote(title.encode("utf-8"))

url = URL % (title)
if self.config['debug_enabled']: # URL so that raw TMDB XML data can be viewed in a browser
sys.stderr.write(u'\nDEBUG: XML URL:%s\n\n' % url)
Expand Down

0 comments on commit 1c34d57

Please sign in to comment.