Need help with twitchclipmatchfinder?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

mdiller
164 Stars 7 Forks 46 Commits 0 Opened issues

Description

Finds a dota match when given a twitch clip

Services available

!
?

Need anything else?

Contributors list

# 217,421
dota
HTML
React
reddit-...
39 commits
# 619,339
Python
HTML
Shell
dota2
4 commits
# 355,664
Swift
intervi...
Xcode
ios11
1 commit

TwitchClipMatchFinder

This tool takes a twitch clip of someone playing dota and finds the match (match id) of dota that they were playing so you can get a dotabuff/opendota link or retrieve stats for it. I've created a reddit bot that automatically finds clips posted and gets matches for them: /u/DotaClipMatchFinder (The name is slightly different because TwitchClipMatchFinder was too many characters)

How it works

  • Get some info about the clip via the twitch api
  • Download the mp4 of the clip
  • Extract the first frame of the mp4 (using OpenCV)
  • Find the heroes in the top bar of the image
    • First, crop the image to only look at the top row where the heroes should be
    • Load all the hero images (plus arcana images)
    • Check if the hero is in the given image and if so, where (using OpenCV)
    • Filter out heroes that are in the wrong place in the image
    • Sort the results to get the 10 heroes that are most likely in this image in the right order
    • Do a bunch of other things to make sure we got the right heroes in the right places, because computers are bad at pattern detection
  • Use this opendota api endpoint to search for matches containing exactly this hero matchup
  • Pick the correct match out of the results based on which one has a start time closest to the time that the clip was taken

Libraries used

Usage

This library was built with the idea of using it as a reddit bot, which is its main use, but it can also be used separately to find specific clips. The

find_match
function in
finder.py
can be called to find the match for a given clip slug (the 'slug' is the bit at the end of the twitch clip url that is a bunch of words together.) The finder.py file can also be started directly if you give the clip slug as the argument. Here is an example for https://clips.twitch.tv/ExuberantBillowingHumanMau5:

I've also now added support for passing in youtube urls

> python finder.py ExuberantBillowingHumanMau5
finding for ExuberantBillowingHumanMau5
matched for the following heroes:
              Huskar:    (16, 8) {0   1.56} [0.9541687965393066]
         Lifestealer:    (79, 8) {1   1.56} [0.9161773920059204]
              Mirana:   (142, 8) {2   1.56} [0.9785874485969543]
             Abaddon:   (205, 8) {3   1.56} [0.9478229880332947]
                 Axe:   (268, 8) {4   1.56} [0.8044984340667725]
          Omniknight:   (539, 8) {5   0.77} [0.9744465351104736]
         Earthshaker:   (602, 8) {6   1.11} [0.929298460483551]
       Faceless Void:   (665, 8) {7   1.11} [0.9520202279090881]
           Pangolier:   (728, 8) {8   0.44} [0.9074560403823853]
             Phoenix:   (791, 8) {9   0.77} [0.966294527053833]
found match 4997200445
started 12 minutes before the clip was taken.
https://www.opendota.com/matches/4997200445

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.