substui 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- substui-0.1.0/.github/workflows/ci.yml +35 -0
- substui-0.1.0/.github/workflows/publish.yml +51 -0
- substui-0.1.0/.gitignore +11 -0
- substui-0.1.0/CONTRIBUTING.md +37 -0
- substui-0.1.0/LICENSE +22 -0
- substui-0.1.0/PKG-INFO +196 -0
- substui-0.1.0/README.md +163 -0
- substui-0.1.0/RELEASING.md +38 -0
- substui-0.1.0/pyproject.toml +59 -0
- substui-0.1.0/src/substui/__init__.py +4 -0
- substui-0.1.0/src/substui/__main__.py +5 -0
- substui-0.1.0/src/substui/app.py +328 -0
- substui-0.1.0/src/substui/matching.py +162 -0
- substui-0.1.0/src/substui/settings.py +40 -0
- substui-0.1.0/src/substui/subtitles.py +120 -0
- substui-0.1.0/tests/test_app.py +38 -0
- substui-0.1.0/tests/test_matching.py +76 -0
- substui-0.1.0/tests/test_settings.py +29 -0
- substui-0.1.0/tests/test_subtitles.py +16 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
name: ${{ matrix.os }} · Python ${{ matrix.python-version }}
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
os: [ubuntu-latest, windows-latest]
|
|
19
|
+
python-version: ["3.10", "3.13"]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
|
+
with:
|
|
24
|
+
persist-credentials: false
|
|
25
|
+
- uses: actions/setup-python@v6
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
cache: pip
|
|
29
|
+
- name: Install package
|
|
30
|
+
run: python -m pip install --upgrade pip ".[dev]"
|
|
31
|
+
- name: Lint
|
|
32
|
+
run: python -m ruff check .
|
|
33
|
+
- name: Test
|
|
34
|
+
run: python -m pytest -q
|
|
35
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: Build and verify distribution
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
|
+
with:
|
|
18
|
+
persist-credentials: false
|
|
19
|
+
- uses: actions/setup-python@v6
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.13"
|
|
22
|
+
cache: pip
|
|
23
|
+
- name: Install build tools
|
|
24
|
+
run: python -m pip install --upgrade build twine
|
|
25
|
+
- name: Build wheel and source archive
|
|
26
|
+
run: python -m build
|
|
27
|
+
- name: Verify package metadata
|
|
28
|
+
run: python -m twine check dist/*
|
|
29
|
+
- uses: actions/upload-artifact@v5
|
|
30
|
+
with:
|
|
31
|
+
name: python-package-distributions
|
|
32
|
+
path: dist/
|
|
33
|
+
if-no-files-found: error
|
|
34
|
+
|
|
35
|
+
publish:
|
|
36
|
+
name: Publish package
|
|
37
|
+
needs: build
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
environment:
|
|
40
|
+
name: pypi
|
|
41
|
+
url: https://pypi.org/project/substui/
|
|
42
|
+
permissions:
|
|
43
|
+
id-token: write
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/download-artifact@v6
|
|
46
|
+
with:
|
|
47
|
+
name: python-package-distributions
|
|
48
|
+
path: dist/
|
|
49
|
+
- name: Publish to PyPI
|
|
50
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
51
|
+
|
substui-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Como contribuir
|
|
2
|
+
|
|
3
|
+
Obrigado por ajudar o SubsTUI.
|
|
4
|
+
|
|
5
|
+
## Antes de começar
|
|
6
|
+
|
|
7
|
+
- Procure uma issue existente antes de abrir outra.
|
|
8
|
+
- Para mudanças grandes de interface ou comportamento, abra uma issue descrevendo a proposta.
|
|
9
|
+
- Não inclua credenciais, tokens, vídeos ou legendas protegidas por direitos autorais no repositório.
|
|
10
|
+
|
|
11
|
+
## Ambiente local
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git clone https://github.com/codyzzd/substui.git
|
|
15
|
+
cd substui
|
|
16
|
+
python -m venv .venv
|
|
17
|
+
python -m pip install -e ".[dev]"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Antes de enviar um pull request:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
python -m ruff check .
|
|
24
|
+
python -m pytest
|
|
25
|
+
python -m build
|
|
26
|
+
python -m twine check dist/*
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Pull requests
|
|
30
|
+
|
|
31
|
+
- Explique o problema resolvido e como testou a mudança.
|
|
32
|
+
- Mantenha o escopo pequeno e evite alterações não relacionadas.
|
|
33
|
+
- Adicione ou atualize testes quando mudar comportamento.
|
|
34
|
+
- Preserve compatibilidade com Windows e Linux.
|
|
35
|
+
|
|
36
|
+
Ao contribuir, você concorda que sua mudança será distribuída sob a licença MIT do projeto.
|
|
37
|
+
|
substui-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 codyzzd e contribuidores do SubsTUI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
substui-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: substui
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Navegador TUI para buscar e baixar legendas
|
|
5
|
+
Project-URL: Homepage, https://github.com/codyzzd/substui
|
|
6
|
+
Project-URL: Repository, https://github.com/codyzzd/substui.git
|
|
7
|
+
Project-URL: Issues, https://github.com/codyzzd/substui/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/codyzzd/substui/releases
|
|
9
|
+
Author: codyzzd
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: opensubtitles,subliminal,subtitles,terminal,tui
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Multimedia :: Video
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: platformdirs>=4.0
|
|
25
|
+
Requires-Dist: subliminal<3,>=2.3
|
|
26
|
+
Requires-Dist: textual<8,>=0.89
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
30
|
+
Requires-Dist: ruff>=0.8; extra == 'dev'
|
|
31
|
+
Requires-Dist: twine>=6; extra == 'dev'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# SubsTUI
|
|
35
|
+
|
|
36
|
+
[](https://github.com/codyzzd/substui/actions/workflows/ci.yml)
|
|
37
|
+
[](https://pypi.org/project/substui/)
|
|
38
|
+
[](https://www.python.org/)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
|
|
41
|
+
Encontre a legenda certa sem sair do terminal.
|
|
42
|
+
|
|
43
|
+
O SubsTUI é um navegador de arquivos com interface TUI que pesquisa, compara e baixa legendas
|
|
44
|
+
ao lado dos seus vídeos. Ele usa o [Subliminal](https://github.com/Diaoul/subliminal) para consultar
|
|
45
|
+
múltiplos provedores e acrescenta um ranking próprio para separar o release correto de resultados
|
|
46
|
+
com título parecido, ano errado ou outra fonte de vídeo.
|
|
47
|
+
|
|
48
|
+
> O projeto está em fase alfa. A busca depende da disponibilidade e dos limites dos provedores.
|
|
49
|
+
|
|
50
|
+
## Comece com um comando
|
|
51
|
+
|
|
52
|
+
Com o [`uv`](https://docs.astral.sh/uv/) instalado, execute o SubsTUI sem clonar nem instalar o
|
|
53
|
+
projeto:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
uvx --from git+https://github.com/codyzzd/substui.git substui
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Depois da primeira publicação no PyPI, o comando fica ainda menor:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uvx substui
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
O `uvx` baixa o pacote e suas dependências em um ambiente isolado e abre a TUI. Ele funciona no
|
|
66
|
+
Windows, Linux e macOS. Assim como o `npx` requer Node, este método requer apenas o `uv`.
|
|
67
|
+
|
|
68
|
+
### Instalar o uv
|
|
69
|
+
|
|
70
|
+
Windows, com Winget:
|
|
71
|
+
|
|
72
|
+
```powershell
|
|
73
|
+
winget install --id=astral-sh.uv -e
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
macOS, com Homebrew:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
brew install uv
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Linux e macOS, com o instalador oficial:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
No Windows também é possível usar o instalador oficial:
|
|
89
|
+
|
|
90
|
+
```powershell
|
|
91
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Instalação permanente
|
|
95
|
+
|
|
96
|
+
Para deixar o comando `substui` disponível de qualquer pasta:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
uv tool install git+https://github.com/codyzzd/substui.git
|
|
100
|
+
substui
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Após a publicação no PyPI:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
uv tool install substui
|
|
107
|
+
substui
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
O `pipx` continua disponível como alternativa para quem já usa Python:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
pipx install substui
|
|
114
|
+
substui
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Se o comando não aparecer imediatamente após uma instalação permanente, execute
|
|
118
|
+
`uv tool update-shell` e abra um terminal novo.
|
|
119
|
+
|
|
120
|
+
## O que ele faz
|
|
121
|
+
|
|
122
|
+
- Navega pelas pastas exibindo somente diretórios e arquivos de vídeo.
|
|
123
|
+
- Pesquisa em vários provedores, incluindo OpenSubtitles e OpenSubtitles.com.
|
|
124
|
+
- Ranqueia legendas por título, ano, hash, fonte, resolução, codecs e grupo de release.
|
|
125
|
+
- Classifica cada resultado como `EXATO`, `ÓTIMO`, `BOM`, `POSSÍVEL` ou `BAIXO`.
|
|
126
|
+
- Oculta resultados claramente incompatíveis, mas permite revisá-los com `F`.
|
|
127
|
+
- Baixa uma opção escolhida ou seleciona automaticamente o melhor match confiável.
|
|
128
|
+
- Salva idioma e última pasta entre execuções.
|
|
129
|
+
- Grava a legenda ao lado do vídeo, normalmente como `video.pt-BR.srt`.
|
|
130
|
+
|
|
131
|
+
## Como funciona o ranking
|
|
132
|
+
|
|
133
|
+
O score técnico do Subliminal é combinado com uma análise do nome real do release:
|
|
134
|
+
|
|
135
|
+
- Um hash igual recebe prioridade máxima.
|
|
136
|
+
- Título, ano, temporada e episódio definem a identidade do conteúdo.
|
|
137
|
+
- `BluRay`, `WEB-DL`, `TELESYNC`, resolução, codecs e grupo ajudam a identificar o corte correto.
|
|
138
|
+
- Ano, temporada ou episódio divergentes invalidam o resultado.
|
|
139
|
+
- Uma fonte diferente reduz a confiança porque pode indicar tempos e cortes diferentes.
|
|
140
|
+
|
|
141
|
+
Assim, uma legenda para `The.Odyssey.2026.1080p.BluRay` aparece acima de um making-of, de uma
|
|
142
|
+
versão de 2016 ou de outro filme que apenas contém “Odyssey” no nome.
|
|
143
|
+
|
|
144
|
+
## Atalhos
|
|
145
|
+
|
|
146
|
+
| Tecla | Ação |
|
|
147
|
+
|---|---|
|
|
148
|
+
| `↑` / `↓` / `Enter` | Navegar e selecionar |
|
|
149
|
+
| `R` | Buscar legendas novamente |
|
|
150
|
+
| `D` | Baixar a legenda selecionada |
|
|
151
|
+
| `B` | Baixar o melhor match confiável |
|
|
152
|
+
| `F` | Mostrar ou ocultar resultados fracos |
|
|
153
|
+
| `U` | Subir uma pasta |
|
|
154
|
+
| `Ctrl+L` | Digitar outro caminho |
|
|
155
|
+
| `Ctrl+Q` | Sair |
|
|
156
|
+
|
|
157
|
+
O idioma é escolhido no topo da interface. Português do Brasil (`pt-BR`) é o padrão.
|
|
158
|
+
|
|
159
|
+
## Provedores
|
|
160
|
+
|
|
161
|
+
Alguns provedores funcionam sem conta; outros podem exigir credenciais, limitar requisições ou
|
|
162
|
+
ficar temporariamente indisponíveis. O SubsTUI não hospeda legendas: ele consulta os provedores
|
|
163
|
+
configurados pelo Subliminal e salva somente o resultado escolhido pelo usuário.
|
|
164
|
+
|
|
165
|
+
## Desenvolvimento
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
git clone https://github.com/codyzzd/substui.git
|
|
169
|
+
cd substui
|
|
170
|
+
python -m venv .venv
|
|
171
|
+
python -m pip install -e ".[dev]"
|
|
172
|
+
python -m pytest
|
|
173
|
+
python -m ruff check .
|
|
174
|
+
python -m build
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
O CI testa o projeto no Windows e Linux com Python 3.10 e 3.13. Consulte
|
|
178
|
+
[RELEASING.md](RELEASING.md) para publicar uma nova versão no PyPI.
|
|
179
|
+
|
|
180
|
+
## Roadmap
|
|
181
|
+
|
|
182
|
+
- Tela para configurar provedores e credenciais.
|
|
183
|
+
- Pré-visualização de trechos antes do download.
|
|
184
|
+
- Download em lote para uma temporada ou pasta.
|
|
185
|
+
- Binários independentes para Windows, Linux e macOS.
|
|
186
|
+
- Instalação por gerenciadores como Winget e Homebrew.
|
|
187
|
+
|
|
188
|
+
## Contribuindo
|
|
189
|
+
|
|
190
|
+
Issues e pull requests são bem-vindos. Veja [CONTRIBUTING.md](CONTRIBUTING.md) antes de enviar uma
|
|
191
|
+
mudança maior.
|
|
192
|
+
|
|
193
|
+
## Licença
|
|
194
|
+
|
|
195
|
+
Distribuído sob a [licença MIT](LICENSE).
|
|
196
|
+
|
substui-0.1.0/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# SubsTUI
|
|
2
|
+
|
|
3
|
+
[](https://github.com/codyzzd/substui/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/substui/)
|
|
5
|
+
[](https://www.python.org/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
Encontre a legenda certa sem sair do terminal.
|
|
9
|
+
|
|
10
|
+
O SubsTUI é um navegador de arquivos com interface TUI que pesquisa, compara e baixa legendas
|
|
11
|
+
ao lado dos seus vídeos. Ele usa o [Subliminal](https://github.com/Diaoul/subliminal) para consultar
|
|
12
|
+
múltiplos provedores e acrescenta um ranking próprio para separar o release correto de resultados
|
|
13
|
+
com título parecido, ano errado ou outra fonte de vídeo.
|
|
14
|
+
|
|
15
|
+
> O projeto está em fase alfa. A busca depende da disponibilidade e dos limites dos provedores.
|
|
16
|
+
|
|
17
|
+
## Comece com um comando
|
|
18
|
+
|
|
19
|
+
Com o [`uv`](https://docs.astral.sh/uv/) instalado, execute o SubsTUI sem clonar nem instalar o
|
|
20
|
+
projeto:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
uvx --from git+https://github.com/codyzzd/substui.git substui
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Depois da primeira publicação no PyPI, o comando fica ainda menor:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uvx substui
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
O `uvx` baixa o pacote e suas dependências em um ambiente isolado e abre a TUI. Ele funciona no
|
|
33
|
+
Windows, Linux e macOS. Assim como o `npx` requer Node, este método requer apenas o `uv`.
|
|
34
|
+
|
|
35
|
+
### Instalar o uv
|
|
36
|
+
|
|
37
|
+
Windows, com Winget:
|
|
38
|
+
|
|
39
|
+
```powershell
|
|
40
|
+
winget install --id=astral-sh.uv -e
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
macOS, com Homebrew:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
brew install uv
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Linux e macOS, com o instalador oficial:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
No Windows também é possível usar o instalador oficial:
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Instalação permanente
|
|
62
|
+
|
|
63
|
+
Para deixar o comando `substui` disponível de qualquer pasta:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
uv tool install git+https://github.com/codyzzd/substui.git
|
|
67
|
+
substui
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Após a publicação no PyPI:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
uv tool install substui
|
|
74
|
+
substui
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
O `pipx` continua disponível como alternativa para quem já usa Python:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pipx install substui
|
|
81
|
+
substui
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Se o comando não aparecer imediatamente após uma instalação permanente, execute
|
|
85
|
+
`uv tool update-shell` e abra um terminal novo.
|
|
86
|
+
|
|
87
|
+
## O que ele faz
|
|
88
|
+
|
|
89
|
+
- Navega pelas pastas exibindo somente diretórios e arquivos de vídeo.
|
|
90
|
+
- Pesquisa em vários provedores, incluindo OpenSubtitles e OpenSubtitles.com.
|
|
91
|
+
- Ranqueia legendas por título, ano, hash, fonte, resolução, codecs e grupo de release.
|
|
92
|
+
- Classifica cada resultado como `EXATO`, `ÓTIMO`, `BOM`, `POSSÍVEL` ou `BAIXO`.
|
|
93
|
+
- Oculta resultados claramente incompatíveis, mas permite revisá-los com `F`.
|
|
94
|
+
- Baixa uma opção escolhida ou seleciona automaticamente o melhor match confiável.
|
|
95
|
+
- Salva idioma e última pasta entre execuções.
|
|
96
|
+
- Grava a legenda ao lado do vídeo, normalmente como `video.pt-BR.srt`.
|
|
97
|
+
|
|
98
|
+
## Como funciona o ranking
|
|
99
|
+
|
|
100
|
+
O score técnico do Subliminal é combinado com uma análise do nome real do release:
|
|
101
|
+
|
|
102
|
+
- Um hash igual recebe prioridade máxima.
|
|
103
|
+
- Título, ano, temporada e episódio definem a identidade do conteúdo.
|
|
104
|
+
- `BluRay`, `WEB-DL`, `TELESYNC`, resolução, codecs e grupo ajudam a identificar o corte correto.
|
|
105
|
+
- Ano, temporada ou episódio divergentes invalidam o resultado.
|
|
106
|
+
- Uma fonte diferente reduz a confiança porque pode indicar tempos e cortes diferentes.
|
|
107
|
+
|
|
108
|
+
Assim, uma legenda para `The.Odyssey.2026.1080p.BluRay` aparece acima de um making-of, de uma
|
|
109
|
+
versão de 2016 ou de outro filme que apenas contém “Odyssey” no nome.
|
|
110
|
+
|
|
111
|
+
## Atalhos
|
|
112
|
+
|
|
113
|
+
| Tecla | Ação |
|
|
114
|
+
|---|---|
|
|
115
|
+
| `↑` / `↓` / `Enter` | Navegar e selecionar |
|
|
116
|
+
| `R` | Buscar legendas novamente |
|
|
117
|
+
| `D` | Baixar a legenda selecionada |
|
|
118
|
+
| `B` | Baixar o melhor match confiável |
|
|
119
|
+
| `F` | Mostrar ou ocultar resultados fracos |
|
|
120
|
+
| `U` | Subir uma pasta |
|
|
121
|
+
| `Ctrl+L` | Digitar outro caminho |
|
|
122
|
+
| `Ctrl+Q` | Sair |
|
|
123
|
+
|
|
124
|
+
O idioma é escolhido no topo da interface. Português do Brasil (`pt-BR`) é o padrão.
|
|
125
|
+
|
|
126
|
+
## Provedores
|
|
127
|
+
|
|
128
|
+
Alguns provedores funcionam sem conta; outros podem exigir credenciais, limitar requisições ou
|
|
129
|
+
ficar temporariamente indisponíveis. O SubsTUI não hospeda legendas: ele consulta os provedores
|
|
130
|
+
configurados pelo Subliminal e salva somente o resultado escolhido pelo usuário.
|
|
131
|
+
|
|
132
|
+
## Desenvolvimento
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
git clone https://github.com/codyzzd/substui.git
|
|
136
|
+
cd substui
|
|
137
|
+
python -m venv .venv
|
|
138
|
+
python -m pip install -e ".[dev]"
|
|
139
|
+
python -m pytest
|
|
140
|
+
python -m ruff check .
|
|
141
|
+
python -m build
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
O CI testa o projeto no Windows e Linux com Python 3.10 e 3.13. Consulte
|
|
145
|
+
[RELEASING.md](RELEASING.md) para publicar uma nova versão no PyPI.
|
|
146
|
+
|
|
147
|
+
## Roadmap
|
|
148
|
+
|
|
149
|
+
- Tela para configurar provedores e credenciais.
|
|
150
|
+
- Pré-visualização de trechos antes do download.
|
|
151
|
+
- Download em lote para uma temporada ou pasta.
|
|
152
|
+
- Binários independentes para Windows, Linux e macOS.
|
|
153
|
+
- Instalação por gerenciadores como Winget e Homebrew.
|
|
154
|
+
|
|
155
|
+
## Contribuindo
|
|
156
|
+
|
|
157
|
+
Issues e pull requests são bem-vindos. Veja [CONTRIBUTING.md](CONTRIBUTING.md) antes de enviar uma
|
|
158
|
+
mudança maior.
|
|
159
|
+
|
|
160
|
+
## Licença
|
|
161
|
+
|
|
162
|
+
Distribuído sob a [licença MIT](LICENSE).
|
|
163
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Publicação do SubsTUI
|
|
2
|
+
|
|
3
|
+
## 1. Criar o repositório
|
|
4
|
+
|
|
5
|
+
O repositório oficial é `codyzzd/substui`. Envie a branch `main`:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git remote add origin https://github.com/codyzzd/substui.git
|
|
9
|
+
git push -u origin main
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 2. Conectar GitHub ao PyPI
|
|
13
|
+
|
|
14
|
+
Em [PyPI Trusted Publishing](https://pypi.org/manage/account/publishing/), cadastre um
|
|
15
|
+
*pending publisher* com:
|
|
16
|
+
|
|
17
|
+
- PyPI project name: `substui`
|
|
18
|
+
- Owner: `codyzzd`
|
|
19
|
+
- Repository: `substui`
|
|
20
|
+
- Workflow: `publish.yml`
|
|
21
|
+
- Environment: `pypi`
|
|
22
|
+
|
|
23
|
+
No GitHub, crie também o environment `pypi` em **Settings → Environments**. É recomendável
|
|
24
|
+
exigir aprovação manual para proteger cada publicação.
|
|
25
|
+
|
|
26
|
+
## 3. Fazer uma release
|
|
27
|
+
|
|
28
|
+
Atualize a versão em `pyproject.toml` e `src/substui/__init__.py`, faça commit e crie uma GitHub
|
|
29
|
+
Release com uma tag correspondente, por exemplo `v0.1.0`. O workflow `Publish to PyPI` constrói,
|
|
30
|
+
verifica e publica o pacote sem armazenar senha ou token no GitHub.
|
|
31
|
+
|
|
32
|
+
Depois da primeira publicação:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pipx install substui
|
|
36
|
+
substui
|
|
37
|
+
```
|
|
38
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "substui"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Navegador TUI para buscar e baixar legendas"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [{ name = "codyzzd" }]
|
|
13
|
+
keywords = ["subtitles", "tui", "opensubtitles", "subliminal", "terminal"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Multimedia :: Video",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"platformdirs>=4.0",
|
|
28
|
+
"subliminal>=2.3,<3",
|
|
29
|
+
"textual>=0.89,<8",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
dev = [
|
|
34
|
+
"build>=1.2",
|
|
35
|
+
"pytest>=8",
|
|
36
|
+
"ruff>=0.8",
|
|
37
|
+
"twine>=6",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
substui = "substui.app:main"
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/codyzzd/substui"
|
|
45
|
+
Repository = "https://github.com/codyzzd/substui.git"
|
|
46
|
+
Issues = "https://github.com/codyzzd/substui/issues"
|
|
47
|
+
Changelog = "https://github.com/codyzzd/substui/releases"
|
|
48
|
+
|
|
49
|
+
[tool.hatch.build.targets.wheel]
|
|
50
|
+
packages = ["src/substui"]
|
|
51
|
+
|
|
52
|
+
[tool.pytest.ini_options]
|
|
53
|
+
pythonpath = ["src"]
|
|
54
|
+
testpaths = ["tests"]
|
|
55
|
+
|
|
56
|
+
[tool.ruff]
|
|
57
|
+
line-length = 100
|
|
58
|
+
target-version = "py310"
|
|
59
|
+
|