esibun / hitbox-irc-proxy Goto Github PK
View Code? Open in Web Editor NEWIRC proxy for Hitbox.tv
License: GNU General Public License v3.0
IRC proxy for Hitbox.tv
License: GNU General Public License v3.0
I tried your script for xchat on linux. What's the client irc configuration ? 127.0.0.1:6667 ?
Seems like they changed the format for most of their API. This is not PR-worthy, since I only did half the work (I only need the library to send messages to a channel), but this fixes sending messages and general connectivity.
Things that need to happen:
Ubuntu 14.04 with Python and other requirements installed.
If i start python hitbox-irc.py, there is no console output and i can't connect. If i press CTRL+C on console it shows following messages:
Traceback (most recent call last):
File "hitbox-irc.py", line 484, in
IRCServer()
File "hitbox-irc.py", line 28, in init
self._HandleClients()
File "hitbox-irc.py", line 38, in _HandleClients
self._HandleOutgoing()
File "hitbox-irc.py", line 44, in _HandleOutgoing
data = self._connection.recv(4096).decode('UTF-8').split('\r\n')[:-1]
File "/usr/lib/python2.7/encodings/utf_8.py", line 15, in decode
def decode(input, errors='strict'):
KeyboardInterrupt
If i try to run it with python3 hitbox-irc.py then i receive this error message:
Traceback (most recent call last):
File "hitbox-irc.py", line 1, in
import copy, json, random, requests, socket, time
ImportError: No module named 'requests'
If i now edit hitbox-irc.py
from: data = self._connection.recv(4096).decode('UTF-8').split('\r\n')[:-1]
to: data = self._connection.recv(4096).decode('UTF-8').split('\r\n')[:-1]
i could connect to proxy, but dont see any chat messages in MIRC which are send by users in the chat. But i see following error messages on console:
Exception in thread WebSocketClient:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(_self.__args, *_self.__kwargs)
File "/usr/lib/python2.7/dist-packages/ws4py/websocket.py", line 427, in run
if not self.once():
File "/usr/lib/python2.7/dist-packages/ws4py/websocket.py", line 305, in once
if not self.process(b):
File "/usr/lib/python2.7/dist-packages/ws4py/websocket.py", line 377, in process
self.received_message(s.message)
File "hitbox-irc.py", line 316, in received_message
self._irc.HitboxMessage(str(message))
File "hitbox-irc.py", line 178, in HitboxMessage
self._hitboxChat[channel].names(channel)
KeyError: u'ashk0retv'
In addition, if i write in MIRC i don't see any output in hitbox chat, but i can see on console that the proxy received the messages i typed in MIRC.
When moderator status changes, the user will PART then JOIN the channel in addition to the mode string applying.
Example:
foo JOINS the channel
make foo mod
foo PARTS the channel
foo JOINS the channel
irc sets mode +h foo
remove foo's mod
foo PARTS the channel
foo JOINS the channel
Hi,
Spaces seems to be eaten up when a message is sent from IRC to Hitbox.
Replacing this line with t = " ".join(tok[1:])[1:]
seems to work but I'm not sure of the implications of this change.
I can't join my chatroom. Connection to server is ok. See console output.
Runs on: Ubuntu 14.04 with Python 3.4
Installed: aiohttp, requests, websockets, asyncio
I upgraded all python 3.4 modules with --upgrade switch.
python3 hitbox_irc_server.py
2016-05-12 04:54:42,139 - asyncio - DEBUG - Using selector: EpollSelector
2016-05-12 04:54:42,150 - main - INFO - Serving requests on ('0.0.0.0', 7778)
2016-05-12 04:54:44,248 - irc - INFO - Connection from ('10.10.1.182', 50791)
2016-05-12 04:54:44,257 - irc - INFO - << CAP LS
2016-05-12 04:54:44,258 - irc - DEBUG - Unknown command cap(['LS'])
2016-05-12 04:54:44,258 - irc - INFO - << PASS ***
2016-05-12 04:54:44,259 - irc - DEBUG - Calling on_pass (synchronously)
2016-05-12 04:54:44,259 - irc - DEBUG - Pass set to ***
2016-05-12 04:54:44,259 - irc - INFO - << NICK ashk0reTV
2016-05-12 04:54:44,259 - irc - DEBUG - Calling on_nick (synchronously)
2016-05-12 04:54:44,260 - irc - DEBUG - Nick set to ashk0reTV
2016-05-12 04:54:44,260 - irc - INFO - << USER ashk0reTV 0 * :...
2016-05-12 04:54:44,260 - irc - DEBUG - Calling on_user (synchronously)
2016-05-12 04:54:44,261 - irc - DEBUG - Logging in user ashk0reTV
2016-05-12 04:54:44,261 - token - DEBUG - Making request to /auth/login
2016-05-12 04:54:44,815 - token - INFO - Login successful!
2016-05-12 04:54:44,816 - token - INFO - Your authentication token is: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2016-05-12 04:54:44,817 - asyncio - ERROR - Exception in callback _SelectorSocketTransport._read_ready()
handle: <Handle _SelectorSocketTransport._read_ready()>
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run
self._callback(_self._args)
File "/usr/lib/python3.4/asyncio/selector_events.py", line 669, in _read_ready
self._protocol.data_received(data)
File "hitbox_irc_server.py", line 63, in data_received
func(tok[1:])
File "hitbox_irc_server.py", line 99, in on_user
self.authenticate()
File "hitbox_irc_server.py", line 231, in authenticate
asyncio.ensure_future(self.welcome())
AttributeError: 'module' object has no attribute 'ensure_future'
2016-05-12 04:55:09,626 - irc - INFO - << JOIN #ashk0reTV
2016-05-12 04:55:09,626 - irc - DEBUG - Calling on_join
2016-05-12 04:55:09,627 - asyncio - ERROR - Exception in callback _SelectorSocketTransport._read_ready()
handle: <Handle _SelectorSocketTransport._read_ready()>
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run
self._callback(_self._args)
File "/usr/lib/python3.4/asyncio/selector_events.py", line 669, in _read_ready
self._protocol.data_received(data)
File "hitbox_irc_server.py", line 68, in data_received
asyncio.ensure_future(func(tok[1:]))
AttributeError: 'module' object has no attribute 'ensure_future'
2016-05-12 04:55:53,249 - irc - INFO - << JOIN #ashk0reTV
2016-05-12 04:55:53,249 - irc - DEBUG - Calling on_join
2016-05-12 04:55:53,250 - asyncio - ERROR - Exception in callback _SelectorSocketTransport._read_ready()
handle: <Handle _SelectorSocketTransport._read_ready()>
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run
self._callback(*self._args)
File "/usr/lib/python3.4/asyncio/selector_events.py", line 669, in _read_ready
self._protocol.data_received(data)
File "hitbox_irc_server.py", line 68, in data_received
asyncio.ensure_future(func(tok[1:]))
AttributeError: 'module' object has no attribute 'ensure_future'
2016-05-12 04:56:43,486 - irc - INFO - << PING :TIMEOUTCHECK
2016-05-12 04:56:43,486 - irc - DEBUG - Unknown command ping([':TIMEOUTCHECK'])
2016-05-12 04:57:28,764 - main - INFO - Interrupted, closing connections...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.