GithubHelp home page GithubHelp logo

rainbowsixsiege-python-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rainbowsixsiege-python-api's Issues

Map Site Stats?

I'm new to the whole siege api thing so I'm not sure what the limitations are but is there anyway to collect Map stats? Like how often a site is selected in ranked/unranked. For example we all know on a map like bank where Open Area is the least favorable site compared to Basement, I was wondering if there was a way to get a number for it to express a percentage. I don't know if ubisoft has a number or not it would just be cool to know, thanks!

r6sapi.Operator.statistic always returns 0

I've been using this API to a discord hobby project and everything have been working awesome (so thanks for that!) with the exception that every time I try to find the 'statistic'-value for an operator it always returns 0. All other attributes return the expected value.

Ela update

Hello,
Getting statistics for Ela doesn't seem to work, is there any chance that this script could be updated to support her?

Thanks!

Larger inconsistency in operator values

For the biggest part this API works very well, thanks!

But I noticed many false values during my first few test runs.
I mainly tested with Smoke's values which were all over the place, his XP are those of Melusi, DBNOs are those of Maverick ...

Screenshot 2020-09-16 at 05 42 22

Just a few examples where the numbers just don't add up. I check my values with R6 Tracker.

Could this be a problem on my end as I e.g. haven't yet unlocked Melusi in the actual game?

If you could get in touch with me, I would love to learn how you gathered all the information for this API and maybe improve it.

Get K/D per season / current season

Is there any way to get the K/D from the current / past seasons?
Sure there is the total K/D over all season, but the current K/D would be more useful.

load_all_operators()

Hello,
im using your API for about half a year now.
Today i wanted to update to 0.8 to get the new operator stats (Clash and Mav).
I noticed that i didin't got any data for those two.

Could you please have a look at method => load_all_operators()
There is a for-loop => for operator in OperatorStatistics:
I don't see the two operators in OperatorStatistics list but i do see them in OperatorStatisticNames list.
So i changed the for-loop and now i got all data.

Could you please check if there is a fault in the script or maybe a fault on my understanding?!

Best regards
CRSLEE

GT "found" in DM, but not in Channel

There appears to be a case where r6 bot fails to find a user when messaged via channel, but via direct message the query is successful.

E.g.: Bodybag.Bees (uplay or xbox).

r6sapi uses a version of aiohttp that discord.py cannot use

Trying to push a Discord bot I made using the r6sapi to Heroku and I get an error saying r6sapi uses an older version of aiohttp (<3.0.0, >=2.3.3) which discord.py cannot use. Trouble is that on my PC when I run the bot myself, it works fine, then when I put it on a server it stops working. If I downgrade versions of discord.py and r6sapi to match aiohttp versions, all my code needs to be re-written because discord.py went through some massive changes in v1.0.0. Any suggestions would be great.

Error with caveira's statistics

using the library i noticed that caveira's dictionary in load_all_operators is always zero in all statistics
this is the dictionary:

{ 'dbnos': 0,
  'deaths': 0,   
  'headshots': 0, 
  'kills': 0,
  'losses': 0, 
  'melees': 0,
  'name': 'caveira',
  'statistic': 0,
  'statistic_name': 'Interrogations',
  'time_played': 0,
  'wins': 0,
  'xp': 0 }

Http error for all requests

r6sapi.exceptions.InvalidRequest: HTTP 403: The Service: RendezVous, is not currently available for Application 39baebad-39e5-4552-8c25-2c9b919064e2 on the Gateway.

Maintaining a logged in status

Is there a way that I could maintain a logged in status, maybe through an access token or something similar to prevent the api from blocking multiple calls?

I'm trying to run some tests on a script and I get blocked after a short period, presumably from logging in too many times.

Thanks in advance,

Tom

ASSAULT_RIFLE data and a few operator data mistake

I try to get the assault_rifle data, but all is 0. And I can get other weapon's data.
Like this:
'''
uplay_id luminous1111
name ASSAULT_RIFLE
weapon_type 0
kills 0
headshots 0
hits 0
shots 0
'''
'''
uplay_id luminous1111
name HANDGUN
weapon_type 4
kills 141
headshots 51
hits 941
shots 1400
'''
And I think some operators' data also have mistake.
For example:
'''
uplay_id luminous1111
name smoke
wins 1
losses 7
kills 66
deaths 52
'''
Why wins+losses < deaths ?
I find two S.A.S def operator(smoke and mute) data have mistake obviosly.

I use examples/player_batch_full_example.py, and I also get these incorrect data.

Unable to get rank for previous seasons

Whenever I use player.get_rank() and I specify a season number for something different than -1, I get an error:

File "C:\Program Files\Python37\lib\site-packages\r6sapi\auth.py", line 271, in get                                                                                                                                                             
    raise InvalidRequest("HTTP %s: %s" % (data["httpCode"], msg), code=data["httpCode"])                                                                                                                                                          
r6sapi.exceptions.InvalidRequest: HTTP 500: Uncaught exception

Hopefully someone can provide some insight as to what's going on!

Failed to connect

Traceback (most recent call last):
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 50, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "C:\Users\Matthew\Desktop\Projects\Python\Discord\Bots\Series\Laugh (All in one)\CogStats.py", line 66, in r6
    player = await auth.get_player(user, api.Platforms.UPLAY)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python36-32\lib\site-packages\r6sapi\r6sapi.py", line 522, in get_player
    results = yield from self.get_players(name=name, platform=platform, uid=uid)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python36-32\lib\site-packages\r6sapi\r6sapi.py", line 488, in get_players
    data = yield from self.get("https://public-ubiservices.ubi.com/v2/profiles?nameOnPlatform=%s&platformType=%s" % (parse.quote(name), parse.quote(platform)))
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python36-32\lib\site-packages\r6sapi\r6sapi.py", line 394, in get
    raise FailedToConnect
r6sapi.r6sapi.FailedToConnect

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
    yield from command.invoke(ctx)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 374, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python36-32\lib\site-packages\discord\ext\commands\core.py", line 54, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: FailedToConnect: 
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x06962970>```

I get this error when i run my command? any idea on whats wrong and how to fix?

Invalid credentials error not obvious

If you attempt to login with invalid credentials you're given a standard "FailedToConnect" error with no useful information. It'd be nicer if it would try and be more intelligent in its error reporting.

Authentication Deprecated.

When calling https://connect.ubi.com/ubiservices/v2/profiles/sessions, I seem to always get 404. I think Ubisoft has deprecated this endpoint and is now using another one.

Failed to connect to the rainbow six api

There is a red discord bot cog which uses your api, with success for quite some time now.
However, since the 3rd of november 2018, we get errors when we issue a request. It seems like public-ubiservices.ubi.com is dead, and the links should be updated accordingly. I can't do this as I have no idea where the new api is, or maybe it is a temporary issue, but it is strange that is is consistently happening for over a month now. isitdownrightnow reports that it is down for them as well and in my browser I can't connect as well. Is there anything we or you can do about this?

I Can't use get_player()

I call Auth.connect() return error

"Attempt to decode JSON with unexpected mimetype: text/html"

cause I can't use other function

Documentation broken?

For me, the readthedocs.com documentation is only showing headlines but nothing beneath. Looking into the rst file, it seems like the text is missing there too?

Update to Grim Sky (add Maverick & Clash)

NOTE: This issue is for when the new season gets released, for now this work doesn't need to be done since the changes are still in TTS.

I'm away for all of September, so won't be able to update the API to the latest season until October.
If anyone wants to do it themselves whilst I'm away, the following needs to be updated:

  • The url "https://ubistatic-a.akamaihd.net/0058/prod/assets/data/operators.3a2655c8.json" in get_operator_definitions. The number (3a2655c8) will need to be updated with whatever the latest version of this is. This can be found by logging in to the official rainbow statistics website and checking your network log for this file.

  • Two entries will need to be added to the OperatorStatisticNames dictionary (e.g. "CLASH": "enemies tazed"). It's not always clear what these statistic names are, you can just guess for now then fix it later if it's obviously wrong.

If anyone makes a PR with these changes, I have some access to internet during September so I should be able to merge it, otherwise I'll just do it when I get back.

Either way, pypi package won't be updated until I get back.

New operator link. But with error's

The new operator link in get_operator_defenitions() appears to be https://game-rainbow6.ubi.com/assets/data/operators.24b865895.json The only problem is ubi forgot to add the UniqueStatistic for Nomad and Kaid (they are there for Mozzie and Gridlock tho).
So unfortunatly the API throws an keyerror in get_operator_statistic() on the return.

My current workaround (not the most beautifull coding)
after these lines of code in get_operator_definitions():
resp = yield from self.session.get("https://game-rainbow6.ubi.com/assets/data/operators.bbbf29a090.json")
data = yield from resp.json()

I added:
resp_y4 = yield from self.session.get("https://game-rainbow6.ubi.com/assets/data/operators.24b865895.json")
data_y4 = yield from resp_y4.json()
data["mozzie"] = data_y4["mozzie"]
data["gridlock"] = data_y4["gridlock"]

and in OperatorStatisticNames{} I added"
"MOZZIE": "Drones Hacked", "GRIDLOCK": "Trax Deployed"

aiohttp version

could we get another upgrade of aiohttp version? For context I'm using this library with a discordpy chat bot, which requires aiohttp>=3.6.0,

currently this project is using aiohttp>=2.3.3,<3.0.0, so I was just wondering if there is a reason we haven't upgraded yet.

Remove unclosed client session warnings

Currently the Auth object creates a client session and will use it forever, without ever closing it

This issue should address both this and the fact that client sessions can go stale. Auth should preferably discard sessions when they go stale, or just periodically. Also there should be some way of more cleanly closing the auth session so you don't get annoying unclosed client session warnings.

load_rank and get_rank is not working

Hi, I am having a hard time fetching the Rank object.

##############################################################################
import asyncio
import r6sapi as api
operatorName="valkyrie"

def info():
auth = api.Auth("[email protected]", "mypassword")
player = yield from auth.get_player("NG-Bullseye", api.Platforms.UPLAY)
rank = yield from player.load_rank("EU")
print( "Player Skill: "+str(rank))

asyncio.get_event_loop().run_until_complete(info())

##############################################################################

ERROR MESSAGE:

C:\Users\leona\AppData\Local\Programs\Python\Python36\python.exe C:/Users/leona/OneDrive/Programmieren/Python/PycharmProjects/Telegram-Bot-master/R6Info.py
Traceback (most recent call last):
File "C:/Users/leona/OneDrive/Programmieren/Python/PycharmProjects/Telegram-Bot-master/R6Info.py", line 14, in
asyncio.get_event_loop().run_until_complete(info())
File "C:\Users\leona\AppData\Local\Programs\Python\Python36\lib\asyncio\base_events.py", line 468, in run_until_complete
return future.result()
File "C:/Users/leona/OneDrive/Programmieren/Python/PycharmProjects/Telegram-Bot-master/R6Info.py", line 9, in info
rank = yield from player.load_rank("EU")
File "C:\Users\leona\AppData\Local\Programs\Python\Python36\lib\site-packages\r6sapi\r6sapi.py", line 1104, in load_rank
data = yield from self.auth.get("https://public-ubiservices.ubi.com/v1/spaces/%s/sandboxes/%s/r6karma/players?board_id=pvp_ranked&profile_ids=%s&region_id=%s&season_id=%s" % (self.spaceid, self.platform_url, self.id, region, season))
File "C:\Users\leona\AppData\Local\Programs\Python\Python36\lib\site-packages\r6sapi\r6sapi.py", line 436, in get
raise InvalidRequest("HTTP Code: %s, Message: %s" % (data["httpCode"], msg), code=data["httpCode"])
r6sapi.r6sapi.InvalidRequest: HTTP Code: 404, Message: missing resource /public/r6karma/v1/players
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000025F2D32C940>

Process finished with exit code 1

Thanks in advance :)

Add data for new "Unranked" queue

Need to find out if this data is even available first - but hopefully it is and this shouldn't be a particularly large change.

Anyone's welcome to PR this if they feel like it, just comment that you're doing it.

basic example fails

Running python 3.7.3. Trying the basic example:

import asyncio
import r6sapi as api

@asyncio.coroutine
def run():
    auth = api.Auth("[email protected]", "secret_word")

    player = yield from auth.get_player("stone-flake", api.Platforms.UPLAY)
    operator = yield from player.get_operator("sledge")

    print(operator.kills)

asyncio.get_event_loop().run_until_complete(run())

throws:

C:\Users\r6>python sample.py
336
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000002A70E0E6FD0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x000002A70EA49390>, 108967.703)]', '[(<aiohttp.client_proto.ResponseHandler object at 0x000002A70EA58160>, 108968.687)]', '[(<aiohttp.client_proto.ResponseHandler object at 0x000002A70E9FB400>, 108969.234)]']
connector: <aiohttp.connector.TCPConnector object at 0x000002A70E9D9A20>

Not familiar w3ith asynio, so not sure where to even begin debugging. My login user/pwd pair is correct. If I try to login with intentionally bad credentials, I get a different fail:

r6sapi.exceptions.FailedToConnect: HTTP 401: Invalid credentials

Also, note, I pip install r6sapi into my conda environment. I saw that aiohttp was version 2.3.10. See in the git repository it's supposed to be >= 2.3.3. So I uninstalled, reinstalled it with 2.3.3 but I still get the identical error.

How to gain access to ubi services?

Hi, I can't find anywhere else to ask this so hopefully you can help.

I am currently writing an app that needs access to the ubi api. I noticed you are hitting this endpoint for the authentication:

https://connect.ubi.com/ubiservices/v2/profiles/sessions.

I also see a bunch of other end points prefixed with public, such as FETCH_STATISTIC = "https://public-ubiservices.ubi.com/v1/spaces/%s/sandboxes/%s/playerstats2/statistics?populations=%s&statistics=%s".

I am writing the app in in Node, so will need to make a small wrapper to handle all of this.

Any advice?

Not connecting (Unclosed client session)

I just installed your api and copied the example starter code into a new python file. The only thing I changed was my email and password, and the ingame username to look up. I saw the earlier issue here and tried the fixes you said, didn't work. The error I am getting when running the example script is:

78
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x102dabda0>

Why is this happening and how can I fix it?

EDIT: I am using python version 3.5.4.

Champions rank

Theres a problem with your api not showing the ranks correctly - gold IV is no longer in the game and the champion rank isnt shown, but diamond

Can't get examples to work, let alone the API

So if I am correct, the authentication uses valid uplay details which I have provided, however I believe I know the issue and I am wondering if it is the case.

I am currently running python 3.9, and a lot of the module is outdated, what python version should I be using, as none is specified

Typo for Blitz

No idea if this is the proper place to post this but doing a stat check of Blitz has a typo. instead of "Enemies Flashed" it says "Enemies Flahsed"

Operation Steel Wave might implicitly cause API changes

Intro

Today the new TS build should go live with Operation Steel Wave.
Normally after 3-4 Weeks of testing this makes it to the live build.

Yesterday in the reveal was shown that the MMR will be globalized, meaning that there is only one MMR rating instead of multiple ones for all the regions.

Quote from the Siege blog

A big change is coming to our Matchmaking Rating system. In order to prevent matchmaking abuses while switching regions, we will be changing to unified MMRs for each playlist. This means that you will not have different MMRs depending on the region you play in. However, your matchmaking ranking will remain separate in different playlists.

Source: https://www.ubisoft.com/en-us/game/rainbow-six/siege/game-info/seasons/steelwave

Implicit changes to the API may be involved

All this could mean that there are upcomming changes for the API.
They could be:

  1. Remove the region function entirely and collect all data in one common pool.
  2. Only merge the MMR via a new endpoint? So it is no longer available with the old requests.
  3. Or copy / sync the MMR across all the regions.

My guess would be that they are going for option 3, since it is properly the easiest to implement.
This would also mean that there are no real changes required for this project (if they keep it like it is)

So if anyone knows a dev or has a direct channel maybe we could get some infomation about that... :)

Also are there API endpoints for the TS avaiable where we could validate this claim?

What to do with rank region

await player.get_rank(region,season=-1,data=None)

This does not work saying region is not defined
when I delete region, it says I need it

Bot won't pull stats

When I attempt to get stats in my server the bot no longer will pull them. It only returns a message "Couldn't find any users matching ..."
r6bot

Error when you do 'pip install r6sapi'

Error when typing 'pip install r6sapi'

Output/Error:

`ERROR: Command errored out with exit status 1:
command: 'c:\users\zacis\appdata\local\programs\python\python37\python.exe' 'c:\users\zacis\appdata\local\programs\python\python37\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\zacis\AppData\Local\Temp\pip-build-env-f23exrcu\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (14 lines):
Traceback (most recent call last):
File "c:\users\zacis\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users\zacis\appdata\local\programs\python\python37\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "c:\users\zacis\appdata\local\programs\python\python37\lib\site-packages\pip_main
.py", line 16, in
from pip._internal import main as main # isort:skip # noqa
File "c:\users\zacis\appdata\local\programs\python\python37\lib\site-packages\pip_internal_init
.py", line 4, in
import locale
File "c:\users\zacis\appdata\local\programs\python\python37\lib\locale.py", line 16, in
import re
File "c:\users\zacis\appdata\local\programs\python\python37\lib\re.py", line 143, in
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'

ERROR: Command errored out with exit status 1: 'c:\users\zacis\appdata\local\programs\python\python37\python.exe' 'c:\users\zacis\appdata\local\programs\python\python37\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\zacis\AppData\Local\Temp\pip-build-env-f23exrcu\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.`

NOTE: My PIP and Python work fine; this is the only error I've had installing a package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.