Skip to content
Browse files

Add escaping of periods at the beginning of a movie title, to work

around security mechanism in TMDB API.
  • Loading branch information...
1 parent a38fd4f commit 1c34d57bf2b5a862fb12d4e7600a8173cb8bd682 @wagnerrp wagnerrp committed Jul 11, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 mythtv/bindings/python/MythTV/tmdb/tmdb_api.py
View
11 mythtv/bindings/python/MythTV/tmdb/tmdb_api.py
@@ -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)

0 comments on commit 1c34d57

Please sign in to comment.
Something went wrong with that request. Please try again.