Coder Social home page Coder Social logo

Comments (5)

Eloncase avatar Eloncase commented on August 20, 2024 1

I've made a server for that purpose, currently hosting it here. Feel free to use it. Haven't really tested it much tho. I guess you could still implement a web scraping as a fallback option.

from rainbowsixsiege-python-api.

billy-yoyo avatar billy-yoyo commented on August 20, 2024 1

Added to last commit (1728a8f), will be in the next version. Thanks again @Eloncase.

from rainbowsixsiege-python-api.

Eloncase avatar Eloncase commented on August 20, 2024

Hi!
The only way I've found is to parse HTML and two JS files like this. Not sure if this is a good idea but it works

Basically what the function does is:

  • downloads html from https://game-rainbow6.ubi.com/
  • parses it for two js files (assets/scripts/main.<hash>.js and assets/scripts/vendor.<hash>.js)
  • downloads those two
  • parses the main js file for assets/data/operators.<hash>.json, assets/data/weapons.<hash>.json and assets/data/seasons.<hash>.json
  • parses the vendor js file for assets/locales/locale.<lang_tag>.<hash>.json

from rainbowsixsiege-python-api.

billy-yoyo avatar billy-yoyo commented on August 20, 2024

Yeah I think that's the only realistic way of doing it - problem is we'd need people to do this web scraping every time people start the library, unless we implement some permanent cashing which I'm hesitant to do.

I think unless I can find a solution which only requires a single request, and a small amount computation, I'm going to keep it how it is right now.

A possible alternative is I host a file somewhere which has the hashes, the library downloads that file, and I can update it automatically using this kind of method.

from rainbowsixsiege-python-api.

billy-yoyo avatar billy-yoyo commented on August 20, 2024

Wow, thanks a bunch! I'll implement it on the API asap (over this weekend). Yeah, I'll fall back on either web scraping or a hard coded hash, might do both and let the user decide which one to use.

from rainbowsixsiege-python-api.

Related Issues (20)

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.