diff --git a/oppaiBot.py b/oppaiBot.py index d2e7997..c4a71cc 100755 --- a/oppaiBot.py +++ b/oppaiBot.py @@ -22,9 +22,8 @@ class OppaiBot(irc.IRCClient): self.nickname = self.config["nickname"] self.username = self.config["ident"] - cookies_txt = self.config["cookies_txt"] - self.cookies = http.cookiejar.MozillaCookieJar(cookies_txt) - self.cookies.load() + self.cj = http.cookiejar.MozillaCookieJar(self.config["cookies_txt"]) + self.cj.load() self.watch_dir = self.config["watch_dir"] @@ -33,8 +32,7 @@ class OppaiBot(irc.IRCClient): """ Downloads and saves the torrent file to the given directory. """ - res = requests.get(url, cookies=self.cookies, headers=HEADERS, - verify=True) + res = requests.get(url, cookies=self.cj, headers=HEADERS, verify=True) res.raise_for_status() fname = re.search("filename=(.+)", res.headers['content-disposition']) fname = fname.group(1) @@ -52,7 +50,7 @@ class OppaiBot(irc.IRCClient): # More advanced logic is left as an exercise to the reader. if "English" in message or "Dual Language" in message: url = message.split(" - ")[1].split(" / ")[1] - save_torrent(url, self.watch_dir) + self.save_torrent(url, self.watch_dir) def joined(self, channel):