Scripts for extracting data from nfo - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116) +---- Forum: TinyMediaManager (https://forum.kodi.tv/forumdisplay.php?fid=204) +---- Thread: Scripts for extracting data from nfo (/showthread.php?tid=313421) |
Scripts for extracting data from nfo - akya - 2017-04-29 I wanted to share the scripts I wrote recently to extract data from movie and tvshow nfos. If you are a fan of spreadsheets, these scripts extract data from your collection to a text file which you can import into a good ol spreadsheet. You need python3 for executing the script. For tvshow.nfo Code: https://gist.github.com/akyag/ca3649386550d30f81165745fbde9713 and for movie.nfo Code: https://gist.github.com/akyag/1205819121757d3eb7ffda062f707bc8 You need to edit the path to your collection. You get output like this for example - title_rating_premiered_status_studio_genre_tags Code: 8 Simple Rules_8.5_2002-09-14_Ended_ABC (US)_Comedy_ title_rating_year_runtime_genre_codec_tags Code: Once Upon a Time in the West_7.9_1968_166_Action, Western_Sergio Leone_h264 / AAC_YIFY The script took about 14 sec to extract data from 680 movies. RE: Scripts for extracting data from nfo - hawikoeln - 2017-04-30 Stupid question: Why not use the export function? I write CSV files, that can be loaded in Excel, for my movies and shows within a second - without touching my library. Movie template: ${foreach movies movie}"${movie.title}";"${movie.originalTitle}";"${movie.year}";"${movie.edition}";"${movie.director}";"${foreach movie.actors actor}${if index_actor=1}${actor.name},${end}${if index_actor=2}${actor.name},${end}${if index_actor=3}${actor.name},${end}${end}";"${movie.runtime}";"${movie.imdbId}";"${movie.tmdbId}";"${movie.top250}";"${movie.watched}";"${movie.dateAdded}";"${foreach movie.genres genre ,}${genre}${end}";"${foreach movie.tags tag ,}${tag}${end}";${foreach movie.videoFiles vf}"${vf.path}";"${vf.filename}";"${vf.filesize}";"${vf.containerFormat}";"${vf.videoCodec}";"${vf.videoWidth}";"${vf.videoHeight}";"${vf.audioCodec}";"${vf.audioChannels}";"${vf.duration}";${end} ${end} Show template: ${foreach tvShows show}${foreach show.episodes episode}"${show.title}";"${show.year}";"${foreach show.tags tag ,}${tag}${end}";"${show.tvdbId}";"${show.watched}";"${episode.season}";"${episode.episode}";"${episode.title}";"${foreach episode.actors actor}${if index_actor=1}${actor.name},${end}${if index_actor=2}${actor.name},${end}${if index_actor=3}${actor.name},${end}${end}";"${episode.watched}";"${foreach episode.tags tag ,}${tag}${end}";${foreach episode.videoFiles vf}"${vf.path}";"${vf.filename}";"${vf.filesize}";"${vf.containerFormat}";"${vf.videoCodec}";"${vf.videoWidth}";"${vf.videoHeight}";"${vf.audioCodec}";"${vf.audioChannels}";"${vf.duration}"${end} ${end}${end} RE: Scripts for extracting data from nfo - akya - 2017-05-02 That's a nice way. I am learning python, so I just tried that. Now we have two different ways RE: Scripts for extracting data from nfo - ByteShare - 2020-04-30 Found an issue for TV shows with an apostrophe, for example: "A Centaur's Life" I don't know python so not sure the best way to fix that as an issue. Update, Actually it is characters in the NFO its self, example: Code: <plot>Himeno is a sweet, shy little centaur girl. In her world, everyone seems to be a supernatural creature, and all her classmates have some kind of horns, wings, tails, halos, or other visible supernatural body part. Despite their supernatural elements, Himeno and her best friends, Nozomi and Kyouko, have a fun and mostly normal daily school life!
|