Guess additional information from track titles
Project description
TrakIt
Guess additional information from track titles
- Project page
https://github.com/ratoaq2/trakit
Info
TrakIt is a track name parser. It is a tiny library created to solve a very specific problem. It's very common that video files do not have precise metadata information, where you can have multiple subtitle tracks tagged as Portuguese, but one of them is actually Brazilian Portuguese:
{
"codec": "SubRip/SRT",
"id": 19,
"properties": {
"codec_id": "S_TEXT/UTF8",
"codec_private_length": 0,
"default_track": false,
"enabled_track": true,
"encoding": "UTF-8",
"forced_track": false,
"language": "por",
"language_ietf": "pt",
"number": 20,
"text_subtitles": true,
"track_name": "Português",
"uid": 160224385584803173
}
}
{
"codec": "SubRip/SRT",
"id": 20,
"properties": {
"codec_id": "S_TEXT/UTF8",
"codec_private_length": 0,
"default_track": false,
"enabled_track": true,
"encoding": "UTF-8",
"forced_track": false,
"language": "por",
"language_ietf": "pt",
"number": 21,
"text_subtitles": true,
"track_name": "Português (Brasil)",
"uid": 1435945803220205
}
}
Or you have multiple audio tracks in English,
but one of them is British English (British English Forced (PGS)
) and others are American English
(American English (PGS)
)
Given a track name, TrakIt can guess the language:
>> trakit "Português (Brasil)"
{
"language": "pt-BR"
}
TrakIt is also able to identify:
- SDH: Subtitles for the Deaf or Hard of Hearing
- Forced flag
- Closed captions
- Alternate version tracks
- Commentary tracks
>> trakit "British English (SDH) (PGS)"
{
"language": "en-GB",
"hearing_impaired": true
}
>> trakit "English CC (SRT)"
{
"language": "en",
"closed_caption": true
}
>> trakit "Cast and Crew Commentary (English AC3 Stereo)"
{
"language": "en",
"commentary": true
}
>> trakit "Français Forced (SRT)"
{
"language": "fr",
"forced": true
}
All available CLI options:
>> trakit --help
usage: trakit [-h] [-l EXPECTED_LANGUAGE] [--debug] [-y] [--version] value
positional arguments:
value track title to guess
options:
-h, --help show this help message and exit
Configuration:
-l EXPECTED_LANGUAGE, --expected-language EXPECTED_LANGUAGE
The expected language to be guessed
Output:
--debug Print information for debugging trakit and for reporting bugs.
-y, --yaml Display output in yaml format
Information:
--version show program's version number and exit
TrakIt is not a release parser. Use GuessIt
TrakIt is not a video metadata extractor. Use KnowIt. KnowIt already uses trakit to enhance the extracted information
Installation
TrakIt can be installed as a regular python module by running:
$ [sudo] pip install trakit
For a better isolation with your system you should use a dedicated
virtualenv or install for your user only using the --user
flag.
Data
- Available languages are the same supported by Diaoul/babelfish
- Localized country names were fetched from mledoze/countries
- Localized language names were fetched from mozilla/language-mapping-list
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file trakit-0.2.2.tar.gz
.
File metadata
- Download URL: trakit-0.2.2.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42e8b7af9949620d12647cd4b9801125d04a15a9ad8bb832230b26b78a723700 |
|
MD5 | ef6aa0150d3f9c3f8e2ac223f5e84412 |
|
BLAKE2b-256 | 2c4d93938a1c55f685cb12176759e645a7d048c8ba07678d98e58e4b29d10955 |
File details
Details for the file trakit-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: trakit-0.2.2-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82ea3e6a27c2a053c4d59df4325f78687c6b88a016b181e65294a5d81514f2e7 |
|
MD5 | 17f7c5fe37e9758753685d445daf365b |
|
BLAKE2b-256 | 35843f0d7e86b746f3917df5d807cd8556825b9c028f0fbf63cdb3f941a8ba16 |