3 ms·
Automagically resolves file names like "Eva.2011.R5.XviD.VaLeBo.mkv" Out of curiosity, how? Regex matching? Does it miss a good amount of times or what?
by jimmyjim 14y ago
Automagically resolves file names like "Eva.2011.R5.XviD.VaLeBo.mkv"
Out of curiosity, how? Regex matching? Does it miss a good amount of times or what?
- legaloslotr 14y agoYeah mostly regex. Plus some heuristics. Works most of the times. Pretty efficient for the simple amount of heuristics it uses. You can see the code here https://github.com/legalosLOTR/mdb/blob/master/MDB/DBbuilder.py https://github.com/legalosLOTR/mdb/blob/master/MDB/DBbuilder... Check out the function get_movie_name!
- wingerlang 14y agoWouldnt this break a movie like 2012? #2 remove year and stuff following it filename = re.sub('\d\d\d\d.*', ' ', filename)
- legaloslotr 14y agoYeah it totally would! Thanks for pointing this out. Btw, I am planning to use another library that has better detection rates - https://github.com/wackou/guessit https://github.com/wackou/guessit