diff options
18 files changed, 102 insertions, 18 deletions
@@ -1,6 +1,8 @@ - +# Temp files __pycache__/ -build/ +dist/ flycheck* +hypervideo_gui.egg-info *.spec *.json +MANIFEST @@ -4,15 +4,19 @@ Simple Hypervideo Downloader GUI is intended to serve as a basic interface for downloading YouTube videos/audio that can be easily shared and used by non-programmers. - + ### Dependencies - PyQt5 (`pacman -S python-pyqt5`) - hypervideo (`pacman -S hypervideo`) - ffmpeg (`pacman -S ffmpeg`) +### Install + +`pacman -S hypervideo-gui` + ### Usage -1. Run `python hypervideo_gui.py` +1. Run `hypervideo-gui` in terminal 2. Enter the URL of the video you want to download into the top "URL" textbox. 3. Then enter the folder to save the video to in the "Output Folder" textbox. 4. Next choose the video format @@ -29,8 +33,8 @@ For default, download path settings are saved in file `~/.config/hypervideo_gui/hypervideo_gui_state.json` ### Developer Setup -Just set up Python3 with libraries PyQT5. -`cd` to the repository path, and then `python hypervideo_gui.py`. +Just set up Python3 with libraries PyQt5. +`cd` to the repository path, and then `python script.py`. ### Troubleshooting Make sure you have the latest version of hypervideo! Use `pacman -Sy hypervideo`in the command line. diff --git a/bin/hypervideo-gui b/bin/hypervideo-gui new file mode 100644 index 0000000..e9c2fcf --- /dev/null +++ b/bin/hypervideo-gui @@ -0,0 +1,12 @@ +#!/usr/bin/python + +import sys + +from hypervideo_gui.main_ui import * + +# Exec APP +if __name__ == '__main__': + APP = QApplication(sys.argv) + APP.setStyle('Fusion') + ex = App() + sys.exit(APP.exec_()) diff --git a/hypervideo_gui/__init__.py b/hypervideo_gui/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/hypervideo_gui/__init__.py diff --git a/hypervideo_gui.py b/hypervideo_gui/main_ui.py index c668d27..ab217a1 100644 --- a/hypervideo_gui.py +++ b/hypervideo_gui/main_ui.py @@ -1,6 +1,7 @@ +#!/usr/bin/python + ''' Hypervideo GUI ''' -import sys import os import re import threading @@ -27,7 +28,7 @@ from PyQt5.QtCore import ( pyqtSlot, ) -__version__ = "0.1" +__version__ = '0.1' __license__ = "GPL-3" __path__ = os.environ['HOME'] @@ -414,9 +415,3 @@ def get_default_download_path(): if not os.path.exists(dpath): os.makedirs(dpath) return os.path.join(dpath) - -if __name__ == '__main__': - APP = QApplication(sys.argv) - APP.setStyle('Fusion') - ex = App() - sys.exit(APP.exec_()) diff --git a/images/hypervideo_gui.png b/images/screenshot.png Binary files differindex 7a8e558..7a8e558 100644 --- a/images/hypervideo_gui.png +++ b/images/screenshot.png diff --git a/script.py b/script.py new file mode 100644 index 0000000..9bc382f --- /dev/null +++ b/script.py @@ -0,0 +1,12 @@ +""" Hypervideo-GUI Script """ + +import sys + +from hypervideo_gui.main_ui import * + +# Exec APP +if __name__ == '__main__': + APP = QApplication(sys.argv) + APP.setStyle('Fusion') + ex = App() + sys.exit(APP.exec_()) diff --git a/setup-files/gnu/hypervideo-gui.desktop b/setup-files/gnu/hypervideo-gui.desktop new file mode 100644 index 0000000..8d067d9 --- /dev/null +++ b/setup-files/gnu/hypervideo-gui.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Hypervideo GUI +Comment=Simple Hypervideo Downloader GUI +Comment[es]=Interfaz gráfica para Hypervideo +Icon=hypervideo-gui +Exec=hypervideo-gui %F +Terminal=false +Categories=AudioVideo diff --git a/setup-files/gnu/icons/hicolor/128x128/apps/hypervideo-gui.png b/setup-files/gnu/icons/hicolor/128x128/apps/hypervideo-gui.png Binary files differnew file mode 100644 index 0000000..bbde900 --- /dev/null +++ b/setup-files/gnu/icons/hicolor/128x128/apps/hypervideo-gui.png diff --git a/setup-files/gnu/icons/hicolor/16x16/apps/hypervideo-gui.png b/setup-files/gnu/icons/hicolor/16x16/apps/hypervideo-gui.png Binary files differnew file mode 100644 index 0000000..6faa223 --- /dev/null +++ b/setup-files/gnu/icons/hicolor/16x16/apps/hypervideo-gui.png diff --git a/setup-files/gnu/icons/hicolor/192x192/apps/hypervideo-gui.png b/setup-files/gnu/icons/hicolor/192x192/apps/hypervideo-gui.png Binary files differnew file mode 100644 index 0000000..ffc7f07 --- /dev/null +++ b/setup-files/gnu/icons/hicolor/192x192/apps/hypervideo-gui.png diff --git a/setup-files/gnu/icons/hicolor/22x22/apps/hypervideo-gui.png b/setup-files/gnu/icons/hicolor/22x22/apps/hypervideo-gui.png Binary files differnew file mode 100644 index 0000000..121e09e --- /dev/null +++ b/setup-files/gnu/icons/hicolor/22x22/apps/hypervideo-gui.png diff --git a/setup-files/gnu/icons/hicolor/32x32/apps/hypervideo-gui.png b/setup-files/gnu/icons/hicolor/32x32/apps/hypervideo-gui.png Binary files differnew file mode 100644 index 0000000..782aeb6 --- /dev/null +++ b/setup-files/gnu/icons/hicolor/32x32/apps/hypervideo-gui.png diff --git a/setup-files/gnu/icons/hicolor/384x384/apps/hypervideo-gui.png b/setup-files/gnu/icons/hicolor/384x384/apps/hypervideo-gui.png Binary files differnew file mode 100644 index 0000000..196dc2a --- /dev/null +++ b/setup-files/gnu/icons/hicolor/384x384/apps/hypervideo-gui.png diff --git a/setup-files/gnu/icons/hicolor/48x48/apps/hypervideo-gui.png b/setup-files/gnu/icons/hicolor/48x48/apps/hypervideo-gui.png Binary files differnew file mode 100644 index 0000000..6ee0f0f --- /dev/null +++ b/setup-files/gnu/icons/hicolor/48x48/apps/hypervideo-gui.png diff --git a/setup-files/gnu/icons/hicolor/64x64/apps/hypervideo-gui.png b/setup-files/gnu/icons/hicolor/64x64/apps/hypervideo-gui.png Binary files differnew file mode 100644 index 0000000..dcb995c --- /dev/null +++ b/setup-files/gnu/icons/hicolor/64x64/apps/hypervideo-gui.png diff --git a/setup-files/gnu/icons/hicolor/96x96/apps/hypervideo-gui.png b/setup-files/gnu/icons/hicolor/96x96/apps/hypervideo-gui.png Binary files differnew file mode 100644 index 0000000..328483f --- /dev/null +++ b/setup-files/gnu/icons/hicolor/96x96/apps/hypervideo-gui.png @@ -1,9 +1,57 @@ -# coding: utf-8 +""" Setup """ +import os +import sys -from distutils.core import setup +try: + from setuptools import setup, Command + setuptools_available = True +except ImportError: + from distutils.core import setup, Command + setuptools_available = False -from hypervideo_gui import __version__, __license__ +from hypervideo_gui.main_ui import ( + __version__, + __license__, +) + +script_exec = os.path.join('bin', 'hypervideo-gui') + + +# Begin - Desktop file and Icon +if sys.platform.startswith("linux"): + platform = 'gnu' +else: + sys.stderr.write("Unknown platform: %s" % sys.platform) + +ROOT_DIR = os.path.abspath(os.path.dirname(__file__)) +SETUP_DIR = os.path.join(ROOT_DIR, 'setup-files', platform) + + +def icon_data_files(): + ''' Loop icon files ''' + sizes = [16, 22, 32, 48, 64, 96, 128, 192, 384] + data_icons_files = [] + for size in sizes: + icon_dir = os.path.join("icons", "hicolor", "%sx%s" % (size, size), "apps") + source = os.path.join(SETUP_DIR, icon_dir, "hypervideo-gui.png") + dest = os.path.join("/usr/share/", icon_dir) + data_icons_files.append((dest, [source])) + return data_icons_files + + +def application_data_files(): + ''' Desktop file ''' + return [ + ('/usr/share/applications', + [os.path.join(SETUP_DIR, 'hypervideo-gui.desktop')]), + ] + + +def data_files(): + ''' Return desktop file and icons ''' + return application_data_files() + icon_data_files() +# setup( author="Jesús E.", @@ -15,5 +63,7 @@ setup( url="https://libregit.org/heckyel/hypervideo-gui", packages=[ 'hypervideo_gui', - ] + ], + scripts=[script_exec], + data_files=data_files(), ) |