{"id":16886696,"url":"https://github.com/alisoftware/tvshoworganizer","last_synced_at":"2025-06-21T07:40:13.145Z","repository":{"id":32170279,"uuid":"35743557","full_name":"AliSoftware/TVShowOrganizer","owner":"AliSoftware","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-30T19:52:56.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-25T12:41:25.584Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AliSoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-16T23:04:59.000Z","updated_at":"2023-01-14T02:29:22.000Z","dependencies_parsed_at":"2022-07-28T13:09:02.098Z","dependency_job_id":null,"html_url":"https://github.com/AliSoftware/TVShowOrganizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSoftware%2FTVShowOrganizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSoftware%2FTVShowOrganizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSoftware%2FTVShowOrganizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSoftware%2FTVShowOrganizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AliSoftware","download_url":"https://codeload.github.com/AliSoftware/TVShowOrganizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244610612,"owners_count":20481024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T16:40:49.825Z","updated_at":"2025-03-20T12:26:47.287Z","avatar_url":"https://github.com/AliSoftware.png","language":"Ruby","readme":"# TV Show Organizer\n\nThis is a little ruby tool to automatically rename TV Show video files (according to my naming preference) and move them to the appropriate directory (appropriate for XBMC/Kodi).\n\n## Features\n\nThis took takes an input folder and output folder, then it:\n\n* looks for files with extension `mp4`,`m4v`,`avi` or `mkv` in the input folder (discarding filenames containing `Sample`)\n* parses the file name to extract the TVShow name, season number and episode number.  \n  _(To do that, it expects the file name to match `Show.Name.S01E02.Anything.ext`)_\n* fetches the name of the episode using [TheTVDB](http://thetvdb.com) [API](http://thetvdb.com/wiki/index.php?title=Programmers_API)\n* renames the file to `Show Name - 1x02 - Episode Title.ext` and moves it to the subfolder `Show Name/Season 1/` of the output folder.\n\nOnce every video files of the input folder have been moved and renamed appropriately, it finally uses [Kodi](http://kodi.tv/about/)'s [JSON-RPC API](http://kodi.wiki/view/JSON-RPC_API/v6) to refresh the Kodi database, so that those shows appear in your Kodi library.\n\n\n## Usage\n\n1. the `TheTVDB` API needs an API Key to use it. You need to get one and write it to a file named `thetvdb.apikey` saved next to the other files so that the script can use it.\n2. Then use `tvshows_organizer.rb` as the entry point, invoked either from ruby code (using `TVShowsOrganizer` module) or from the command line\n\n### Invoke from ruby\n\n```ruby\nrequire 'tvshows_organizer'\n# Search the TheTVDB's show ID of a given show\nTVShowsOrganizer::run_query(:query =\u003e 'Game of Thrones')\n# Add a show to the shows.yml database\nTVShowsOrganizer::add_show(:name =\u003e 'Game of Thrones', :id =\u003e '121361')\n# Move video files to destination, renaming them appropriately.\nTVShowsOrganizer::move_files(source_dir, dest_dir, :interactive =\u003e true, :kodi_auth =\u003e 'login:pass')\n```\n\n### Invoke from the command line\n\nUse `tvshows_organizer.rb --help` to know how to use it and which options are available.\n\n```sh\n# Search the TheTVDB's show ID of a given show\n$ ./tvshows_organizer.rb -q \"House of Cards\"\n# Add a show to the shows.yml database: use query + interactive mode\n$ ./tvshows_organizer.rb -qi \"House of Cards\"\n# Move video files to destination, renaming them appropriately.\n$ ./tvshows_organizer.rb -i source_dir dest_dir --kodi login:pass\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falisoftware%2Ftvshoworganizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falisoftware%2Ftvshoworganizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falisoftware%2Ftvshoworganizer/lists"}