# PGSRip
Rip your PGS subtitles.
[](https://pypi.python.org/pypi/pgsrip)
[](https://github.com/ratoaq2/pgsrip/blob/master/LICENSE)
- Project page
<https://github.com/ratoaq2/pgsrip>
**PGSRip** is a command line tool that allows you to extract and convert
PGS subtitles into SRT format. This tool requires MKVToolNix and
tesseract-ocr and tessdata (<https://github.com/tesseract-ocr/tessdata>
or <https://github.com/tesseract-ocr/tessdata_best>)
## Installation
pgsrip:
$ pip install pgsrip
MKVToolNix:
[Linux/WSL - Ubuntu/Debian]
$ sudo apt-get install mkvtoolnix
[Windows/Chocolatey]
$ choco install mkvtoolnix
tesseract:
PPA is used to install latest tesseract 5.x. Skip PPA repository if you decide to stick with latest official Debian/Ubuntu package
[Linux/WSL - Ubuntu/Debian]
$ sudo add-apt-repository ppa:alex-p/tesseract-ocr5
$ sudo apt update
$ sudo apt-get install tesseract-ocr
[Windows/Chocolatey]
$ choco install tesseract-ocr
tessdata:
$ git clone https://github.com/tesseract-ocr/tessdata_best.git
export TESSDATA_PREFIX=~/tessdata_best
If you prefer to build the docker image Build Docker:
$ git clone https://github.com/ratoaq2/pgsrip.git
cd pgsrip
docker build . -t pgsrip
## Usage
### CLI
Rip from a .mkv:
$ pgsrip mymedia.mkv
3 PGS subtitles collected from 1 file
Ripping subtitles [####################################] 100% mymedia.mkv [5:de]
3 PGS subtitles ripped from 1 file
Rip from a .mks:
$ pgsrip mymedia.mks
3 PGS subtitles collected from 1 file
Ripping subtitles [####################################] 100% mymedia.mks [3:pt-BR]
3 PGS subtitles ripped from 1 file
Rip from a .sup:
$ pgsrip mymedia.en.sup
1 PGS subtitle collected from 1 file
Ripping subtitles [####################################] 100% mymedia.en.sup
1 PGS subtitle ripped from 1 file
Rip from a folder path:
$ pgsrip -l en -l pt-BR ~/medias/
11 PGS subtitles collected from 9 files / 2 files filtered out
Ripping subtitles [####################################] 100% ~/medias/mymedia.mkv [4:en]
11 PGS subtitles ripped from 9 files
Using docker:
$ docker run -it --rm -v /medias:/medias -u $(id -u username):$(id -g username) ratoaq2/pgsrip -l en -l de -l pt-BR -l pt /medias
11 PGS subtitles collected from 9 files / 2 files filtered out
Ripping subtitles [####################################] 100% /medias/mymedia.mkv [4:en]
11 PGS subtitles ripped from 9 files
### API
``` python
from pgsrip import pgsrip, Mkv, Options
from babelfish import Language
media = Mkv('/subtitle/path/mymedia.mkv')
options = Options(languages={Language('eng')}, overwrite=True, one_per_lang=False)
pgsrip.rip(media, options)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ratoaq2/pgsrip",
"name": "pgsrip",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "video, mkv, subtitles, rip, srt, pgs, sup, sub, metadata, movie, episode, tv, shows, series",
"author": "Rato",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/cf/7e/afe6b4d2f60a0bb4556a245fef5fd22eab558494ce9a2e2df92669c63dad/pgsrip-0.1.12.tar.gz",
"platform": null,
"description": "# PGSRip\n\nRip your PGS subtitles.\n\n[](https://pypi.python.org/pypi/pgsrip)\n\n[](https://github.com/ratoaq2/pgsrip/blob/master/LICENSE)\n\n - Project page \n <https://github.com/ratoaq2/pgsrip>\n\n**PGSRip** is a command line tool that allows you to extract and convert\nPGS subtitles into SRT format. This tool requires MKVToolNix and\ntesseract-ocr and tessdata (<https://github.com/tesseract-ocr/tessdata>\nor <https://github.com/tesseract-ocr/tessdata_best>)\n\n## Installation\n\npgsrip:\n\n $ pip install pgsrip\n\nMKVToolNix:\n\n [Linux/WSL - Ubuntu/Debian]\n $ sudo apt-get install mkvtoolnix\n\n [Windows/Chocolatey]\n $ choco install mkvtoolnix\n\ntesseract:\n\nPPA is used to install latest tesseract 5.x. Skip PPA repository if you decide to stick with latest official Debian/Ubuntu package\n\n [Linux/WSL - Ubuntu/Debian]\n $ sudo add-apt-repository ppa:alex-p/tesseract-ocr5\n $ sudo apt update\n $ sudo apt-get install tesseract-ocr\n\n [Windows/Chocolatey]\n $ choco install tesseract-ocr\n\n\ntessdata:\n\n $ git clone https://github.com/tesseract-ocr/tessdata_best.git\n export TESSDATA_PREFIX=~/tessdata_best\n\nIf you prefer to build the docker image Build Docker:\n\n $ git clone https://github.com/ratoaq2/pgsrip.git\n cd pgsrip\n docker build . -t pgsrip\n\n## Usage\n\n### CLI\n\nRip from a .mkv:\n\n $ pgsrip mymedia.mkv\n 3 PGS subtitles collected from 1 file\n Ripping subtitles [####################################] 100% mymedia.mkv [5:de]\n 3 PGS subtitles ripped from 1 file\n\nRip from a .mks:\n\n $ pgsrip mymedia.mks\n 3 PGS subtitles collected from 1 file\n Ripping subtitles [####################################] 100% mymedia.mks [3:pt-BR]\n 3 PGS subtitles ripped from 1 file\n\nRip from a .sup:\n\n $ pgsrip mymedia.en.sup\n 1 PGS subtitle collected from 1 file\n Ripping subtitles [####################################] 100% mymedia.en.sup\n 1 PGS subtitle ripped from 1 file\n\nRip from a folder path:\n\n $ pgsrip -l en -l pt-BR ~/medias/\n 11 PGS subtitles collected from 9 files / 2 files filtered out\n Ripping subtitles [####################################] 100% ~/medias/mymedia.mkv [4:en]\n 11 PGS subtitles ripped from 9 files\n\nUsing docker:\n\n $ docker run -it --rm -v /medias:/medias -u $(id -u username):$(id -g username) ratoaq2/pgsrip -l en -l de -l pt-BR -l pt /medias\n 11 PGS subtitles collected from 9 files / 2 files filtered out\n Ripping subtitles [####################################] 100% /medias/mymedia.mkv [4:en]\n 11 PGS subtitles ripped from 9 files\n\n### API\n\n``` python\nfrom pgsrip import pgsrip, Mkv, Options\nfrom babelfish import Language\n\nmedia = Mkv('/subtitle/path/mymedia.mkv')\noptions = Options(languages={Language('eng')}, overwrite=True, one_per_lang=False)\npgsrip.rip(media, options)\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Rip your PGS subtitles",
"version": "0.1.12",
"project_urls": {
"Homepage": "https://github.com/ratoaq2/pgsrip",
"Repository": "https://github.com/ratoaq2/pgsrip"
},
"split_keywords": [
"video",
" mkv",
" subtitles",
" rip",
" srt",
" pgs",
" sup",
" sub",
" metadata",
" movie",
" episode",
" tv",
" shows",
" series"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "04c5227788b2b24878b1e30948854405212184df7a9847d6a8b31afda0b81838",
"md5": "e8220ce5ee348727add8541f02514782",
"sha256": "3458ce7d13c006a78f9605351ebe13bd35b7b25ca111967f1567fb3559046e7e"
},
"downloads": -1,
"filename": "pgsrip-0.1.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e8220ce5ee348727add8541f02514782",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 20815,
"upload_time": "2025-07-26T10:16:35",
"upload_time_iso_8601": "2025-07-26T10:16:35.442107Z",
"url": "https://files.pythonhosted.org/packages/04/c5/227788b2b24878b1e30948854405212184df7a9847d6a8b31afda0b81838/pgsrip-0.1.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cf7eafe6b4d2f60a0bb4556a245fef5fd22eab558494ce9a2e2df92669c63dad",
"md5": "d2a052d175bcca631fbf1242865fd5a2",
"sha256": "9b5f9093fb7e1d430b23003ef089234c43f758aa45ad90e80af435368e314cac"
},
"downloads": -1,
"filename": "pgsrip-0.1.12.tar.gz",
"has_sig": false,
"md5_digest": "d2a052d175bcca631fbf1242865fd5a2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 16402,
"upload_time": "2025-07-26T10:16:36",
"upload_time_iso_8601": "2025-07-26T10:16:36.322976Z",
"url": "https://files.pythonhosted.org/packages/cf/7e/afe6b4d2f60a0bb4556a245fef5fd22eab558494ce9a2e2df92669c63dad/pgsrip-0.1.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-26 10:16:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ratoaq2",
"github_project": "pgsrip",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pgsrip"
}