overwatch-api icon indicating copy to clipboard operation
overwatch-api copied to clipboard

Documentation

Open eniallator opened this issue 7 years ago • 5 comments

Hey, I just found your api for overwatch and I'm wondering if there's any documentation for it anywhere? I checked the github wiki and there doesn't seem to be anything there :P

eniallator avatar Dec 06 '17 17:12 eniallator

Afaik the only documentation is what I wrote in example_test.py. You could also just experiment with the code, but since it's async that might not be the easiest thing to do.

Drummersbrother avatar Dec 06 '17 17:12 Drummersbrother

Ok. thanks for the quick reply, I've just tested running that example code as python however it's come up with a timeout error, is that expected? if so is there some updated code that I can run/understand? :P

eniallator avatar Dec 06 '17 17:12 eniallator

It was quite a while ago I wrote that code, but please provide the full traceback of the timeouterror so I can try debugging it. I do have some other code that uses this library, but it's probably less understandable than the example code unfortunately.

6 dec. 2017 kl. 18:57 skrev eniallator [email protected]:

Ok. thanks for the quick reply, I've just tested running that example code as python however it's come up with a timeout error, is that expected? if so is there some updated code that I can run/understand? :P

― You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Drummersbrother avatar Dec 06 '17 20:12 Drummersbrother

Sorry for the late reply. I just tested it again and it ran up until a point where it's getting another error (it was probably the overwatch servers going down).

Testing......[get_profile]
Testing......[get_profile]
Testing......[get_stats]
Testing......[get_stats]
Traceback (most recent call last):
  File "c:/Users/niall/Documents/Python scripts/overwatch_test.py", line 45, in <module>
    loop.run_until_complete(testing(loop))
  File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 467, in run_until_complete
    return future.result()
  File "c:/Users/niall/Documents/Python scripts/overwatch_test.py", line 33, in testing
    data[XBOX] = await client.get_stats("Danielfrogs#2552", session=session, platform=XBOX)
  File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\overwatch_api\core.py", line 57, in decorated_func
    return await func(*args, _session=session, **kwargs)
  File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\overwatch_api\core.py", line 72, in decorated_func
    request_timeout=request_timeout, **kwargs)
  File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\overwatch_api\core.py", line 108, in get_stats
    request_timeout=request_timeout)
  File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\overwatch_api\core.py", line 194, in _base_request
    _async_timeout_seconds=request_timeout
  File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\overwatch_api\core.py", line 235, in _async_get
    return await response.json(), response.status
  File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 795, in json
    headers=self.headers)
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8'```

eniallator avatar Dec 08 '17 17:12 eniallator

Hmmm 🤔, I don't know why you're getting that error... maybe the actual api has changed and it's receiving a 404 page or similar. Unfortunately I'm not able to guarantee any debugging of this, but if I get the time, I'll try to find and fix it. If you want to, you could help by isolating which api functions do work and which don't (try them all a couple of times, one by one), and please post the results in this issue.

8 dec. 2017 kl. 18:19 skrev eniallator [email protected]:

Sorry for the late reply. I just tested it again and it ran up until a point where it's getting another error (it was probably the overwatch servers going down).

Testing......[get_profile] Testing......[get_profile] Testing......[get_stats] Testing......[get_stats] Traceback (most recent call last): File "c:/Users/niall/Documents/Python scripts/overwatch_test.py", line 45, in loop.run_until_complete(testing(loop)) File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 467, in run_until_complete return future.result() File "c:/Users/niall/Documents/Python scripts/overwatch_test.py", line 33, in testing data[XBOX] = await client.get_stats("Danielfrogs#2552", session=session, platform=XBOX) File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\overwatch_api\core.py", line 57, in decorated_func return await func(*args, _session=session, **kwargs) File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\overwatch_api\core.py", line 72, in decorated_func request_timeout=request_timeout, **kwargs) File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\overwatch_api\core.py", line 108, in get_stats request_timeout=request_timeout) File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\overwatch_api\core.py", line 194, in _base_request _async_timeout_seconds=request_timeout File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\overwatch_api\core.py", line 235, in _async_get return await response.json(), response.status File "C:\Users\niall\AppData\Local\Programs\Python\Python36-32\lib\site-packages\aiohttp\client_reqrep.py", line 795, in json headers=self.headers) aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8'``` — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Drummersbrother avatar Dec 08 '17 18:12 Drummersbrother