Formula1 scanner

Background:

 

The way that Formula1 boadcasts is organized doesn't fit very well with ether Movies or TV Series. Adding them as home movies is one unsatisfactory option, but instead I tried to make a Formula1 Media Scanner.

 

It is working for my purpose, and I take no responsibility should it cause you any harm, but you are free to reuse and modify it.

 

How it works:

 

I typically have all my Formula1 media in one folder, and one broadcast can be named i.e. formula1.2014.spain.grand.prix.qualifying.uncut.720p.hdtv.x264.mkv. The Formula1 Media Scanner picks up the various parts of the file name using this regular expression:

'(?P.*?)[\._ ](?P[0-9]{4})[\._ ](?P.*?)[\.](?P.*?)\.(720p|HDTV|x254|1080p)'

 

In the above example it will find the following match:

MATCH 1

show [1-9] `formula1`

season [10-14] `2014`

location [15-20] `spain`

ep [21-48] `grand.prix.qualifying.uncut`

5. [49-53] `720p`

 

 

The challenge here is to map this into a TV Series format. Basically a Formula1 episode is really a full weekend, containing many broadcasts, from buildup, FP1-3, Qualifying, race and others. However, one episode may only contain one media (disregarding stacking, as that is really sub optimal here).
What I did instead was to assume that this library will only contain Formula1, and I named the show like Formula1 yyyy. So for the example above, the show would resolv to Formula1 2014.
A series is then mapped to a location, but since series unfortunately only supports integer, I made a look up table to resolve location to Season number (This will have to be updated for years to come, only 2014 added).
Under a given season (location) I add all the media pertaining to this location (weekend) as episodes.
If it encounters a locations it doesn't recognize, it will still add the episode, but under season 99 (unknown)
 
Thinking out loud
Ideally I could add a show as Formula1, add seasons by year, add Episodes as location. Opening one Episode allows you to play any file from that weekend, but I don't see how that can be done.
This scanner should work well for others (motor)sports that are organized in a similar way, you have to update locations though.
The locations could be added dynamically, but I have added them manually so I get the "Seasons" in the correct order of the calender.

 

 

Install and use:

 

copy the attached file to /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Scanners/Series/

restart plexmediaserver

Add a new library called Formula1 and add the folder containing F1 broadcasts

Select Advanced and Scanner: Formula1

 

Bugs:

You have to re-add the library when you get new files, because it adds a new show with the same name for the new files, why?

The way it increments the episode numbers might be lost from scan to scan? Have not verified due to the bug above.

 

If you have suggestions how to fix the bugs, please let me know.

 

GitHub:

https://github.com/kennethx/PlexF1MediaScanner

This looks awesome.  I will give it a try when I get home.

The file doesn't seem to exist to download for me - has it been pulled?

A

Why would it be pulled? I can try to upload again?

I also can't download the file. . . .

I'd love to help with this/try it out. Can you post it to github or something?

This looks amazingly! I hate all the f1 being in home movies :frowning: can’t wait to try it. (I get an error message when I try and download).

https://github.com/kennethx/PlexF1MediaScanner

It would be great if the bugs where fixed, sadly I have not had any time to get to understand the bugs and get to know the Custom Media scanner framework further. Anyone is welcome to join in on the git hub project =)

I'll try to play with this tonight. Thanks!

I love this community - thanks for posting, it works wonderfully! 

For those like me using the PlexPass build on FreeNAS/FreeBSD here are the directories you need to update in the script: 

sys.path.append("/usr/local/plexdata-plexpass/Plex Media Server/Scanners/Series")

sys.path.append("/usr/local/plexdata-plexpass/Plex Media Server/Plug-ins/Scanners.bundle/Contents/Resources/Common/")

logging.basicConfig(filename='/usr/local/plexdata-plexpass/Plex Media Server/Logs/Formula1.log',level=logging.DEBUG)

Guys,

Tried what you said on a Windows 8.1 machine but Plex can't find the scanner. Is this the right directory?

C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins\Scanners.bundle\Contents\Resources\

Thanks.

I installed your scanner today and got the first race of the Season 2000 in the folder.

I named it “formula1.2000.australia.grand.prix.avi” but it does not work.


What am I doing wrong?

What am I doing wrong?

 
Did you change the paths accodring to your setup?
https://github.com/kennethx/PlexF1MediaScanner/blob/master/Formula1.py#L24

If this does not work please post your log file.

https://github.com/kennethx/PlexF1MediaScanner/blob/master/Formula1.py#L112

Hi FitzGerald,


thanks for your reply. I changed the path but maybe its not correct. Maybe you can check it?

In my Lib Folder I see only one folder but not the correct one.

Artwork in the future?

Hi @fullmakt: did this ever get updated for 2015 and beyond? Did you ever manage to get it to rescan automatically when new files were added?

@Fullmakt I guess this doesn’t support the previous seasons? I’m desperately trying to organize every race since 1978 to the present date, but I’m having a hard time. What would you suggest me?

So far I have a files structure similar to my TV shows (Volumes/External HDD/Formula 1/Season 2000/Formula 1 - s2000e02 - Brazilian Grand Prix.avi), but I don’t know how to get that right into my library.

Sorry, I haven’t done any updates, just no time. But the initial code is on git for all to contribute and use =)

@irock1

I’ve written a scanner that uses www.thesportsdb.com as a metadata source and scans all sorts of sporting things. You would have to change the file format so that it has the date the main race happened rather than a season and episode and your media must be in a root folder called “Motorsport”.

One field needs to be changed on the website to make it work properly with your setup as described which I am asking for now.

@mmmmmtasty said: I’ve written a scanner that uses www.thesportsdb.com as a metadata source

thank you so much for this. am using it for F1, MotoGP & SBK. just the fact that Plex even recognizes the files is a major coup. the fact that it can now identify and label each race is a bonus.