DVD ripped bonus features in guessit

1 view
Skip to first unread message

Rob McMullen

unread,
Dec 7, 2011, 7:36:06 PM12/7/11
to smewt...@googlegroups.com
I've found Guessit useful for my homebrew media player
(http://www.dinoteeth.org). I'm interested in handling DVD bonus
features, so as a first cut I put a little regex front end that looks
at my filename convention and adds two new keys that mirror the
episode number and title:

extraNumber
extraTitle

If my regexes don't match, I pass the filename to guess_file_info and
let Guessit work its stuff. (Originally I tried to work with the
Guessit regexes and could get it to work with movies pretty easily,
but series were much harder.) My filename convention looks like

Movie_Title-x01[-Optional_Bonus_Feature_Name].mkv
Series_Title-s01-x01[-Optional_Bonus_Feature_Name].mkv

Anyway, I was wondering if there was going to be an official way of
handling bonus features. I've looked a lot of places on the web and
didn't find any standard convention for bonus feature naming, nor
could I find any examples of actual files that other people have
made...

Rob

Nicolas Wack

unread,
Dec 10, 2011, 1:02:59 PM12/10/11
to smewt...@googlegroups.com
Hi Rob,

First of all, thanks for your interest in GuessIt!

At the moment, there is no official way of handling bonus features.
Well, if you have a patch or a git pull request, it´s about as
official as it gets (and if it doesn't break the unittests, I will
most certainly merge it), but there is no "standard" way or place to
put it. I realize also that the code might not be the simplest to
understand and to hack on at the moment.

Your mail got me thinking, though (along with some others I received
recently), and the way I see things is the following: GuessIt at the
moment is mostly a collections of regexes and "positional rules" to
try to guess which parts of the filename correspond to what. I think
that it would be nice (and not too hard) to make those regexes and
rules pluggable, so that people could actually:
1- write new regexes/rules and contribute them easily
2- tailor GuessIt to their need by choosing which of those rules
apply, and in which order

I actually think I have a pretty good idea how to make this possible,
however to be honest I won't really have time until next year. So in
the meantime, if you're interested, you can either submit some patch
to make it work the way you want, or at least submit some test cases
to be added to the list of unittests. I do believe though that I can
make this work better during January.

Hope this helps,

Nico.

Rob McMullen

unread,
Dec 13, 2011, 6:48:34 PM12/13/11
to smewt...@googlegroups.com
Nico,

After trying to fit my regexes into patterns.py but failing the unit
tests, the way I ended up implementing it was just a sequence of
regexs and if none of those match, call guess_file_info. So, I ended
up not modifying the guessit code.

But I think my set of regexes would fit in with your idea of pluggable
regexes pretty well. I'll keep tabs on the gitorous branch as you get
time to make some changes.

In the meantime, if you're game for adding the extraNumber/extraTitle
metadata, I'll code up some unit tests and send you a pull request.

Rob

Nicolas Wack

unread,
Dec 16, 2011, 7:46:17 AM12/16/11
to smewt...@googlegroups.com
Hi Rob,

I'm always willing to have more unittests and ideally would like to
cover all the possible filenames in the world ;-)

On a more serious note, it is actually very easy to add some more, no
coding is required, just edit either the movies.yaml or episodes.yaml
files that are inside the test/ folder with the filename and the
desired metadata, and that should be it.

Thanks!

Nico.

Reply all
Reply to author
Forward
0 new messages