Code Monkey home page Code Monkey logo

cod-python-api's Introduction

Hi there, I'm Todo Lodo! ๐Ÿ‘‹

I'm a passionate Full Stack Developer with a love for creative problem-solving and building fun projects. My expertise spans across a variety of technologies, and I'm always excited to explore new languages and frameworks.

wakatime github

๐Ÿš€ Quick Overview

  • ๐Ÿ”ญ I'm currently working on anan-chat.
  • ๐ŸŒฑ I'm learning Electron.js.
  • ๐Ÿ’ฌ Ask me about Python, Node.js, TypeScript, HTML, CSS, and more!
  • ๐Ÿ“ซ How to reach me: LinkedIn

โšก Technologies & Tools

Python Node.js TypeScript HTML5 CSS3 C

๐Ÿ› ๏ธ Projects

Here are some of my notable projects:

๐ŸŒ Connect with Me

Let's connect! Feel free to reach out for collaborations, discussions, or just to say hello.

LinkedIn

๐Ÿš€ Open for Collaboration

I'm always open to collaborate on interesting projects and contribute to the developer community. If you have an idea or need assistance, let's create something awesome together!

Happy coding! ๐Ÿš€

cod-python-api's People

Contributors

engineer152 avatar lierrmm avatar todolodo avatar werseter avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cod-python-api's Issues

aiohttp.client_exceptions.ClientConnectorCertificateError

Program would not connect to CallOfDuty.com

To Reproduce
Steps to reproduce the behavior:
Script:
`from cod_api import API, platforms

api = API()

api.login(ID)

profile = api.Warzone.fullData(platforms.PSN, "mypsn") # returns data of type dict

printing results to console

print(profile)`

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Retrieving full data using Activision platform does not find user. (Any COD Game)

This is a valid Activision account, (I tried a few more Activision accounts and they also did not work)
I of course can go the playstation route and retrieve the data that way, however the Activision un is more universal and reliable

Reproduction code:
import asyncio

from cod_api import API, platforms
async def main():
# initiating the API class
api = API()
api.login('haha')

# retrieving combat history
profile = await api.ColdWar.fullData(platforms.Activision, "ARKillsZombies#6873354") # returns data of type dict
# printing results to console
print(profile)

asyncio.run(main())

Console Output

{'status': 'error', 'data': {'type': 'com.activision.mt.common.stdtools.exceptions.NoStackTraceException', 'message': 'Not permitted: user not found'}}

Unable to access combatHistory data for ModernWarfare2 or any other game title

Describe the bug
Unable to access combatHistory data for any of the game titles, result produces the following: {'status': 'success', 'data': {}}

To Reproduce
Steps to reproduce the behavior:

  1. Run the following code to obtain combatHistory for ModernWarfare2 (or any game title):

`
from cod_api import API, platforms
import asyncio

api = API()

api.login('sso_token') #this has been replaced with my account sso_cookie

profile = api.ModernWarfare2.combatHistory(platforms.Battlenet, "Username#1234") #this has been replaced with my username

print(profile)
`

  1. After running this code with my username and SSO token correctly inserted I receive the results {'status': 'success', 'data': {}}
  2. I have ensured my username and sso_token are correct by running fullData instead of combat history and had data returned

Expected behavior
After ensuring my sso_token and username are correct by running other parameters such as fullData and getting data returned and playing the game extensively on this account, I would expect the combat history for ModernWarfare2, or any other game, to be returned. I would like to take this combat history data and dashboard my own combat record, with more insightful metrics than what is provided from the standard combat record provided by Call of Duty in game.

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version Windows 10

Additional context
Please let me know if there is a bug in my code or if I am misunderstanding some aspects. My end goal would be to receieve my raw, per game combat history

Support for Warzone 3 and MW3

Great lib! WZ3 is out, can we have support for Warzone 3 and MW3 ?

I tried to do it myself by doing this

    class __WZ3(__GameDataCommons):
        """
        Warzone 3 class: A class to get players warzone 3 stats, warzone 3 combat history and specific warzone 3 match details
            classCategory: game
            gameId/gameTitle: mw or wz
            gameType: wz2

        """

        @property
        def _game(self) -> str:
            return "mw3"

        @property
        def _type(self) -> str:
            return "wz3"

        async def seasonLootAsync(self, platform, gamertag):
            raise InvalidEndpoint

        async def mapListAsync(self, platform):
            raise InvalidEndpoint

However i get the following error :

{'status': 'error', 'data': {'type': 'com.activision.mt.common.stdtools.exceptions.NoStackTraceException', 'message': 'Error from datastore'}}

'platforms' is not defined

Hi, while testing the API I got this error:

profile = api.ModernWarfare2.fullData(platforms.Battlenet, "TAG")
NameError: name 'platforms' is not defined

Is it a known issue by any chance ?

It doesn't work with other games aswell.

Thanks by advance !

RuntimeError: Event loop is closed

Describe the bug

When I run the first few lines of the tutorial, i get a RuntimeError.

Here is my code :

  _import asyncio, datetime, requests, twine, urllib3, uuid, sphinx
  
  from cod_api import API, platforms
  api = API()
  api.login("USERS-SSO-TOKEN-EDITED-BY-TODOLODO-TO-HIDE-IT")
  profile = api.ModernWarfare2.fullData(platforms.PSN, "SkyRRoZ")
  print(profile)_

Here is the output:

  _C:\Users\youso\PycharmProjects\pythonProject56\venv\Scripts\python.exe C:/Users/youso/PycharmProjects/pythonProject56/main.py
  {'status': 'error', 'data': {'type': 'com.activision.mt.common.stdtools.exceptions.NoStackTraceException', 'message': 'Not permitted: not allowed'}}
  Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000023BF6492200>
  Traceback (most recent call last):
    File "C:\Users\youso\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
      self.close()
    File "C:\Users\youso\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
      self._loop.call_soon(self._call_connection_lost, None)
    File "C:\Users\youso\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 750, in call_soon
      self._check_closed()
    File "C:\Users\youso\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
      raise RuntimeError('Event loop is closed')
  RuntimeError: Event loop is closed
  
  Process finished with exit code 0_

To Reproduce
Steps to reproduce the behavior:

Just connect to the API and print any player profile.

Expected behavior
I expected to get the full data on the player named "SkyRRoZ"

Screenshots

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser : None, Pycharm local
  • Version : Python 3

Additional context

TypeError when using the Friend List func or any other.

Hi! I went to do some tests involving your project and I came across an error when trying to use any of the functions, in this case below it was using the list of friends. Another thing, can I use the same cookie every time or do I need to collect it before using it?

Exception has occurred: TypeError
'NoneType' object is not iterable
File "C:\Users\Santa Kaya\Desktop\cod-python-api-2.0.1\cod_api_init_.py", line 556, in info
for i in rawData['identities']:
File "C:\Users\Santa Kaya\Desktop\cod-python-api-2.0.1\cod_api_init_.py", line 567, in _priv
d = self.info()
File "C:\Users\Santa Kaya\Desktop\cod-python-api-2.0.1\cod_api_init
.py", line 610, in settingsAsync
p, g = self._priv()
File "C:\Users\Santa Kaya\Desktop\cod-python-api-2.0.1\cod_api_init
.py", line 615, in settings
return asyncio.run(self.settingsAsync())
File "C:\Users\Santa Kaya\Desktop\cod-python-api-2.0.1\main.py", line 11, in
settings = api.Me.settings() # returns data of type dict

https://prnt.sc/pw9YVARChv_E

Authentication fails (Platform: Activision)

To reproduce:

api = API()
api.login('<sso_token_goes_here>')
data = api.ModernWarfare2.fullData(gamertag="<username goes here>", platform=platforms.Activision)
return JsonResponse({"stats": data})

The above code is part of an API endpoint on my server that is invoked via GET. Testing it with Postman yields the following response:

{
    'status': 'error', 
    'data': {
        'type": 'com.activision.mt.common.stdtools.exceptions.NoStackTraceException', 
        'message': 'Error from datastore'
    }
}

Expected behavior
The above endpoint with the correct credentials (i.e SSO token) should yield a successful response.

Desktop (please complete the following information):

  • OS: Ubuntu 220.4 (Python3.10)
  • Browser: Chrome
  • Version 110.0.5481.77

Additional context
I have confirmed that I am using:

Support for CODM also pls

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

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.