fix filenames
This commit is contained in:
parent
3fd1e9db7b
commit
52113f6ad0
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user