From 52113f6ad0e8f438b2fa061250752c0630d973ca Mon Sep 17 00:00:00 2001 From: iou1name Date: Wed, 9 May 2018 18:34:41 -0400 Subject: [PATCH] fix filenames --- oppaiBot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oppaiBot.py b/oppaiBot.py index 4b026de..c7c42a9 100755 --- a/oppaiBot.py +++ b/oppaiBot.py @@ -35,7 +35,7 @@ class OppaiBot(irc.IRCClient): """ res = requests.get(url, cookies=self.cj, headers=HEADERS, verify=True) res.raise_for_status() - fname = re.search("filename=(.+)", res.headers['content-disposition']) + fname = re.search(r'filename="(.+)"',res.headers['content-disposition']) fname = fname.group(1) print("Saving torrent:", fname) with open(os.path.join(directory, fname), "wb") as file: