I am looking for a way to create a program to get real-time game data from live Dota2 games. In the official Dota2 client there are several ways of doing it. You can connect to a game server through DotaTV, you can join your friend's game or you can join a lobby as a spectator or a broadcaster before the game starts.
I think, all these ways use the same protocol to connect to a game server and to retrieve game data. So could you, please, propose any library for doing this? If there is no such a library, could you please give me some advice about how to create it by myself.
There is no library, but there is a console command _record file_name
which tells Dota2 client to write replay of the currently played or spectated game to file. Than you can parse this file using Dota2 replay parser (Skadistat Clarity for example). They already have example for realtime parsing.