Exaphis / HackQ-Trivia

Yet another HQ Trivia bot. Automatically scrapes HQ Trivia questions without OCR and answers them.
MIT License
89 stars 54 forks source link

No answers #16

Closed Helpme0822 closed 6 years ago

Helpme0822 commented 6 years ago

Hey I just tried your trivia bot but for every answer i always got 0 matches i think something was wrong with the searching urls could you please help me

Exaphis commented 6 years ago

Could you post a screenshot of the problem?

Helpme0822 commented 6 years ago

Unfortunately I already closed the window :/

Exaphis commented 6 years ago

No problem. If this issue occurs again please screenshot it and post it in this issue.

Helpme0822 commented 6 years ago

I got again the issue and here is the screenshot of an example: sans titre1

Helpme0822 commented 6 years ago

So?

Helpme0822 commented 6 years ago

now i just get this sans titre2

Exaphis commented 6 years ago

That is incredibly strange. As for the "Server response not JSON" message, the HQ servers might be overloaded. I'll be looking into this issue further.

Helpme0822 commented 6 years ago

Okay but actually the thing with the json file is fine because it works again the problem is more with that what I send on the other picture

Exaphis commented 6 years ago

Yep, that's what I was saying above. The "Server response not JSON" is probably just due to HQ.

Helpme0822 commented 6 years ago

Okay keep me informed then if you have any news please

Helpme0822 commented 6 years ago

So any news?

chaoscreater commented 6 years ago

I'm getting the following:

Show active, connecting to socket at https://ws-quiz.hype.space/ws/44151
Connected

Question detected.
Question 10 out of 12
In the Bible, which son of Jacob has the same mother as Joseph?
['Benjamin', 'Levi', 'Simeon']

Searching
['Benjamin', 'Levi', 'Simeon']
['bible', 'son', 'jacob', 'mother', 'joseph']
['https://en.wikipedia.org/wiki/Rachel', 'https://en.wikipedia.org/wiki/Jacob', 'https://en.wikipedia.org/wiki/Simeon_(son_of_Jacob)', 'http://www.aboutbibleprophecy.com/p34.htm', 'https://www.lds.org/scriptures/gs/joseph-son-of-jacob?lang=eng']
Running method 1
{'benjamin': 29, 'levi': 18, 'simeon': 57}
simeon

Traceback (most recent call last):
  File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in <module>
    asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
  File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 467, in run_until_complete
    return future.result()
  File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 66, in websocket_handler
    print(await question.answer_question(question_str, answers))
  File "W:\HQ Trivia\HackQ-Trivia\question.py", line 67, in answer_question
    key_nouns.update(search.find_nouns(question, num_words=5, reverse=True))
  File "W:\HQ Trivia\HackQ-Trivia\search.py", line 33, in find_nouns
    tokens = word_tokenize(text)
  File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\tokenize\__init__.py", line 128, in word_tokenize
    sentences = [text] if preserve_line else sent_tokenize(text, language)
  File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\tokenize\__init__.py", line 94, in sent_tokenize
    tokenizer = load('tokenizers/punkt/{0}.pickle'.format(language))
  File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\data.py", line 834, in load
    opened_resource = _open(resource_url)
  File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\data.py", line 952, in _open
    return find(path_, path + ['']).open()
  File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\data.py", line 673, in find
    raise LookupError(resource_not_found)
LookupError: 
**********************************************************************
  Resource punkt not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('punkt')
  
  Searched in:
    - 'C:\\Users\\Blah/nltk_data'
    - 'C:\\nltk_data'
    - 'D:\\nltk_data'
    - 'E:\\nltk_data'
    - 'C:\\Users\\Blah\\AppData\\Local\\Programs\\Python\\Python36-32\\nltk_data'
    - 'C:\\Users\\Blah\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\nltk_data'
    - 'C:\\Users\\Blah\\AppData\\Roaming\\nltk_data'
    - ''
**********************************************************************

>>> import nltk

>>> nltk.download("stopwords")

[nltk_data] Downloading package stopwords to
[nltk_data]     C:\Users\Blah\AppData\Roaming\nltk_data...
[nltk_data]   Package stopwords is already up-to-date!
True
>>> nltk.download("averaged_perceptron_tagger")

[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data]     C:\Users\Blah\AppData\Roaming\nltk_data...
[nltk_data]   Package averaged_perceptron_tagger is already up-to-
[nltk_data]       date!
True
Exaphis commented 6 years ago

Try downloading punkt as well. Will be adding this to the README.

chaoscreater commented 6 years ago

How do you download it? I'm quite new to this. What I've done is create a file called requirements.txt and add the following in there:

aiohttp bs4 nltk unidecode

Then I run this: pip install -r requirements.txt

And it works fine. I tried doing the same thing by just adding punkt into requirements.txt and it says this:

Collecting punkt (from -r requirements.txt (line 1)) Could not find a version that satisfies the requirement punkt (from -r requirements.txt (line 1)) (from versions: ) No matching distribution found for punkt (from -r requirements.txt (line 1))

NVM, just saw your updated readme.

Helpme0822 commented 6 years ago

Any news for my problem @Exaphis ?

chaoscreater commented 6 years ago

Still not working.

image

`Question detected. Question 10 out of 12 Workers throughout Victoria, Australia get a day off every November for what sporting event? ['Cricket match', 'Horse race', 'Rugby game']

Searching ['Cricket match', 'Horse race', 'Rugby game'] ['workers', 'throughout', 'victoria', 'australia', 'get', 'day', 'every', 'november', 'sporting', 'event'] ['http://www.traveller.com.au/no-contest-why-melbourne-is-the-nations-sporting-capital-gus8fc', 'http://www.visitmelbourne.com/United-Kingdom/Sports-and-events', 'http://www.visitvictoria.com/Events/Sports', 'https://en.wikipedia.org/wiki/Public_holidays_in_Australia', 'https://en.wikipedia.org/wiki/Victoria_(Australia)'] Server timeout/error to http://www.visitvictoria.com/Events/Sports Running method 1 {'cricket match': 0, 'horse race': 0, 'rugby game': 0} Running method 2 {'Cricket match': {'cricket': 11, 'match': 4}, 'Horse race': {'horse': 2, 'race': 12}, 'Rugby game': {'rugby': 8, 'game': 6}} Cricket match

[('Workers', 'NNS'), ('throughout', 'IN'), ('Victoria', 'NNP'), (',', ','), ('Australia', 'NNP'), ('get', 'VB'), ('a', 'DT'), ('day', 'NN'), ('off', 'IN'), ('every', 'DT'), ('November', 'NNP'), ('for', 'IN'), ('what', 'WP'), ('sporting', 'VBG'), ('event', 'NN'), ('?', '.')] Question nouns: ['australia', 'workers', 'victoria'] Running method 3 Search processed URLs fetched

Cricket match: {'australia': 59, 'workers': 0, 'victoria': 0} Horse race: {'australia': 16, 'workers': 0, 'victoria': 1} Rugby game: {'australia': 28, 'workers': 0, 'victoria': 0}

Keyword scores: {'Cricket match': 75, 'Horse race': 64, 'Rugby game': 73} Noun scores: {'Cricket match': 59, 'Horse race': 17, 'Rugby game': 28} Cricket match Search took 9.303157091140747 seconds

--- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f45f' in position 151: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(*args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f625' in position 255: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f622' in position 151: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-170: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-209: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-219: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-167: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 187-189: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-152: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 149-162: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f458' in position 151: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, *kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging\init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f372' in position 166: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(*args, *kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. Socket closed

Show active, connecting to socket at https://ws-quiz.hype.space/ws/44171 Connected --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-164: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(*args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-161: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f372' in position 165: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-288: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Message: {'type': 'interaction', 'ts': '2018-03-21T01:11:15.827Z', 'itemId': 'chat', 'userId': 13614025, 'metadata': {'userId': 13614025, 'message': '⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️⚽️', 'avatarUrl': 'https://d2xu1hdomh3nrx.cloudfront.net/72x72/default_avatars/Untitled-1_0001_blue.png', 'interaction': 'chat', 'username': 'BDoom12'}, 'sent': '2018-03-21T01:11:15.834Z'} Arguments: () --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-219: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f422' in position 165: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-227: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(args, *kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once handle._run() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run self._callback(self._args) File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 52, in websocket_handler logging.info(message_data) Unable to print the message and arguments - possible formatting error. Use the traceback above to help find the error. --- Logging error --- Traceback (most recent call last): File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging\init__.py", line 994, in emit stream.write(msg) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 239-244: character maps to Call stack: File "", line 1, in File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 144, in main ret = method(*args, **kwargs) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\idlelib\run.py", line 474, in runcode exec(code, self.locals) File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() Traceback (most recent call last): File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers)) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete self.run_forever() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever self._run_once() File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1395, in _run_once event_list = self.selector.select(timeout) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\selectors.py", line 323, in select r, w, = self._select(self._readers, self._writers, [], timeout) File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\selectors.py", line 314, in _select r, w, x = select.select(r, w, w, timeout)`

Exaphis commented 6 years ago

@chaoscreater, the issue should be fixed in commit https://github.com/Exaphis/HackQ-Trivia/commit/06fce8d8a6490a13d29e55df4e99b159ce05f412. Please create a new issue if the problem persists.

Exaphis commented 6 years ago

@Helpme0822 I have added a new debugging measure for your issue. Update this issue with your log file when the problem happens again.

Helpme0822 commented 6 years ago

@Exaphis thanks is it also possible to somehow connect this bot to the UK version of HQ Trivia I tried to enter the Bearer Token and ID of an UK user but i'm still connected on the US HQ Trivia

Exaphis commented 6 years ago

I have no clue how to connect to the UK version of HQ since I am in the US. Any help would be appreciated.

Exaphis commented 6 years ago

No response for 6 days, assuming solved. Let me know if this issue occurs again.