fix filenames

This commit is contained in:
iou1name 2018-05-09 18:34:41 -04:00
parent 3fd1e9db7b
commit 52113f6ad0

View File

@ -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: