Site
Home / Forum / 3rd Party Projects / [Plex Add-on] Sports Scraper

[Plex Add-on] Sports Scraper


Posted: 26 Jan 2017 22:11

zag
Posts: 1,558
Joined: Oct 2016

Scanner and Metadata Agent for Plex that uses https://www.thesportsdb.com

https://github.com/mmmmmtasty/SportScanner

Posted: 20 Nov 2019 08:01

sport123
Posts: 42
Joined: Nov 2019

Can confirm this works well.

The included instructions are good but have one error. Details below:
Issue: The instructions ask you to name the sport file using the Plex standard naming convention. this will not work
Solution: Go into TheSportsDB, navigate to the sporting event your file corresponds to, and finally scroll to the bottom, copy one of the list of approved filenames and rename your file using this copied filename. Plex will then recognise the file as a sports video file and scrape the data from TheSportsDB and render is correctly in your library.

When you point Plex to your sport directory. Make sure your subfolders are the names of the sports as they appear in TheSportsDB. Then the next subdirectory must be the seasons as named within TheSportDB also. E.g. "C.../Sport/Pro Motocross/Season 2019/"

Posted: 20 Nov 2019 10:32

zag
Posts: 1,558
Joined: Oct 2016

Can confirm this works well.

The included instructions are good but have one error. Details below:
Issue: The instructions ask you to name the sport file using the Plex standard naming convention. this will not work
Solution: Go into TheSportsDB, navigate to the sporting event your file corresponds to, and finally scroll to the bottom, copy one of the list of approved filenames and rename your file using this copied filename. Plex will then recognise the file as a sports video file and scrape the data from TheSportsDB and render is correctly in your library.

When you point Plex to your sport directory. Make sure your subfolders are the names of the sports as they appear in TheSportsDB. Then the next subdirectory must be the seasons as named within TheSportDB also. E.g. "C.../Sport/Pro Motocross/Season 2019/"


Thats really good to know, mmmmmtasty was an active remember here at the very start but havent seen him in a while.

Good to know the plugin works and hopefully it drives people to come here and enter data and artwork

Posted: 20 Nov 2019 10:35

zag
Posts: 1,558
Joined: Oct 2016

Could you post a screenshot of plex with this working? I'm interested in how it looks.

Posted: 21 Nov 2019 05:59

sport123
Posts: 42
Joined: Nov 2019

mmmmmtasty has done a great job. His github repo says he isn't maintaining the project actively anymore but will from time to time check submitted bugs.

I haven't gone through my library of sport completely to name everything as per the naming for each event as per each event in TheSportDB but got the proof of concept going. See attachments.

I also have a suggestion for future functionality of sportdb to support this mod. What would help is if forum contributors could add other filenames to the events on top of the auto-generated ones. Where this might come in handy is if the user has, for example, included round numbers in their file names e.g. NFL.Season 2019.Rd15.x.team.vs.y.team. SportScraper seems to only accept what is in the sportdb filenames so if mmmmmtasy isnt developing anymore this isn't a bad fix to get working longer term.

Posted: 21 Nov 2019 09:51

zag
Posts: 1,558
Joined: Oct 2016

I also have a suggestion for future functionality of sportdb to support this mod. What would help is if forum contributors could add other filenames to the events on top of the auto-generated ones. Where this might come in handy is if the user has, for example, included round numbers in their file names e.g. NFL.Season 2019.Rd15.x.team.vs.y.team. SportScraper seems to only accept what is in the sportdb filenames so if mmmmmtasy isnt developing anymore this isn't a bad fix to get working longer term.

Yes I had thought about this before as well, and think its a great idea!

At the moment all filenames are created using a standard template but I know everyone has a different ideas

I will add it to the todo list.

Posted: 26 Jan 2020 01:36

dlane2155
Posts: 11
Joined: Jun 2019

Thought I would add to this, as this Plex add-on is actually how I found out about SportsDB. I was a little disappointed when I got here to find that there was basically nothing setup for NCAA Football; however I think I helped with that pretty well, haha.

One thing that would be cool is an automatic poster and thumbnail generator. I did some of these in a crude way. Actually using a retro video game rom scraper that scrapes multiple images from a french website and then resizes, orients, and layers them all into a single image based on an xml file. Problem is my method is a little bit manual and I have to change my xml files for each game.

As an example... I tried to emulate what ESPN shows on their apps... Basically there is an image for sport (football field in this case). A color is applied for each team and given some transparency, then the shape is screwed. Logos are applied basically in the center of each side, and finally an image of the channel the game originally aired on is applied to the bottom right.


The Plex add-on does not use the "Poster" image from this db at all for events, only the "Thumb" image. It does use the "Poster" image from the League for the "TV Show" poster and as the poster for each season (that makes sense as there is no individual season poster on this site).

No other images from this site are used by the Plex add-on.

P.S. NCAA Division 1 (Football) should probably be listed next to NFL in the Featured section. It brings in just as much if not more revenue annually. It's definitely more popular than CFL, AFL, or any of the others there.

Posted: 26 Jan 2020 21:38

zag
Posts: 1,558
Joined: Oct 2016

P.S. NCAA Division 1 (Football) should probably be listed next to NFL in the Featured section. It brings in just as much if not more revenue annually. It's definitely more popular than CFL, AFL, or any of the others there.

Done !

Some teams still need descriptions and stadium names

Posted: 26 Feb 2020 22:17

snowlucas
Posts: 1
Joined: Feb 2020



Yes I had thought about this before as well, and think its a great idea!

At the moment all filenames are created using a standard template but I know everyone has a different ideas

I will add it to the todo list.



Just to add to this request. The scanner works but is very particular about naming in some ways. For example if you have a file that start EPL rather than English Premier League it will not match. More frustrating is when it doesn't match because it uses the full team name "Manchester United" and not "Man United" for example. All stems of course from no agreed naming method for sports.

I guess there are three solutions. You could try and have all the naming schemes added here (seems endless). The scanner could be updated to be more flexible. Or finally scripts to rename the files correctly. I'm going to try the scripts idea as I have no control over the first two.

Posted: 27 Feb 2020 08:39

zag
Posts: 1,558
Joined: Oct 2016




Just to add to this request. The scanner works but is very particular about naming in some ways. For example if you have a file that start EPL rather than English Premier League it will not match. More frustrating is when it doesn't match because it uses the full team name "Manchester United" and not "Man United" for example. All stems of course from no agreed naming method for sports.

I guess there are three solutions. You could try and have all the naming schemes added here (seems endless). The scanner could be updated to be more flexible. Or finally scripts to rename the files correctly. I'm going to try the scripts idea as I have no control over the first two.


Our database does have alternative naming so if the API if used to its full potential then Manchester United should work.

I could probably do the same for leagues as well as I know the scene shortens things like EPL in their releases.

Posted: 25 Jun 2020 09:49
Retrorat1
Posts: 32
Joined: 2020-06-25

Hi is this still working ? I know that the development has stopped for the SportsScanner but it still loads in plex I just cant make it to pick up the EPL listings.
I have my folder structure as follows
Root/Sports/EPL/English Premier League/Season 1920/EPL.2020.02.05.XXX.vsXXX.720p.XXX.XXX
Added the SportScanner.py to the EPL folder and the bundle in Plex plugins folder
created a tv show folder and directed it to the EPL as I only wanted the footy
in the Advance tab & selected sports scanner as the Agent it loads and scans in the media It picks up the main poster but I cannot get around the name to display only - English Premier League episode 06.22.2020 shows as the name.
Any help will be grateful
Thanks

Posted: 09 Aug 2020 21:24
zeroflix
Posts: 4
Joined: 2020-08-09

should close this i've tried and it doesn't work anymore

Posted: 04 Oct 2020 06:06

Sport123
Posts: 5
Joined: 2020-10-04

HI Zag long time how have you been mate?

Looks like this has broken down a bit. Not pulling through like it once did. Have you made any tweaks to the API recently that may mess with this?

Also noticed that the naming convention of events no longer shows up at the bottom of the event webpage so its no longer possible to check if you have named the file correctly. Was this intentional?

Posted: 04 Oct 2020 08:54

zag
Posts: 3,295
Joined: 2020-03-23

No changes other than the removal of the filename string on the event pages.

Posted: 17 Oct 2020 05:06

Sport123
Posts: 5
Joined: 2020-10-04

No changes other than the removal of the filename string on the event pages.

I'll do some testing a see if i can get it working again.

Not sure if its possible, can you re-enable the filename string on event pages only within Pro Motocross & AMA Supercross? I'll use this as my test bed.

EDIT: Looks like you've already added it back in. For the life of me I can't get it to work. It seems like its:

1. Matching the files
2. Creating the event structure
3. Pulling the event date and event name.

It then fails to pull through the event description, thumbnail, background and season images.

Posted: 18 Oct 2020 19:32

zag
Posts: 3,295
Joined: 2020-03-23

Just a thought but are the URLs perhaps not going to https? The original site was only http.

Posted: 19 Oct 2020 05:29

Sport123
Posts: 5
Joined: 2020-10-04

Just a thought but are the URLs perhaps not going to https? The original site was only http.

You are correct it was referencing http site. I also wonder, is the API key for this still live?

SPORTSDB_API = "https://www.thesportsdb.com/api/v1/json//"

There is an expression which is "Http.CacheTime = 0"

Should that also be changed to "HTTPS.CacheTime = 0" ??

There is also a try expression "result = Http.Request(Url, Headers=Headers, Timeout=60)"

Once more, should that be switched out for Https?

Its coded in python. Guessing Https might have a different DLL you may need to include up the top of the code?



Posted: 19 Oct 2020 18:14

zag
Posts: 3,295
Joined: 2020-03-23

Just a thought but are the URLs perhaps not going to https? The original site was only http.

You are correct it was referencing http site. I also wonder, is the API key for this still live?

SPORTSDB_API = "https://www.thesportsdb.com/api/v1/json//"

There is an expression which is "Http.CacheTime = 0"

Should that also be changed to "HTTPS.CacheTime = 0" ??

There is also a try expression "result = Http.Request(Url, Headers=Headers, Timeout=60)"

Once more, should that be switched out for Https?

Its coded in python. Guessing Https might have a different DLL you may need to include up the top of the code?



Yes API key is still live, but only v1 but it should work.

I'd replace all URL code with https (but not the methods described above) and see if that works, if not then you need someone better than python than me


Posted: 20 Oct 2020 04:58

Sport123
Posts: 5
Joined: 2020-10-04

Yes API key is still live, but only v1 but it should work.

Will a V2 key introduce other issues given the age of the code?

I'd replace all URL code with https (but not the methods described above) and see if that works, if not then you need someone better than python than me


I'll give it a crack later tonight. I've got limited experience in most web languages and C# but i'm not about to say i was good at it hahaha

Posted: 24 Oct 2020 04:58

Sport123
Posts: 5
Joined: 2020-10-04

Damn. No good Zag. Guess its going to require someone with a few more hours of Python under their belts than us.

zag
Posted: 13 Nov 2021 17:43
snikay
Posts: 3
Joined: 2021-11-13

it got a few new updates by the community in the last couple of days. so maybe it's working finally? i hope so

Posted: 19 Dec 2021 07:57
opnath
Posts: 1
Joined: 2021-12-19

After making the following tweaks in the file "SportScanner-0.2\SportScanner-0.2\SportScanner.bundle\Contents\Code\__init__.py" , I was able to make this work, tested with F1. Please feel free to test with other sports.

1) Replace continue with break in line no 121/134 (right now it's going in continuous loop ever after a match is found)
2) Remove line no 306/307, the attribute strCircuit is no longer available.



zag
Posted: 08 Feb 2022 22:19
sport1234
Posts: 20
Joined: 2022-02-08

Hi, I have installed the scanner, and have been able to add it as a tv show, and have found the sport scanner with no issues as an agent.

Have also made the two latest tweaks in the code as was suggested in the most recent post on this thread, but I still cannot retrieve any metadata.

I have been trying to test with UFC as a start, and when I get the concept to work, will work with other sports.

I have tried to use the directory structure and the filenames as suggested in the sportsdb.

Here is an example that I am using:

Directory:
/sport/fighting/UFC/2021

Filename:
UFC.2021-11-06.UFC.268.Usman.vs.Covington 2

Any help in getting this proof of concept to work, would be appreciated.

Thank you in advance


Posted: 09 Feb 2022 19:16

Ovokx
Posts: 1,685
Joined: 2020-06-17


Filename:
UFC.2021-11-06.UFC.268.Usman.vs.Covington 2


I think the issue might be that there's one dot missing between "Covington" and "2". You can check the file name at the end of the event page: https://www.thesportsdb.com/event/1394812

Hope it helps!

Posted: 10 Feb 2022 08:40
sport1234
Posts: 20
Joined: 2022-02-08

Thank you for the quick reply.

I tried another fight to simplify things, and took the wording right from the bottom of the page of thesportsdb.com.

UFC.2021-02-07.UFC.Fight.Night.184.Overeem.vs.Volkov
It still does not find anything. I am trying to get one to work, and then I will be able to get everything else to work.

I also made the two changes in Python as the previous person had recommended.

Do these scripts actually work? Can someone verify that they have recently installed these Python scripts, and have gotten these to work? Any help, would be greatly appreciated.




Who is Online?

In total there are 68 users online :: 3 registered, 0 hidden and 65 guests (based on users active over the past 5 minutes) Most users ever online was 424 on Fri Nov 10, 2017 9:02 pm

About Us

Discussion forum for TheSportsDB.com site and related topics

Rules

- Be Polite
- Respect other users
- Always post log files with issues
- Try to be helpful
- No Piracy discussion

Showing 0 to 25 (Total: 102)