GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bombsimon/hltv-python: 📺 HLTV live score implementation with Socket.IO

BranchesTags
Open more actions menu

Latest commit

 

History

36 Commits
36 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
scorebot
scorebot
 
 
.gitignore
.gitignore
 
 
.pylintrc
.pylintrc
 
 
DOCUMENTATION.md
DOCUMENTATION.md
 
 
LICENSE
LICENSE
 
 
Pipfile
Pipfile
 
 
Pipfile.lock
Pipfile.lock
 
 
README.md
README.md
 
 

Repository files navigation

HLTV Livescore

This is a HLTV livescore implementation in Python. It feels super weird that I don't find any implementations for this but I might be bad at looking. The two JavaScript versions I found helped me understand and get inspiration.

Borrowed with pride from:

  • Nols1000/hltv-scorebot
  • andrewda/hltv-livescore (wraps above linked)
  • osebrwn/csgo-livescore (wraps above linked)

Might integrate with other Python libraries in the future, such as

  • SocksPls/hltv-api

Documentation

General documentation about the Socket.IO streams can be found in DOCUMENTATION.md

Live scoring

So HLTV uses Socket.IO to stream the data they get from Valve and ESL (I think?). This data is pushed on a socket. See DOCUMENTATION for server information.

I actually have a really (really) hard time finding any documentation at all regarding this socket. Is it official? Is it documented? How's it rate limited? What events are pushed, how and when, and with what data? Because of this I've tried to document my findings in DOCUMENTATION.md.

This implementation

Luckily there's a great library named python-socketio which makes it easy for me to read from the socket. All I need to do after connecting is to parse the stream. ✌🏼

Usage

import asyncio
from scorebot import Livescore

async def on_kill(frag):
    print("{} killed {}".format(frag.killer.name, frag.victim.name))

async def main():
    ls = Livescore(123456)
    ls.on(ls.EVENT_KILL, on_kill)

    socket = await ls.socket()
    await socket.wait()


if __name__ == "__main__":
    asyncio.run(main())

See examples folder for an implementation creating a kill feed.

About

📺 HLTV live score implementation with Socket.IO

Topics

counter-strikecounter-strike-global-offensivecsgohacktoberfesthltvlivescorescorebot

Resources

Readme
MIT license
Activity

Stars

19 stars

Watchers

4 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.