guessit-io / guessit

GuessIt is a python library that extracts as much information as possible from a video filename.
https://guessit-io.github.io/guessit
GNU Lesser General Public License v3.0
822 stars 91 forks source link

extraction of imdb_id from title #622

Open snickers2k opened 5 years ago

snickers2k commented 5 years ago

i use "flexget" to download stuff and automatically store the imdb_id in the filename. Would be great to have guessit recognize those IDs for later sortings. since imdb_ids always starts with "tt" this should be easy or not?!

tmdb/tvdb could be a little bit more difficult, but most naming-schemes i saw containing tmdb/imdb/tvdb, in "[ ]". So at least this could be extracted aswell?

besides flexget, sonarr/radarr and filebot are also able to store imdb_ids in title. so there are a couple of usecases.

to clarify; i saw 1-2 requests for "searching the imdb_id from imdb.com", but this is not what i mean. i would just like to have guessit extracting the ID, if there is one in the title.

thank you

Toilal commented 5 years ago

Please provide a list of release names with those ids.

snickers2k commented 5 years ago

sorry, there are no release-names with ids. but flexget/sonarr/radarr for example are able to rename the title with imdb_ids in it, directly while creating them - because they run lookups before. so this would be the usecase. already renamed files by other apps - for later recognition, would be helpful if guessit could parse those ids back to other apps. you get it?^^

pawamoy commented 5 years ago

So a regex for this would be \[tt[0-9]{8}\] if IMDB IDs always have 8 digits.

labrys commented 4 years ago

Personally I think there are way too many naming formats across various apps to expect guessit to unparse them. If you already have a known format its much better to have a parser for that specific format and handle it directly.