Skip to content

Commit

Permalink
Handle file name with single or double quotes
Browse files Browse the repository at this point in the history
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
  • Loading branch information
emericg committed Nov 12, 2011
1 parent b799adb commit 3e37e6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gnome/opensubtitles-download.py
Expand Up @@ -202,6 +202,8 @@ def hashFile(path):
subDirName = os.path.dirname(moviePath)
subURL = subtitlesList['data'][subIndex]['SubDownloadLink']
subFileName = os.path.basename(moviePath)[:-3] + subtitlesList['data'][subIndex]['SubFileName'][-3:]
subFileName = subFileName.replace('"', '\\"')
subFileName = subFileName.replace("'", "\'")

# Download and unzip selected subtitle (with progressbar)
process_subDownload = subprocess.call('(wget -O - ' + subURL + ' | gunzip > "' + subDirName + '/' + subFileName + '") 2>&1 | zenity --progress --pulsate --title="Downloading subtitle, please wait..." --text="Downloading subtitle for \'' + subtitlesList['data'][0]['MovieName'] + '\' : "', shell=True)
Expand Down

0 comments on commit 3e37e6c

Please sign in to comment.