2 requires = ["hatchling"]
3 build-backend = "hatchling.build"
8 {name = "pukkandan", email = "pukkandan.ytdlp@gmail.com"},
9 {name = "Grub4K", email = "contact@grub4k.xyz"},
10 {name = "bashonly", email = "bashonly@protonmail.com"},
11 {name = "coletdjnz", email = "coletdjnz@protonmail.com"},
12 {name = "sepro", email = "sepro@sepr0.com"},
14 description = "A feature-rich command-line audio/video downloader"
16 requires-python = ">=3.9"
25 license = {file = "LICENSE"}
27 "Topic :: Multimedia :: Video",
28 "Development Status :: 5 - Production/Stable",
29 "Environment :: Console",
30 "Programming Language :: Python",
31 "Programming Language :: Python :: 3 :: Only",
32 "Programming Language :: Python :: 3.9",
33 "Programming Language :: Python :: 3.10",
34 "Programming Language :: Python :: 3.11",
35 "Programming Language :: Python :: 3.12",
36 "Programming Language :: Python :: 3.13",
37 "Programming Language :: Python :: Implementation",
38 "Programming Language :: Python :: Implementation :: CPython",
39 "Programming Language :: Python :: Implementation :: PyPy",
40 "License :: OSI Approved :: The Unlicense (Unlicense)",
41 "Operating System :: OS Independent",
46 [project.optional-dependencies]
48 "brotli; implementation_name=='cpython'",
49 "brotlicffi; implementation_name!='cpython'",
53 "requests>=2.32.2,<3",
54 "urllib3>=1.26.17,<3",
58 "curl-cffi==0.5.10; os_name=='nt' and implementation_name=='cpython'",
59 "curl-cffi>=0.5.10,!=0.6.*,<0.7.2; os_name!='nt' and implementation_name=='cpython'",
69 "setuptools>=71.0.2", # 71.0.0 broke pyinstaller
74 "yt-dlp[static-analysis]",
83 "pytest-rerunfailures~=14.0",
86 "pyinstaller>=6.10.0", # Windows temp cleanup fixed in 6.10.0
90 Documentation = "https://github.com/yt-dlp/yt-dlp#readme"
91 Repository = "https://github.com/yt-dlp/yt-dlp"
92 Tracker = "https://github.com/yt-dlp/yt-dlp/issues"
93 Funding = "https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators"
96 yt-dlp = "yt_dlp:main"
98 [project.entry-points.pyinstaller40]
99 hook-dirs = "yt_dlp.__pyinstaller:get_hook_dirs"
101 [tool.hatch.build.targets.sdist]
106 "/.gitignore", # included by default, needed for auto-excludes
108 "/LICENSE", # included as license
109 "/pyproject.toml", # included by default
110 "/README.md", # included as readme
112 "/supportedsites.md",
115 "/yt_dlp/extractor/lazy_extractors.py",
117 "/AUTHORS", # included by default
122 [tool.hatch.build.targets.wheel]
123 packages = ["yt_dlp"]
124 artifacts = ["/yt_dlp/extractor/lazy_extractors.py"]
126 [tool.hatch.build.targets.wheel.shared-data]
127 "completions/bash/yt-dlp" = "share/bash-completion/completions/yt-dlp"
128 "completions/zsh/_yt-dlp" = "share/zsh/site-functions/_yt-dlp"
129 "completions/fish/yt-dlp.fish" = "share/fish/vendor_completions.d/yt-dlp.fish"
130 "README.txt" = "share/doc/yt_dlp/README.txt"
131 "yt-dlp.1" = "share/man/man1/yt-dlp.1"
134 path = "yt_dlp/version.py"
135 pattern = "_pkg_version = '(?P<version>[^']+)'"
137 [tool.hatch.envs.default]
138 features = ["curl-cffi", "default"]
139 dependencies = ["pre-commit"]
143 [tool.hatch.envs.default.scripts]
144 setup = "pre-commit install --config .pre-commit-hatch.yaml"
145 yt-dlp = "python -Werror -Xdev -m yt_dlp {args}"
147 [tool.hatch.envs.hatch-static-analysis]
149 features = ["static-analysis"]
150 dependencies = [] # override hatch ruff version
151 config-path = "pyproject.toml"
153 [tool.hatch.envs.hatch-static-analysis.scripts]
154 format-check = "autopep8 --diff {args:.}"
155 format-fix = "autopep8 --in-place {args:.}"
156 lint-check = "ruff check {args:.}"
157 lint-fix = "ruff check --fix {args:.}"
159 [tool.hatch.envs.hatch-test]
162 "pytest-randomly~=3.15",
163 "pytest-xdist[psutil]~=3.5",
166 [tool.hatch.envs.hatch-test.scripts]
167 run = "python -m devscripts.run_tests {args}"
168 run-cov = "echo Code coverage not implemented && exit 1"
170 [[tool.hatch.envs.hatch-test.matrix]]
185 "E402", # module-import-not-at-top-of-file
186 "E501", # line-too-long
187 "E731", # lambda-assignment
188 "E741", # ambiguous-variable-name
189 "UP036", # outdated-version-block
190 "B006", # mutable-argument-default
191 "B008", # function-call-in-default-argument
192 "B011", # assert-false
193 "B017", # assert-raises-exception
194 "B023", # function-uses-loop-variable (false positives)
195 "B028", # no-explicit-stacklevel
196 "B904", # raise-without-from-inside-except
197 "C401", # unnecessary-generator-set
198 "C402", # unnecessary-generator-dict
199 "PIE790", # unnecessary-placeholder
200 "SIM102", # collapsible-if
201 "SIM108", # if-else-block-instead-of-if-exp
202 "SIM112", # uncapitalized-environment-variables
203 "SIM113", # enumerate-for-loop
204 "SIM114", # if-with-same-arms
205 "SIM115", # open-file-with-context-handler
206 "SIM117", # multiple-with-statements
207 "SIM223", # expr-and-false
208 "SIM300", # yoda-conditions
209 "TD001", # invalid-todo-tag
210 "TD002", # missing-todo-author
211 "TD003", # missing-todo-link
212 "PLE0604", # invalid-all-object (false positives)
213 "PLE0643", # potential-index-error (false positives)
214 "PLW0603", # global-statement
215 "PLW1510", # subprocess-run-without-check
216 "PLW2901", # redefined-loop-name
217 "RUF001", # ambiguous-unicode-character-string
218 "RUF012", # mutable-class-default
219 "RUF100", # unused-noqa (flake8 has slightly different behavior)
222 "E", # pycodestyle Error
223 "W", # pycodestyle Warning
227 "N803", # invalid-argument-name
228 "N804", # invalid-first-argument-name-for-class-method
230 "B", # flake8-bugbear
231 "A", # flake8-builtins
232 "COM", # flake8-commas
233 "C4", # flake8-comprehensions
234 "FA", # flake8-future-annotations
235 "ISC", # flake8-implicit-str-concat
236 "ICN003", # banned-import-from
238 "T20", # flake8-print
239 "RSE", # flake8-raise
240 "RET504", # unnecessary-assign
241 "SIM", # flake8-simplify
242 "TID251", # banned-api
244 "PLC", # Pylint Convention
245 "PLE", # Pylint Error
246 "PLW", # Pylint Warning
247 "RUF", # Ruff-specific rules
250 [tool.ruff.lint.per-file-ignores]
251 "devscripts/lazy_load_template.py" = [
252 "F401", # unused-import
254 "!yt_dlp/extractor/**.py" = [
256 "ICN003", # banned-import-from
257 "T20", # flake8-print
258 "A002", # builtin-argument-shadowing
259 "C408", # unnecessary-collection-call
261 "yt_dlp/jsinterp.py" = [
262 "UP031", # printf-string-formatting
265 [tool.ruff.lint.isort]
266 known-first-party = [
271 relative-imports-order = "closest-to-furthest"
273 [tool.ruff.lint.flake8-quotes]
274 docstring-quotes = "double"
275 multiline-quotes = "single"
276 inline-quotes = "single"
279 [tool.ruff.lint.pep8-naming]
280 classmethod-decorators = [
281 "yt_dlp.utils.classproperty",
284 [tool.ruff.lint.flake8-import-conventions]
306 [tool.ruff.lint.flake8-tidy-imports.banned-api]
307 "yt_dlp.compat.compat_str".msg = "Use `str` instead."
308 "yt_dlp.compat.compat_b64decode".msg = "Use `base64.b64decode` instead."
309 "yt_dlp.compat.compat_urlparse".msg = "Use `urllib.parse` instead."
310 "yt_dlp.compat.compat_parse_qs".msg = "Use `urllib.parse.parse_qs` instead."
311 "yt_dlp.compat.compat_urllib_parse_unquote".msg = "Use `urllib.parse.unquote` instead."
312 "yt_dlp.compat.compat_urllib_parse_urlencode".msg = "Use `urllib.parse.urlencode` instead."
313 "yt_dlp.compat.compat_urllib_parse_urlparse".msg = "Use `urllib.parse.urlparse` instead."
314 "yt_dlp.compat.compat_shlex_quote".msg = "Use `yt_dlp.utils.shell_quote` instead."
315 "yt_dlp.utils.error_to_compat_str".msg = "Use `str` instead."
318 max_line_length = 120
379 [tool.pytest.ini_options]
380 addopts = "-ra -v --strict-markers"