outside-edge / python-espncricinfo

Python wrapper for the ESPNCricInfo JSON API
MIT License
144 stars 65 forks source link

method to fetch Commentary for the match #29

Closed prasanna-sk closed 4 years ago

prasanna-sk commented 5 years ago

I am trying to see if I can get the full ball-by-ball commentary of the match.

With match ID - I thought get_comms_json() will do the trick. But, unfortunately, it doesn't return any value.

>>> from espncricinfo.match import Match
>>> m = Match('1175356')
>>> m.match_url
'http://www.espncricinfo.com/matches/engine/match/1175356.html'
>>> m.comms_json
>>>

Is it possible/feasible to get the full commentary in json format? If not, guess I ll have to start working on a scraper. Thanks for your work.

dwillis commented 5 years ago

@prasanna-sk They may have changed the structure of the json, so let me check and report back. From what I recall the commentary json was paginated.

nayangarg commented 5 years ago

@dwillis the json is indeed paginated. But there's an issue over there. I cannot find a way to detect when there was a stoppage in play and the number of overs got reduced.

prasanna-sk commented 5 years ago

@nayangarg Were you able to pull the commentary though?

nayangarg commented 5 years ago

@prasanna-sk Yes, I did. I didn't use this package though.

prasanna-sk commented 5 years ago

@nayangarg Could you share how you did it?

dwillis commented 4 years ago

Way too long, but I've fixed the get_comms_json method.