Extract highlights from professional Dota 2 matches.
A few minutes of nostalgia. Click on image to view the video.
- Update video preview picture (add play icon)
- Write the final notebook
- Refactor youtube.py
- Add youtube to docker-compose or move to another repo
- Write tests
Create a .env
file and select your os platform. There are two possible choices right now:
- linux
- macos
touch .env
echo OS_PLATFORM=macos >> .env
Run Docker containers.
docker-compose --env-file .env up
Each match in Dota 2 has a Match ID. You can find it at the end of Dotabuff links or in the game client.
For example: 6676393091 with Dotabuff: https://dotabuff.com/matches/6676393091.
Notice: Replays of non-professional matches are stored for 2 weeks.
To retrieve an URL of the match replay
curl -X GET http://localhost:8000/retrieve/6676393091
Or just follow the link: http://localhost:8000/retrieve/6676393091.
curl -X GET 'http://localhost:8000/parse?url=http://replay161.valve.net/570/6676393091_316408452.dem.bz2'
The process takes about a minute, depends on the internet connection and compute resources.
To extract highlights from the match replay.
curl -X GET http://localhost:8000/getHighlights/6676393091
Or just follow the link: http://localhost:8000/getHighlights/6676393091.
python3 -m virtualenv env
source env/bin/activate
pip install -r requirements.txt
jupyter lab
Open notebooks/piterpy.ipynb
and follow the instructions.
Parser repo: https://github.com/arch1baald/clarity-parser
Rebuild API
docker-compose up -d --build --no-deps api
sh scripts/run_clarity.sh
sh scripts/run_workers.sh
Open a new terminal window
source env/bin/activate
sh scripts/run_server.sh
Retrieve replay URLs by Tournament ID (Could be found at the end of Dotabuff links). The result will be saved to replays/urls.txt
python scripts/retrieve_match_urls.py --tournament 13256 --limit 15
Parse match by URL
curl -X GET 'http://localhost:8000/parse?url=http://replay191.valve.net/570/6216665747_89886887.dem.bz2'
Parse first match from urls.txt
curl -X GET -G 'http://localhost:8000/parse' -d url=$(head -n 1 replays/urls.txt)
Parse all matches from urls.txt
python scripts/parse_from_urls.py