exaphis / hackq-trivia Goto Github PK
View Code? Open in Web Editor NEWYet another HQ Trivia bot. Automatically scrapes HQ Trivia questions without OCR and answers them.
License: MIT License
Yet another HQ Trivia bot. Automatically scrapes HQ Trivia questions without OCR and answers them.
License: MIT License
Was wondering, if you could modify this slightly to get cash show questions?
During the last game, the websocket_handler
threw an error when trying to print the answers it retrieved.
File "/Users/cwong/Desktop/Dropbox/Github/hq-hint/networking.py", line 64, in websocket_handler print(answers) UnicodeEncodeError: 'ascii' codec can't encode character '\xe1' in position 7: ordinal not in range(128)
Hi,
I’ve been looking at your HQ trivia bot and its something id love to use, however I known next to nothing about coding and was wondering if there was any chance you would be willing to send a really simple method of what I need to do to access and use this bot. I have tried to put it all together but I honestly have no clue what to do. If you can’t help don’t worry but I thought it was worth asking.
Thanks,
Lawrence
You need to have websocket-client as well
I don't understand how to get all of the modules and run the bot
Would it be possible to amend the code slightly to use this with Cash Show?
Search method 3 takes about 20seconds to show results
Its not tallying possibilities its only guessing the first possible answer
I have received this while trying to run it during a show.
getting
Show active, connecting to socket at https://ws-quiz.hype.space/ws/44342
Traceback (most recent call last):
File "C:\Users\Dinge\Desktop\HackQ-Trivia-master\HackQ-Trivia-master\hq_main.py", line 51, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\Dinge\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 468, in run_until_complete
return future.result()
File "C:\Users\Dinge\Desktop\HackQ-Trivia-master\HackQ-Trivia-master\networking.py", line 45, in websocket_handler
async with session.ws_connect(uri, headers=headers, heartbeat=5) as ws:
TypeError: ws_connect() got an unexpected keyword argument 'heartbeat'
Can you please make a similar bot for Loco trivia
I tried this on the UK version this afternoon but it just said show not on, do I need my own bearer token and user id or is there a different http address to connect to the game please?
please tell me how to add connection settings file and then how to add the bearer token and user id. i have the bearer token and the user id. please tell me fast
Can you please explain how to do set this up?
i don't know where is the conn_settings.txt file or how to locate it. please tell me.
second thing is whenever i use
usage: python3 hq_main.py in python 3.6 version it shows a syntax error.
please help me with these two steps.
I am having trouble figuring out what a bearer token and user id is, and how I can find them. Everything else works perfectly normal. If you could help me out by telling me how to find them and sniff a phone server, or even just giving me a link to a tutorial that would be nice. Thank You.
It only works for US it seems as its not pulling my UK game times.
how do I run it or what do I click
I get this error after entering python hq-main.py
C:\Users\dylri\AppData\Local\Programs\Python\Python36-32\python.exe: can't open file 'hq-main.py': [Errno 2] No such file or directory
Can you please make a video on it? I feel like it will help everyone from getting confused.
I am working on finishing up my Swift version of this cheat, and I was wondering if there was a way for me to read the log in a JSON type format (with all the right indentations/spacing) so that it is easy to read the structure because I can't debug when the game isn't live. Let me know if you have any programs that do this. Thanks.
best_answer = __search_method1(search_text, answers, reverse)
if best_answer == "":
best_answer = __search_method2(search_text, answers, reverse)
# best_answer = __search_method3(question_keywords, answers, reverse)
If I wanted to add search method 3 as well to have all of them display just to get a greater chance of answering a question correctly, could I do something like this for the answer_question function:
def answer_question(question, answers):
print("Searching")
start = time.time()
answers = list(map(lambda x: x.translate(punctuation_to_none), answers))
reverse = "NOT" in question or ("least" in question.lower() and "at least" not in question.lower())
question_keywords = search.find_keywords(question)
print(question_keywords)
search_results = search.search_google(" ".join(question_keywords), 5)
print(search_results)
# Parallelize access of found URLs
search_text = Parallel(n_jobs=cpu_count())(delayed(get_no_punctuation_text)(url) for url in search_results)
best_answer1 = __search_method1(search_text, answers, reverse)
best_answer2 = __search_method2(search_text, answers, reverse)
best_answer3 = __search_method3(question_keywords, answers, reverse)
print("Search took {} seconds".format(time.time() - start))
return best_answer1 + best_answer2 + best_answer3
and then printing this in the hq_main file:
print(question.answer_question(question_s, answers))
or would I have to change something?
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
I am trying to find my bearer token using a proxy but whenever I get the data it is just a jumbled mess. I have tried using Fiddler 2, Charles Proxy, and Postman, but whatever I do either HQ just wont load the data or when it does capture it it just looks like a bunch of random characters. Any ideas?
On most of the questions I get a lot of error code popping up before method 1 statrt. It still provides an answer, but makes everything messy and harder to find. Also, on a side note, why isn't method 2 running? (i haven't changed any of the code)
Here is an example:
Question detected.
Question 1 out of 12
According to the old song “Row, Row, Row Your Boat,” life is but a what?
['Dream', 'Massive phoenix tattoo', 'Bitcoin scam']
Searching
['Dream', 'Massive phoenix tattoo', 'Bitcoin scam']
['according', 'old', 'song', 'row, row, row your boat,', 'life']
['https://en.wikipedia.org/wiki/Row,_Row,_Row_Your_Boat', 'https://www.youtube.com/watch?v=EDrVCqeZIAY', 'http://sausedo.net/2012/10/25/the-truth-about-row-row-row-your-boat/', 'http://thedailyranter.com/articles/things-people-dont-realize/2013/11/10/row-row-row-your-boat-is-a-totally-twisted-fucked-up-song', 'https://mudcat.org/thread.cfm?threadid=21766']
Server timeout/error to http://sausedo.net/2012/10/25/the-truth-about-row-row-row-your-boat/
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\Topher\Documents\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 783, in aenter
self._resp = await self._coro
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 333, in _request
await resp.start(conn, read_until_eof)
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 708, in start
self._continue = None
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 670, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\Users\Topher\Documents\HackQ-Trivia\hq_main.py", line 47, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 454, in run_until_complete
self.run_forever()
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 421, in run_forever
self._run_once()
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 1431, in _run_once
handle._run()
File "C:\Users\Topher\AppData\Local\Programs\Python\Python36-32\lib\asyncio\events.py", line 145, in _run
self._callback(*self._args)
File "C:\Users\Topher\Documents\HackQ-Trivia\networking.py", line 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)
Running method 1
{'dream': 32, 'massive phoenix tattoo': 0, 'bitcoin scam': 0}
dream
Question nouns: ['row, row, row your boat,']
Running method 3
Search processed
URLs fetched
Dream: {'row, row, row your boat,': 0}
Massive phoenix tattoo: {'row, row, row your boat,': 0}
Bitcoin scam: {'row, row, row your boat,': 0}
Keyword scores: {'Dream': 36, 'Massive phoenix tattoo': 9, 'Bitcoin scam': 9}
Noun scores: {'Dream': 0, 'Massive phoenix tattoo': 0, 'Bitcoin scam': 0}
Dream
getting this error
Show active, connecting to socket at https://ws-quiz.hype.space/ws/44256
Connected
Traceback (most recent call last):
File "C:\Users\test\Desktop\HackQ-Trivia-master\hq_main.py", line 51, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Program Files\Python36\lib\asyncio\base_events.py", line 467, in run_until_complete
return future.result()
File "C:\Users\test\Desktop\HackQ-Trivia-master\networking.py", line 56, in websocket_handler
raise RuntimeError("Connection settings invalid")
RuntimeError: Connection settings invalid
It's hard to find the answer in the result below. Could you perhaps update the script to highlight the answer or show it in a different colour?
`Question detected.
Question 9 out of 12
The fashion brand Opening Ceremony once put on a play co-written by what actor?
['Jonah Hill', 'Chloë Sevigny', 'Jesse Eisenberg']
Searching
['Jonah Hill', 'Chloe Sevigny', 'Jesse Eisenberg']
['fashion', 'brand', 'opening', 'ceremony', 'put', 'play', 'co', 'written', 'actor']
['https://www.vanityfair.com/style/2014/09/opening-ceremony-new-york-fashion-week-jonah-hill', 'http://www.dazeddigital.com/fashion/article/21578/1/read-an-exclusive-interview-with-jonah-hill-and-spike-jonze', 'http://www.dazeddigital.com/fashion/article/21259/1/spike-jonze-is-staging-a-play-for-opening-ceremony-ss15', 'http://creativity-online.com/work/opening-ceremonyspike-jonze-100-lost-cotton/37077', 'https://en.wikipedia.org/wiki/Opening_Ceremony_(brand)']
Running method 1
{'jonah hill': 39, 'chloe sevigny': 1, 'jesse eisenberg': 0}
jonah hill
[('The', 'DT'), ('fashion', 'NN'), ('brand', 'NN'), ('Opening', 'NNP'), ('Ceremony', 'NNP'), ('once', 'RB'), ('put', 'VBD'), ('on', 'IN'), ('a', 'DT'), ('play', 'NN'), ('co-written', 'JJ'), ('by', 'IN'), ('what', 'WP'), ('actor', 'NN'), ('?', '.')]
Question nouns: ['fashion brand opening ceremony']
Running method 3
Search processed
URLs fetched
Jonah Hill: {'fashion brand opening ceremony': 0}
Chloë Sevigny: {'fashion brand opening ceremony': 0}
Jesse Eisenberg: {'fashion brand opening ceremony': 0}
Keyword scores: {'Jonah Hill': 48, 'Chloë Sevigny': 68, 'Jesse Eisenberg': 83}
Noun scores: {'Jonah Hill': 0, 'Chloë Sevigny': 0, 'Jesse Eisenberg': 0}
Jonah Hill
Search took 7.578475713729858 seconds
Socket closed
Show active, connecting to socket at https://ws-quiz.hype.space/ws/44181
Connected`
Also, I'm still getting errors every now and then and I'm already using the latest version.
`Question detected.
Question 10 out of 12
Which of these products was originally developed for surgical use?
['Listerine', 'Bengay', 'VapoRub']
Searching
['Listerine', 'Bengay', 'VapoRub']
['products', 'originally', 'developed', 'surgical', 'use']
['http://mentalfloss.com/article/29840/6-hugely-successful-products-originally-invented-something-else', 'https://en.wikipedia.org/wiki/Surgical_instrument', 'https://en.wikipedia.org/wiki/Joseph_Lister', 'https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1356187/', 'https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1121442/']
Server timeout/error to http://mentalfloss.com/article/29840/6-hugely-successful-products-originally-invented-something-else
--- Logging error ---
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 782, in aenter
self._resp = await self._coro
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 407, in _request
break
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 661, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
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 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)
Server timeout/error to https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1121442/
--- Logging error ---
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 782, in aenter
self._resp = await self._coro
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 332, in _request
await resp.start(conn, read_until_eof)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 691, in start
self._continue = None
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 661, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
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 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)
Server timeout/error to https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1356187/
--- Logging error ---
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 782, in aenter
self._resp = await self._coro
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 332, in _request
await resp.start(conn, read_until_eof)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 691, in start
self._continue = None
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 661, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
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 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)
Running method 1
{'listerine': 2, 'bengay': 0, 'vaporub': 0}
listerine
[('Which', 'NNP'), ('of', 'IN'), ('these', 'DT'), ('products', 'NNS'), ('was', 'VBD'), ('originally', 'RB'), ('developed', 'VBN'), ('for', 'IN'), ('surgical', 'JJ'), ('use', 'NN'), ('?', '.')]
Question nouns: ['use']
Running method 3
Search processed
Server timeout/error to https://www.more.com/lifestyle/exercise-health/12-surprising-uses-vicks-vaporub
--- Logging error ---
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 782, in aenter
self._resp = await self._coro
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 332, in _request
await resp.start(conn, read_until_eof)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 691, in start
self._continue = None
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 661, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
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 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)
Server timeout/error to https://vicks.com/en-us/safety-and-faqs/faqs/vicks-vaporub-faq
--- Logging error ---
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 13, in fetch
async with session.get(url, timeout=timeout) as response:
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 782, in aenter
self._resp = await self._coro
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client.py", line 332, in _request
await resp.start(conn, read_until_eof)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 691, in start
self._continue = None
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\helpers.py", line 661, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 992, in emit
msg = self.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 838, in format
return fmt.format(record)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 575, in format
record.message = record.getMessage()
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging_init_.py", line 338, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
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 17, in fetch
logging.error(type(e), e)
Message: <class 'concurrent.futures._base.TimeoutError'>
Arguments: (TimeoutError(),)`
Ok sniffed my IPhone with success got my user packets with the info and found 2 long strings under the deviceTokens. Are these the bearer token (top) and user id (bottom)? http://prntscr.com/iuekmr
I'm confused on where to put the bearer token and the user I'd in the conn settings file. I have the file, and I have the bearer token and the user ID. I am just confused on where to put them in the file. Thanks for your help! Also, I was wondering how accurate is it?
Thanks a lot for sharing this! Thought I had everything working, but I appear to have done something wrong with installing or importing nltk (see image for error). I had added...
import nltk
nltk.download("stopwords")
nltk.download("averaged_perceptron_tagger")
...to the top of hq_main.py instead of executing those lines beforehand, as I was having trouble getting them to run in terminal (for example, after trying to execute "import nltk" in the terminal, I received "-bash: import: command not found"). The following was outputted to the terminal, which made me think this approach would work:
"[nltk_data] Downloading package stopwords to
[nltk_data] /Users/JohnSmith/nltk_data...
[nltk_data] Package stopwords is already up-to-date!
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] /Users/JohnSmith/nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!
New to using the command line here, so sorry for what I'm guessing is a rookie mistake.
I am recreating this in Swift for MacOS, and have some questions.
I didn't understand:
# Remove control characters in the WebSocket message
message = re.sub(r"[\x00-\x1f\x7f-\x9f]", "", message)
message_data = json.loads(message)
logging.info(str(message_data))
in your Python version, so if you could clear that up for me (how to get questions/answer) I would appreciate it!
PS: I have noticed that you can still watch the game without being signed into an account so I don't think you would need authentication to do so (and user ID)...
This may have just been me, but one of the sites visited was a direct link to a PDF, and it froze the program.
Example
Which of these country is NOT in Europe?
A. Spain
B. France
C. India
The correct answer is C, but the bot will definitely say A or B.
The bot need to deliver the answer that has the lowest score.
I am getting some short of issue? If you can give me some information on how to fix this.
getting
Show active, connecting to socket at https://ws-quiz.hype.space/ws/44326
Traceback (most recent call last):
File "C:\Users\Dinge\Desktop\HackQ-Trivia-master\hq_main.py", line 51, in
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\Dinge\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 468, in run_until_complete
return future.result()
File "C:\Users\Dinge\Desktop\HackQ-Trivia-master\networking.py", line 45, in websocket_handler
async with session.ws_connect(uri, headers=headers, heartbeat=5) as ws:
TypeError: ws_connect() got an unexpected keyword argument 'heartbeat'
Getting this error, any idea where the issue lies? :-)
python3 hq_main.py
getting
Show not on.
Traceback (most recent call last):
File "hq_main.py", line 37, in
next_time = datetime.strptime(response_data["nextShowTime"], "%Y-%m-%dT%H:%M:%S.000Z")
KeyError: 'nextShowTime'
Gave this a try today, got 9/12. Impressive!
I'm at the step where I need to Enter a Bearer Token and UserID. I don't know how/where to find those, and what purpose they serve. Can anyone assist me?
HI,
I opened up the file in python, but I can't get passed the part to import nltk. I don't have the nltk file and don't know where to find it
Hey I have sniffed the traffic for loco trivia. Please tell how to modify this script for loco trivia.
It will be more helpful if you provide the modified script.
I input the bearer and token id in the conn_settings txt from https://github.com/gjacobs314/HQTrivia.
The bot is working great but are you able to add other shows such as 'Cash Show', 'The Q' and 'SwagIQ'? I can share the sniffed data if that is needed?
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.