Package: medicure
MedicureMedicure is a cosmetic treatment for your media files: movies, TV shows and
also their subtitles. Medicure provides a command-line tool and also a Python
package for you to properly rename, sort tracks and correct tracks info for
your files.NameThe wordmedicureis combination ofmediaand the Latin wordcurawhich
means "care".InstallationThe easiest way to install is from PyPI:pipinstallmedicureAlternatively, you can install directly from GitHub:pipinstallgit+https://github.com/alirezatheh/medicure.gitRequirementsTMDBAPI Key: Medicure uses TMDB's API to get
correct info for movies and TV shows. So you need to create a TMDB account
and generate an API key in order to use Medicure.Mediainfo: Medicure requires Mediainfo
to extract track info from video and audio files.MKVToolNix: Medicure usesmkvmergeto craete
new treated media files.mkvmergeis one of the MKVToolNix's command-line
tools.Simple ExampleIn this example we want to treatPeaky Blinders's
Season 6 video files, downloaded fromPSArips.First we search for the TV show inTMDBto see
season names. In this case season name starts withSeries. In our TV shows
directory we createPeaky Blinders/Series 6directory and put the files
there. Directory structure will look like this:TVShows
└──PeakyBlinders└──Series6├──Peaky.Blinders.S06E01.1080p.10bit.WEB-DL.x265.HEVC.PSA.AM.mkv├──Peaky.Blinders.S06E02.INTERNAL.1080p.10bit.WEB-DL.x265.PSA.AM.mkv├──Peaky.Blinders.S06E03.INTERNAL.1080p.10bit.WEB-DL.x265.PSA.AM.mkv├──Peaky.Blinders.S06E04.1080p.10bit.WEB-DL.x265.PSA.AM.mkv├──Peaky.Blinders.S06E05.INTERNAL.1080p.10bit.WEB-DL.x265.PSA.AM.mkv└──Peaky.Blinders.S06E06.1080p.10bit.WEB-DL.x265.PSA.AM.mkvAnd each file has the following track infos:TypeTitleLanguageDefaultForcedVideoUndeterminedYesNoAudioEnglishYesNoSubtitleEnglishYesNoNow we run the following python snippet:frompathlibimportPathfrommedicureimportMedicure,DubbingSuppliermedicure=Medicure(tmdb_api_key='YOUR_TMDB_API_KEY',tvshows_directory=Path('path/to/tvshows_directory'),)medicure.treat_media(# You can find this in url of TV show in IMDb.imdb_id='tt2442560',file_search_patterns=[# We have only one file for each episode that can be found by# this pattern.'PSA',],video_language_code='eng',video_source='PSA',video_release_format='WEB-DL',dubbing_suppliers=[# In this example we only have one dubbing supplier and that's# which contains original audio and subtitle.DubbingSupplier(name='original',file_id=0,correct_language_code='eng',audio_language_code='eng',subtitle_language_code='eng',),],season_number=6,)Then directory structure will look like this:TVShows
└──PeakyBlinders├──Series6│├──Peaky.Blinders.S06E01.1080p.10bit.WEB-DL.x265.HEVC.PSA.AM.mkv│├──Peaky.Blinders.S06E02.INTERNAL.1080p.10bit.WEB-DL.x265.PSA.AM.mkv│├──Peaky.Blinders.S06E03.INTERNAL.1080p.10bit.WEB-DL.x265.PSA.AM.mkv│├──Peaky.Blinders.S06E04.1080p.10bit.WEB-DL.x265.PSA.AM.mkv│├──Peaky.Blinders.S06E05.INTERNAL.1080p.10bit.WEB-DL.x265.PSA.AM.mkv│└──Peaky.Blinders.S06E06.1080p.10bit.WEB-DL.x265.PSA.AM.mkv└──Series6Edited├──PeakyBlinders-S06E01-BlackDay.mkv├──PeakyBlinders-S06E02-BlackShirt.mkv├──PeakyBlinders-S06E03-Gold.mkv├──PeakyBlinders-S06E04-Sapphire.mkv├──PeakyBlinders-S06E05-TheRoadtoHell.mkv└──PeakyBlinders-S06E06-LockandKey.mkvAnd each file track infos:TypeTitleLanguageDefaultForcedVideoPSA WEB-DLEnglishYesNoAudioEnglishYesNoSubtitleEnglishNoNoLet's treat again, this time using Medicure's command-line interface.Since we're using CLI for the first time, we need to save our TMDB API key and
TV shows directory locally:medicuresavetmdb-infoYOUR_TMDB_API_KEYmedicuresavecollection-info\--tvshows-directoryPATH_TO_YOUR_TVSHOWS_DIRECTORYNow we can run:medicuretreatmedia\tt2442560\'["PSA"]'\eng\PSA\WEB-DL\'[["original", 0, "eng", "eng", "eng"]]'\6If you want to learn more about Medicure with more in depth examples you can
visitMedicure's documentation.