Skip to content

Commit

Permalink
Merge pull request #4 from sentenzo/dev
Browse files Browse the repository at this point in the history
Regular `dev` merge
`v1.0.1 => v1.1.0`
  • Loading branch information
sentenzo authored Sep 9, 2022
2 parents cfb067e + 16bbe6a commit fe3d42b
Show file tree
Hide file tree
Showing 28 changed files with 656 additions and 55 deletions.
28 changes: 15 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@ else
endif
endif

# APP_FILE = app
APP_FILE = app_gui

APP_NAME = tubic

ENTRY_POINT = ./$(APP_NAME)/$(APP_FILE).py
PACKAGE_NAME = tubic

all: build

pyui:
poetry run python -m PyQt6.uic.pyuic \
-o ./$(APP_NAME)/qt_wrap/pyui/main_window.py \
-x ./$(APP_NAME)/qt_wrap/ui/main_window.ui
-o ./$(PACKAGE_NAME)/qt_wrap/pyui/main_window.py \
-x ./$(PACKAGE_NAME)/qt_wrap/ui/main_window.ui

build: pyui
poetry run pyinstaller \
Expand All @@ -34,17 +30,23 @@ build: pyui
--specpath ./.pyinstaller \
--noconsole \
--onefile \
--name $(APP_NAME) \
--icon ../rec/ico/file-video.ico \
--add-data ../rec/ico/*;./rec/ico \
$(ENTRY_POINT)
--name $(PACKAGE_NAME) \
--icon ../$(PACKAGE_NAME)/rec/ico/file-video.ico \
--add-data ../$(PACKAGE_NAME)/rec/ico/*;./$(PACKAGE_NAME)/rec/ico \
$(PACKAGE_NAME)/__main__.py

run:
./bin/$(APP_NAME)
./bin/$(PACKAGE_NAME)

runpy: pyui
poetry run python $(ENTRY_POINT)
poetry run python -m $(PACKAGE_NAME)

clean:
$(RM) $(call FixPath,./bin/*)
$(RM) $(call FixPath,./.pyinstaller/*)

test: pyui
poetry run python -m pytest -m "not slow" --verbosity=2 --showlocals --log-level=DEBUG

test-full: pyui
poetry run python -m pytest --verbosity=2 --showlocals --log-level=DEBUG
94 changes: 90 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,103 @@


# tubic
<div align="center">

![Screenshot](tubic.webp)

A simple graphical interface for the [yt-dlp](https://github.com/yt-dlp/yt-dlp) tool.
</div>
A simple lightweight portable single-file program to download videos from YouTube.

---

- [Installation](#installation)
- [Backstory](#backstory)
- [Building](#building)
- [Software requirements](#software-requirements)
- [First run](#first-run)
- [GUI editing](#gui-editing)
- [Basic `make` targets](#basic-make-targets)
- [Licensing](#licensing)

## Installation

(non required)

1. Download the executable named `tubic.exe`, from the [latest release](https://github.com/sentenzo/tubic/releases/latest)
2. Run the executable

## Backstory

Why making another YouTube downloader, when we already have `%YOUR_FAVORITE_APP_NAME%`, which is a lot better, than this stuff will ever be?

Well...

~~Just for fun~~

~~Because I can~~

I've been trying out several tools of that kind, and each one of them had some flaw critical for me. Such as:

- overweight — installing TarTube once took me something about half an hour
- console-only — so I was unable to recomend it to my elderly relatives and non-IT friends
- comercial
- server-side component — so at some point you find your tool turned into a pumpkin because the servers are down (that's exactly what happened with me once)
- overly complex GUI (again elderly relatives won't appriciate)

I feel an unfulfilled demand for a very simple tool, which would:
- -be able to download both video and audio by a YouTube link
- -have a simple GUI (the less buttons — the better)
- -be portable (ideally: packed in a single executable)

The features I (subjectively) consider redundant:
- sequential download from a list of links
- post-processing (`video: 1080p → 780p` or `audio: 320 kbps → 96 kbps`)
- converting formats (`mp4 → mkv` or `webm → mp3`)

The application is packed in a single executable file with no dependencies.
So that's how I've decided to make this stuff.

It uses [yt-dlp](https://github.com/yt-dlp/yt-dlp) (and utilizes probably less then 5% of it's full functionality).

The UI is implemented with [PyQt6](https://pypi.org/project/PyQt6/).

The application is packed in a single executable file with no dependencies (thanks to [pyinstaller](https://pypi.org/project/pyinstaller/)).

The target OS is currently Windows ≥ 10. Though, there's no OS-dependent features or libs used, so you're free to try and build it on Linux.

---
## Building

### Software requirements
- [**python3.10**](https://www.python.org/downloads/)

- [**make**](https://en.wikipedia.org/wiki/Make_(software)) tool — for build-automation. To install it on Windows, one can try [GNU make 4.3](https://community.chocolatey.org/packages/make) package from the [Chocolatey](https://github.com/chocolatey/choco) package manager.

- [**Poetry**](https://python-poetry.org/) — to administer Python dependencies.

- **Qt Designer** — to edit `*.ui` files (to draw windows and GUI elements in WYSIWYG editor). Versions `5.*` and `6.*` are equaly suitable. To install it there are several options:
- a [third party standalone installer](https://build-system.fman.io/qt-designer-download)
- a [PySide6 pip package](https://pypi.org/project/PySide6/) (`pip install PySide6` or `poetry add -D PySide6`, and then run `pyside6-designer`)
- the [official site](https://www.qt.io/) — ironicaly, not the best way, cause it is not distributed separately from all the over Qt tools and requires registration

### First run
In the project directory execute:

```bash
poetry install
```
\- to download all the Python packages required.

That's all.

### GUI editing

Qt Designer related files can be found at `tubic/qt_wrap/ui`.

### Basic `make` targets
- `make test` — run unit tests
- `make runpy` — run app with Python
- `make build` — create an executable in a `bin` folder

## License
## Licensing

- Current repository is licensed under [MIT License](https://github.com/sentenzo/tubic/blob/master/LICENSE)
- The icons for this application were taken from paomedia's [small-n-flat](https://github.com/paomedia/small-n-flat) set and licensed under [CC0 1.0 Universal](https://github.com/paomedia/small-n-flat/blob/master/LICENSE)
114 changes: 113 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ PyQt6 = "6.3.1"
[tool.poetry.group.dev.dependencies]
black = "^22.8.0"
pyinstaller = "4.10"
pytest = "^7.1.3"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
Empty file added tests/__init__.py
Empty file.
Loading

0 comments on commit fe3d42b

Please sign in to comment.