diff options
Diffstat (limited to 'imdb-lookup/imdblookup.py')
-rwxr-xr-x | imdb-lookup/imdblookup.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/imdb-lookup/imdblookup.py b/imdb-lookup/imdblookup.py index f6d7ff5..788350c 100755 --- a/imdb-lookup/imdblookup.py +++ b/imdb-lookup/imdblookup.py @@ -54,7 +54,7 @@ def read_filename(filename): return name.replace(u".", u" ") def write_filename(filename): - return re.sub(u"[^a-zA-Z123 ]", u"_", filename) + return re.sub(u"[^a-zA-Z0-9()\- _#]", u"_", filename) class FocusableFrame(urwid.Frame): def keypress(self, size, key): @@ -126,7 +126,7 @@ class UI(urwid.WidgetWrap): info = self.search_service.info(movie_id) alt_titles = self.search_service.alternative_titles(movie_id)["titles"] info["year"] = info["release_date"].split("-")[0] - info["filename"] = u"{title} ({year}) #{imdb_id}".format(**info) + info["filename"] = write_filename(u"{title} ({year}) #{imdb_id}".format(**info)) btn = urwid.Button(("fetched", u"{title} ({year}) #{imdb_id}".format(**info))) urwid.connect_signal(btn, "click", self.rename, info) self.model.insert(pos+1, btn) |