Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11
Release [TSDB] - The Sports Database Video Scraper (metadata.thesportsdb.python)
I'll publish my updates, but I think they should go as a Mod since are focused on NBA games and I don't find time to make them more general.

Find below the changes I've made:
  1. Using as episode number [game date][home team tsdb id], something like 2019013188 where 88 are the last two figures of home team ID. Changed in GetEpisodeDetails.
  2. Retrieving all the seasons in the database and querying for the games of every Season, by doing several smaller queries we avoid a heavy call that came to block the server in some cases. Chaged in GetDetails, GetEpisodeList and a new function GetSeasonEpisodeList. 
I want to make some more improvements, like retrieving an overview of the game as plot and the players who really played the game.
Reply
@docwra, it'd be possible the API to return team short names in events? I'd need it to ease my improvements
Reply
(2019-02-05, 13:59)Mitico Wrote: @docwra, it'd be possible the API to return team short names in events? I'd need it to ease my improvements
 Which API method are you using? Can you post an example?
Reply
For sure, I'm basically using these two functions:
  1. https://www.thesportsdb.com/api/v1/json/...amp;s=1819
  2. https://www.thesportsdb.com/api/v1/json/...mp;all=yes
Reply
Thanks I had a quick look but unfortunately the Short Team Code is not part of that table and would be very resource intensive to join it with so many events, while also changing the API.

For now I don't think this is possible, although I am open to any other ideas that might make it easier.
Reply
I guessed you were doing that join to retrieve Team Name, too bad for me!!
Reply
Does anyone know if there is an smart way of doing conversions in scrapers? I mean I retrive from the scraping several numeric codes I want to transform in alphanumeric ones. That's to say I want to change ThesportsDB team codes by team short names with something like a key value table. Is there an easy way?

And, of course, I don't want to do an additional remote query to the DB.
Reply
Not sure about scraper functionality sorry.

As a side note I was looking at the official NBA website API today and they use this shortcode for games.
Code:
"gameUrlCode": "20180928/MELPHI"

I don't know if its any use here but I thought it was a nice way of doing it. I could potentially support that on TheSportsDB API in the future.
Reply
Absolutely! I want to call other sites which use the same or similar event coding. Since Sport DB returns the long name and an internal code I need to do a conversion. And I don't know how to do it except by writing a regular expression for every team (30 teams).
Reply
I'm calling https://www.thesportsdb.com/api/v1/json/...?id=588252 and it returns:
Quote:{"events":[{"idEvent":"588252","idSoccerXML":null,"strEvent":"Philadelphia 76ers vs Houston Rockets","strFilename":"NBA 2019-01-22 Philadelphia 76ers vs Houston Rockets","strSport":"Basketball","idLeague":"4387","strLeague":"NBA","strSeason":"1819","strDescriptionEN":"","strHomeTeam":"Philadelphia 76ers","strAwayTeam":"Houston Rockets","intHomeScore":"121","intRound":"0","intAwayScore":"93","intSpectators":null,"strHomeGoalDetails":null,"strHomeRedCards":null,"strHomeYellowCards":null,"strHomeLineupGoalkeeper":null,"strHomeLineupDefense":null,"strHomeLineupMidfield":null,"strHomeLineupForward":null,"strHomeLineupSubstitutes":null,"strHomeFormation":null,"strAwayRedCards":null,"strAwayYellowCards":null,"strAwayGoalDetails":null,"strAwayLineupGoalkeeper":null,"strAwayLineupDefense":null,"strAwayLineupMidfield":null,"strAwayLineupForward":null,"strAwayLineupSubstitutes":null,"strAwayFormation":null,"intHomeShots":null,"intAwayShots":null,"dateEvent":"2019-01-22","strDate":null,"strTime":"01:00:00","strTVStation":null,"idHomeTeam":"134863","idAwayTeam":"134876","strResult":"","strCircuit":null,"strCountry":null,"strCity":null,"strPoster":null,"strFanart":null,"strThumb":"https:\/\/www.thesportsdb.com\/images\/media\/event\/thumb\/qyeuia1548099570.jpg","strBanner":null,"strMap":null,"strLocked":"unlocked"}]}

I'd like to scrap https://wikihoops.com/games/2019-01-21/H.../?gameinfo to get more information without having to call again thesportsdb.com to get both short codes.
Reply
Ok give me a few hours this morning and I will see what I can come up with as a new API method. I will see if I can include the team short code.

What would be really nice is to only return the exact data needed.

EDIT: Sadly it didnt work. I had a test here but could only get the home teams short code to show.
Code:
https://www.thesportsdb.com/api/v1/json/1/lookupevent2.php?id=502399all=yes
Reply
Hi @docwra 

I'm stuck with this. Maybe I can help you with the queries. I used to be pretty good with SQL.
Reply
Can we get some updated links in the first post??
-Mike
Reply
(2019-05-13, 17:02)Ludeboy12 Wrote: Can we get some updated links in the first post??

Here it is: https://github.com/zag2me/metadata.thesportsdb.com

Wink
Kodi 19 + Arctic: Zephyr Reloaded
nVidia SHIELD 2017 + WD My Book
LG OLED65B8PLA + LG SP11RA 7.1.4
Reply
(2019-03-03, 20:27)Mitico Wrote: Hi @docwra 

I'm stuck with this. Maybe I can help you with the queries. I used to be pretty good with SQL.

Any progress made here?
Reply
  • 1
  • 7
  • 8
  • 9(current)
  • 10
  • 11

Logout Mark Read Team Forum Stats Members Help
[TSDB] - The Sports Database Video Scraper (metadata.thesportsdb.python)3
This forum uses Lukasz Tkacz MyBB addons.