Browse Source

first commit!

master
mb@mb 7 years ago
parent
commit
84017f64f9
  1. BIN
      files/SpYFTy_nQyyxcNkUKniWdw.jpg
  2. BIN
      files/jyTSOwDEQCaqKHnDdHeNow.jpg
  3. 8
      streambot.py

BIN
files/SpYFTy_nQyyxcNkUKniWdw.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

BIN
files/jyTSOwDEQCaqKHnDdHeNow.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 KiB

8
streambot.py

@ -14,15 +14,15 @@ parser.add_argument("-j", "--jid", help="jabber identifier", type=str, required=
parser.add_argument("-p", "--password", help="password", type=str, required=True) parser.add_argument("-p", "--password", help="password", type=str, required=True)
parser.add_argument("-m", "--muc", help="destination muc", type=str, required=True) parser.add_argument("-m", "--muc", help="destination muc", type=str, required=True)
parser.add_argument("-n", "--nick", help="nickname of the bot", default="archivist", type=str) parser.add_argument("-n", "--nick", help="nickname of the bot", default="archivist", type=str)
parser.add_argument("-o", "--output", help="output folder", default="files", type=str)
args = parser.parse_args() args = parser.parse_args()
class ArchivistBot(ClientXMPP): class ArchivistBot(ClientXMPP):
def __init__(self, jid, password, room, nick): def __init__(self, jid, password, room, nick, output):
ClientXMPP.__init__(self, jid, password) ClientXMPP.__init__(self, jid, password)
self.datadir = 'files/' self.datadir = output
self.room = room self.room = room
self.nick = nick self.nick = nick
@ -95,7 +95,7 @@ if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG, format='%(levelname)-8s %(message)s') logging.basicConfig(level=logging.DEBUG, format='%(levelname)-8s %(message)s')
client = ArchivistBot(args.jid, args.password, args.muc, args.nick) client = ArchivistBot(args.jid, args.password, args.muc, args.nick, args.output)
if client.connect(): if client.connect():
client.process(block=True) client.process(block=True)

Loading…
Cancel
Save