import requests import re import socket import time import sys import urllib3 import json urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) try: import config keys = config.__dir__() if "vt_key" in keys: vt_key = config.vt_key else: vt_key = "" if "sec_keys" in keys: #是数组,这个接口只有第个月只有50次,需要多个key sec_keys = config.sec_keys else: sec_keys = [] except: print("未发现接口key") class subdomain: def __init__(self): self.api_list = [ { 'method': 'get', 'url': "https://site.ip138.com/{target}/domain.htm",
@classmethod def configure(cls, channel, pm=False): cls.channel = channel cls.pm = pm def prepare(self, content): self.content = content async def onReady(self): await self.joinChannel(self.channel) time.sleep(1) func = getattr(self, 'sendPM' if self.pm else 'sendMessage') await func(self.channel, self.content) time.sleep(5) self.stop() import config import sys logging.basicConfig(level=logging.DEBUG) BanchoPoster.configure(config.irc_channel, config.pm) bot = BanchoPoster(nickname=sys.argv[1], token=sys.argv[2]) bot.prepare(sys.argv[3]) with open('debug-poster.txt', 'w') as f: f.write(str(sys.argv)) f.write(str(config.__dir__())) f.write(str(bot)) bot.run()