Packaging with flit

This commit is contained in:
Barbagus 2022-12-08 22:39:46 +01:00
parent 5125f1d6ba
commit f22fe297c5
7 changed files with 37 additions and 28 deletions

4
.gitignore vendored
View File

@ -2,4 +2,6 @@
*.pyc
__pycache__/
.vscode/
*.mkv
*.mkv
dist/
.venv/

View File

@ -14,20 +14,7 @@ ArteTV is a is a European public service channel dedicated to culture. Available
🚀 Quick start
---------------
_(Linux/Debian distribution)_
```bash
sudo apt install ffmpeg
mkdir ~/.venvs && python3 -m venv ~/.venvs/delarte
source ~/.venvs/delarte/bin/activate
git clone https://gitlab.com/Barbagus/delarte.git && cd delarte
pip install -r requirements.txt
export PATH_FFMPEG=$(which ffmpeg)
```
```bash
./delarte.py <PROGRAM_PAGE_URL> <VERSION> <RESOLUTION>
```
_to be determined_
🔧 How it works

28
pyproject.toml Normal file
View File

@ -0,0 +1,28 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
[project]
name = "delarte"
authors = [{name = "Etienne Zind", email = "etienne.zind@proton.me"}]
readme = "README.md"
license = {file = "LICENSE.md"}
classifiers = ["License :: OSI Approved :: GNU Affero General Public License v3"]
dynamic = ["version", "description"]
dependencies = [
"m3u8",
"webvtt-py",
]
[project.urls]
Home = "https://gitlab.com/Barbagus/delarte"
[project.optional-dependencies]
dev = [
"black",
"pydocstyle",
"toml"
]
[project.scripts]
delarte = "delarte:main"

View File

@ -1,3 +0,0 @@
black
pydocstyle
toml

View File

@ -1,2 +0,0 @@
m3u8
webvtt-py

10
delarte.py → src/delarte/__init__.py Executable file → Normal file
View File

@ -1,6 +1,3 @@
#!/usr/bin/env python3
# coding: utf8
"""delarte.
ArteTV downloader
@ -9,6 +6,7 @@ Licence: GNU AGPL v3: http://www.gnu.org/licenses/
This file is part of [`delarte`](https://gitlab.com/Barbagus/delarte)
"""
__version__ = "0.1"
import io
import json
@ -190,7 +188,7 @@ def build_args(video_index_url, audio_track, subtitles_track, file_base_name):
if subtitles_track:
subtitles_lang, subtitles_file = subtitles_track
args = [FFMPEG]
args = ["ffmpeg"]
args.extend(["-i", video_index_url])
args.extend(["-i", audio_index_url])
if subtitles_track:
@ -252,7 +250,3 @@ def main():
subprocess.run(args)
if subtitle_file:
os.unlink(subtitle_file)
if __name__ == "__main__":
sys.exit(main())

3
src/delarte/__main__.py Normal file
View File

@ -0,0 +1,3 @@
from . import main
main()