Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexprengere/submatch
Match movies and subtitles from their names
https://github.com/alexprengere/submatch
matching python subtitles
Last synced: about 1 month ago
JSON representation
Match movies and subtitles from their names
- Host: GitHub
- URL: https://github.com/alexprengere/submatch
- Owner: alexprengere
- License: apache-2.0
- Created: 2014-07-16T15:07:58.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-24T07:20:04.000Z (about 8 years ago)
- Last Synced: 2024-10-03T19:46:42.253Z (about 2 months ago)
- Topics: matching, python, subtitles
- Language: Python
- Homepage: http://alexprengere.github.io/submatch/
- Size: 1.04 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
SubMatch
========This is a Python utility to match movies and subtitles inside a directory,
based on their names. It is specially useful for series with lots of subtitles.The output is a shell script containing the right ``mv`` commands.
Installation
------------.. code-block:: bash
$ python setup.py install --user
Usage
-----.. code-block:: bash
$ submatch -h
usage: submatch [-h] [-l L] [-r] [-z] [-n] [-N]
optional arguments:
-h, --help show this help message and exit
-l L, --limit L Change lower bound for matching ratio. Default is 0.6.
Matches below that percentage are automatically excluded.
-r, --reverse Reverse the logic of renaming. With this option, movies are
renamed, not subtitles.
-z, --zip Change the logic of matching. Zip the sorted list of movies
and subtitles instead of match on names. This will not use
-l/--limit option.
-n, --numbers Change the logic of matching. Use numbers in names to
perform the matching. This will not use -l/--limit option.
-N, --no-ext Consider files with no extension as movies.Example
-------Suppose you have some movies and subtitles:
.. code-block:: bash
$ touch tata.avi titi.sub toto.avi toto.srt TUTU.AVI tutu.fr.srt
After installation, just run the tool in the folder:
.. code-block:: bash
$ submatch
#
# Unmatched subtitles:
# [ ] ./titi.sub
#
# Unmatched movies:
# [ ] ./tata.avi
#
# Matching results with method "NAMES":
# * column 1 : Levenshtein distance between movie name and sub name
# * column 2 : '✓' if movie name and sub name contain then same numbers
# * column 3+ : [numbers] movie ... [numbers] sub (color based on numbers)
#
# 100.0% ✓ [ ] ./toto.avi [ ] ./toto.srt
# 72.7% ✓ [ ] ./TUTU.AVI [ ] ./tutu.fr.srt
# Actual moves proposed
# Already good: "./toto.srt"
mv "./tutu.fr.srt" "./TUTU.srt"You can then actually perform the move like this:
.. code-block:: bash
$ submatch | sh