From f8f0f9809a1eb2b58dcaf0397052b625b3639091 Mon Sep 17 00:00:00 2001 From: Kamui Date: Mon, 4 Sep 2023 21:23:19 -0500 Subject: [PATCH] chore: specify ytdlp version --- poetry.lock | 83 +++--------------------------------------------- pyproject.toml | 2 +- ytanki/ffmpeg.py | 16 ++++++++-- ytanki/worker.py | 4 ++- 4 files changed, 23 insertions(+), 82 deletions(-) diff --git a/poetry.lock b/poetry.lock index 4b8d422..27329be 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,10 +1,9 @@ -# This file is automatically @generated by Poetry and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "anki" version = "2.1.54" description = "" -category = "dev" optional = false python-versions = "*" files = [ @@ -32,7 +31,6 @@ syncserver = ["flask", "waitress"] name = "aqt" version = "2.1.54" description = "" -category = "dev" optional = false python-versions = "*" files = [ @@ -62,7 +60,6 @@ qt6 = ["pyqt6 (>=6.2)", "pyqt6-webengine (>=6.2)"] name = "attrs" version = "22.2.0" description = "Classes Without Boilerplate" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -81,7 +78,6 @@ tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy name = "beautifulsoup4" version = "4.11.2" description = "Screen-scraping library" -category = "dev" optional = false python-versions = ">=3.6.0" files = [ @@ -100,7 +96,6 @@ lxml = ["lxml"] name = "black" version = "23.1.0" description = "The uncompromising code formatter." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -149,7 +144,6 @@ uvloop = ["uvloop (>=0.15.2)"] name = "brotli" version = "1.0.9" description = "Python bindings for the Brotli compression library" -category = "main" optional = false python-versions = "*" files = [ @@ -241,7 +235,6 @@ files = [ name = "brotlicffi" version = "1.0.9.2" description = "Python CFFI bindings to the Brotli library" -category = "main" optional = false python-versions = "*" files = [ @@ -284,7 +277,6 @@ cffi = ">=1.0.0" name = "certifi" version = "2022.12.7" description = "Python package for providing Mozilla's CA Bundle." -category = "main" optional = false python-versions = ">=3.6" files = [ @@ -296,7 +288,6 @@ files = [ name = "cffi" version = "1.15.1" description = "Foreign Function Interface for Python calling C code." -category = "main" optional = false python-versions = "*" files = [ @@ -373,7 +364,6 @@ pycparser = "*" name = "cfgv" version = "3.3.1" description = "Validate configuration and produce human readable error messages." -category = "dev" optional = false python-versions = ">=3.6.1" files = [ @@ -385,7 +375,6 @@ files = [ name = "charset-normalizer" version = "3.1.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "dev" optional = false python-versions = ">=3.7.0" files = [ @@ -470,7 +459,6 @@ files = [ name = "click" version = "8.1.3" description = "Composable command line interface toolkit" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -485,7 +473,6 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." -category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -497,7 +484,6 @@ files = [ name = "coverage" version = "7.2.1" description = "Code coverage measurement for Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -564,7 +550,6 @@ toml = ["tomli"] name = "decorator" version = "5.1.1" description = "Decorators for Humans" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -576,7 +561,6 @@ files = [ name = "distlib" version = "0.3.6" description = "Distribution utilities" -category = "dev" optional = false python-versions = "*" files = [ @@ -588,7 +572,6 @@ files = [ name = "distro" version = "1.8.0" description = "Distro - an OS platform information API" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -600,7 +583,6 @@ files = [ name = "docopt" version = "0.6.2" description = "Pythonic argument parser, that will make you smile" -category = "main" optional = false python-versions = "*" files = [ @@ -611,7 +593,6 @@ files = [ name = "exceptiongroup" version = "1.1.1" description = "Backport of PEP 654 (exception groups)" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -626,7 +607,6 @@ test = ["pytest (>=6)"] name = "filelock" version = "3.9.0" description = "A platform independent file lock." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -642,7 +622,6 @@ testing = ["covdefaults (>=2.2.2)", "coverage (>=7.0.1)", "pytest (>=7.2)", "pyt name = "flask" version = "2.2.3" description = "A simple framework for building complex web applications." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -664,7 +643,6 @@ dotenv = ["python-dotenv"] name = "flask-cors" version = "3.0.10" description = "A Flask extension adding a decorator for CORS support" -category = "dev" optional = false python-versions = "*" files = [ @@ -680,7 +658,6 @@ Six = "*" name = "identify" version = "2.5.20" description = "File identification library for Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -695,7 +672,6 @@ license = ["ukkonen"] name = "idna" version = "3.4" description = "Internationalized Domain Names in Applications (IDNA)" -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -707,7 +683,6 @@ files = [ name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -719,7 +694,6 @@ files = [ name = "invoke" version = "2.0.0" description = "Pythonic task execution" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -731,7 +705,6 @@ files = [ name = "itsdangerous" version = "2.1.2" description = "Safely pass data to untrusted environments and back." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -743,7 +716,6 @@ files = [ name = "jinja2" version = "3.1.2" description = "A very fast and expressive template engine." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -761,7 +733,6 @@ i18n = ["Babel (>=2.7)"] name = "jsonschema" version = "4.17.3" description = "An implementation of JSON Schema validation for Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -781,7 +752,6 @@ format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339- name = "markdown" version = "3.4.1" description = "Python implementation of Markdown." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -796,7 +766,6 @@ testing = ["coverage", "pyyaml"] name = "markdown2" version = "2.4.8" description = "A fast and complete Python implementation of Markdown" -category = "dev" optional = false python-versions = ">=3.5, <4" files = [ @@ -813,7 +782,6 @@ wavedrom = ["wavedrom"] name = "markupsafe" version = "2.1.2" description = "Safely add untrusted strings to HTML/XML markup." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -873,7 +841,6 @@ files = [ name = "mutagen" version = "1.46.0" description = "read and write audio tags for many formats" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -885,7 +852,6 @@ files = [ name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." -category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -897,7 +863,6 @@ files = [ name = "nodeenv" version = "1.7.0" description = "Node.js virtual environment builder" -category = "dev" optional = false python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" files = [ @@ -912,7 +877,6 @@ setuptools = "*" name = "orjson" version = "3.8.7" description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -966,7 +930,6 @@ files = [ name = "packaging" version = "23.0" description = "Core utilities for Python packages" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -978,7 +941,6 @@ files = [ name = "pathspec" version = "0.11.0" description = "Utility library for gitignore style pattern matching of file paths." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -990,7 +952,6 @@ files = [ name = "platformdirs" version = "3.1.1" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1006,7 +967,6 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2.1)", "pytes name = "pluggy" version = "1.0.0" description = "plugin and hook calling mechanisms for python" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1022,7 +982,6 @@ testing = ["pytest", "pytest-benchmark"] name = "pre-commit" version = "3.1.1" description = "A framework for managing and maintaining multi-language pre-commit hooks." -category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1041,7 +1000,6 @@ virtualenv = ">=20.10.0" name = "protobuf" version = "4.22.1" description = "" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1064,7 +1022,6 @@ files = [ name = "psutil" version = "5.9.4" description = "Cross-platform lib for process and system monitoring in Python." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1091,7 +1048,6 @@ test = ["enum34", "ipaddress", "mock", "pywin32", "wmi"] name = "pycparser" version = "2.21" description = "C parser in Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1103,7 +1059,6 @@ files = [ name = "pycryptodomex" version = "3.17" description = "Cryptographic library for Python" -category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" files = [ @@ -1146,7 +1101,6 @@ files = [ name = "pyqt5" version = "5.15.9" description = "Python bindings for the Qt cross platform application toolkit" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1165,7 +1119,6 @@ PyQt5-sip = ">=12.11,<13" name = "pyqt5-qt5" version = "5.15.2" description = "The subset of a Qt installation needed by PyQt5." -category = "dev" optional = false python-versions = "*" files = [ @@ -1179,7 +1132,6 @@ files = [ name = "pyqt5-sip" version = "12.11.1" description = "The sip module support for PyQt5" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1210,7 +1162,6 @@ files = [ name = "pyqtwebengine" version = "5.15.6" description = "Python bindings for the Qt WebEngine framework" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1230,7 +1181,6 @@ PyQtWebEngine-Qt5 = ">=5.15.0" name = "pyqtwebengine-qt5" version = "5.15.2" description = "The subset of a Qt installation needed by PyQtWebEngine." -category = "dev" optional = false python-versions = "*" files = [ @@ -1244,7 +1194,6 @@ files = [ name = "pyright" version = "1.1.298" description = "Command line wrapper for pyright" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1263,7 +1212,6 @@ dev = ["twine (>=3.4.1)"] name = "pyrsistent" version = "0.19.3" description = "Persistent/Functional/Immutable data structures" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1300,7 +1248,6 @@ files = [ name = "pysocks" version = "1.7.1" description = "A Python SOCKS client module. See https://github.com/Anorov/PySocks for more information." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -1313,7 +1260,6 @@ files = [ name = "pytest" version = "7.2.2" description = "pytest: simple powerful testing with Python" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1337,7 +1283,6 @@ testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2. name = "pytest-cov" version = "4.0.0" description = "Pytest plugin for measuring coverage." -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1356,7 +1301,6 @@ testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtuale name = "pywin32" version = "305" description = "Python for Window Extensions" -category = "dev" optional = false python-versions = "*" files = [ @@ -1380,7 +1324,6 @@ files = [ name = "pyyaml" version = "6.0" description = "YAML parser and emitter for Python" -category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -1430,7 +1373,6 @@ files = [ name = "requests" version = "2.28.2" description = "Python HTTP for Humans." -category = "dev" optional = false python-versions = ">=3.7, <4" files = [ @@ -1453,7 +1395,6 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "send2trash" version = "1.8.0" description = "Send file to trash natively under Mac OS X, Windows and Linux." -category = "dev" optional = false python-versions = "*" files = [ @@ -1470,7 +1411,6 @@ win32 = ["pywin32"] name = "setuptools" version = "67.6.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1487,7 +1427,6 @@ testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs ( name = "six" version = "1.16.0" description = "Python 2 and 3 compatibility utilities" -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" files = [ @@ -1499,7 +1438,6 @@ files = [ name = "soupsieve" version = "2.4" description = "A modern CSS selector implementation for Beautiful Soup." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1511,7 +1449,6 @@ files = [ name = "tomli" version = "2.0.1" description = "A lil' TOML parser" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1523,7 +1460,6 @@ files = [ name = "urllib3" version = "1.26.15" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" files = [ @@ -1540,7 +1476,6 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] name = "virtualenv" version = "20.21.0" description = "Virtual Python Environment builder" -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1561,7 +1496,6 @@ test = ["covdefaults (>=2.2.2)", "coverage (>=7.1)", "coverage-enable-subprocess name = "waitress" version = "2.1.2" description = "Waitress WSGI server" -category = "dev" optional = false python-versions = ">=3.7.0" files = [ @@ -1577,7 +1511,6 @@ testing = ["coverage (>=5.0)", "pytest", "pytest-cover"] name = "websockets" version = "10.4" description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" -category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1656,7 +1589,6 @@ files = [ name = "webvtt-py" version = "0.4.6" description = "WebVTT reader, writer and segmenter" -category = "main" optional = false python-versions = ">=3.4" files = [ @@ -1670,7 +1602,6 @@ docopt = "*" name = "werkzeug" version = "2.2.3" description = "The comprehensive WSGI web application library." -category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1688,7 +1619,6 @@ watchdog = ["watchdog"] name = "winrt" version = "1.0.21033.1" description = "Access Windows Runtime APIs from Python" -category = "dev" optional = false python-versions = "*" files = [ @@ -1702,13 +1632,13 @@ files = [ [[package]] name = "yt-dlp" -version = "2023.3.4" +version = "2023.7.6" description = "A youtube-dl fork with additional features and patches" -category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "master.tar.gz", hash = "sha256:50652b35c47ecead723d7f73485ffae90e369352826b8315707e6f4b9c1ec46c"}, + {file = "yt-dlp-2023.7.6.tar.gz", hash = "sha256:cb58373869c8ccb5034746f91cfccd6d25ea697090dfd6f93e9034d51eb4aed2"}, + {file = "yt_dlp-2023.7.6-py2.py3-none-any.whl", hash = "sha256:b33b3f68751f33dd8290f1f61f7a011679b3b512aa223df3bff496688bc0bd19"}, ] [package.dependencies] @@ -1719,10 +1649,7 @@ mutagen = "*" pycryptodomex = "*" websockets = "*" -[package.source] -type = "url" -url = "https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz" [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "a4937947785f109bf71afdcea8e91f48708ea450927755c57a211aa575549ac7" +content-hash = "a54d7f6da4fd86793939ec2cc211224c2d1ed448f95d713d5fffe1bddca9f327" diff --git a/pyproject.toml b/pyproject.toml index 976624f..5f5eb30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.10" webvtt-py = "^0.4.6" -yt-dlp = {url = "https://github.com/yt-dlp/yt-dlp/archive/master.tar.gz"} +yt-dlp = "^2023.7.6" [tool.poetry.group.dev.dependencies] aqt = {extras = ["qt5"], version = "==2.1.54"} diff --git a/ytanki/ffmpeg.py b/ytanki/ffmpeg.py index 3f82132..4f222f9 100644 --- a/ytanki/ffmpeg.py +++ b/ytanki/ffmpeg.py @@ -37,7 +37,13 @@ def get_picture(self, dimensions): + self.picture_path + '"' ) - subprocess.run(picture_command, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT, shell=True, creationflags=subprocess.CREATE_NO_WINDOW) + subprocess.run( + picture_command, + stdout=subprocess.DEVNULL, + stderr=subprocess.STDOUT, + shell=True, + creationflags=subprocess.CREATE_NO_WINDOW, # type: ignore + ) def get_audio(self): audio_command = ( @@ -56,7 +62,13 @@ def get_audio(self): + self.audio_path + '"' ) - subprocess.run(audio_command, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT, shell=True, creationflags=subprocess.CREATE_NO_WINDOW) + subprocess.run( + audio_command, + stdout=subprocess.DEVNULL, + stderr=subprocess.STDOUT, + shell=True, + creationflags=subprocess.CREATE_NO_WINDOW, # type: ignore + ) # mutates object, bad practice? def fill_sub_media(self): diff --git a/ytanki/worker.py b/ytanki/worker.py index 97a3a4a..7d599fe 100644 --- a/ytanki/worker.py +++ b/ytanki/worker.py @@ -44,7 +44,7 @@ def __init__(self, window_title, progress_label): self.show() def closeEvent(self, event): - if hasattr(self, 'gen_thread') and self.gen_thread.isRunning(): + if hasattr(self, "gen_thread") and self.gen_thread.isRunning(): # Stop the thread self.gen_thread.stop() # Wait until it actually finishes @@ -52,6 +52,7 @@ def closeEvent(self, event): time.sleep(0.1) event.accept() + class DownloadYouTubeVideoBar(ProgressBarDialog): def __init__(self): super().__init__("Downloading...", "Downloading video and subtitles...") @@ -228,6 +229,7 @@ def run(self): self.finished.emit(True) self.finish_time.emit(finished_time, self.generated_cards_count) + def create_deck(task: GenerateVideoTask): dl_bar = DownloadYouTubeVideoBar() dl_bar.setup_ui(task=task)