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"},
13 description = "A feature-rich command-line audio/video downloader"
15 requires-python = ">=3.8"
24 license = {file = "LICENSE"}
26 "Topic :: Multimedia :: Video",
27 "Development Status :: 5 - Production/Stable",
28 "Environment :: Console",
29 "Programming Language :: Python",
30 "Programming Language :: Python :: 3 :: Only",
31 "Programming Language :: Python :: 3.8",
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 :: Implementation",
37 "Programming Language :: Python :: Implementation :: CPython",
38 "Programming Language :: Python :: Implementation :: PyPy",
39 "License :: OSI Approved :: The Unlicense (Unlicense)",
40 "Operating System :: OS Independent",
44 "brotli; implementation_name=='cpython'",
45 "brotlicffi; implementation_name!='cpython'",
49 "requests>=2.32.2,<3",
50 "urllib3>=1.26.17,<3",
54 [project.optional-dependencies]
57 "curl-cffi>=0.5.10,!=0.6.*,<0.8; implementation_name=='cpython'",
72 "yt-dlp[static-analysis]",
83 "pyinstaller>=6.7.0", # for compat with setuptools>=70
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-rerunfailures~=14.0",
164 "pytest-xdist[psutil]~=3.5",
167 [tool.hatch.envs.hatch-test.scripts]
168 run = "python -m devscripts.run_tests {args}"
169 run-cov = "echo Code coverage not implemented && exit 1"
171 [[tool.hatch.envs.hatch-test.matrix]]
188 "E402", # module-import-not-at-top-of-file
189 "E501", # line-too-long
190 "E731", # lambda-assignment
191 "E741", # ambiguous-variable-name
192 "UP036", # outdated-version-block
193 "B006", # mutable-argument-default
194 "B008", # function-call-in-default-argument
195 "B011", # assert-false
196 "B017", # assert-raises-exception
197 "B023", # function-uses-loop-variable (false positives)
198 "B028", # no-explicit-stacklevel
199 "B904", # raise-without-from-inside-except
200 "C401", # unnecessary-generator-set
201 "C402", # unnecessary-generator-dict
202 "PIE790", # unnecessary-placeholder
203 "SIM102", # collapsible-if
204 "SIM108", # if-else-block-instead-of-if-exp
205 "SIM112", # uncapitalized-environment-variables
206 "SIM113", # enumerate-for-loop
207 "SIM114", # if-with-same-arms
208 "SIM115", # open-file-with-context-handler
209 "SIM117", # multiple-with-statements
210 "SIM223", # expr-and-false
211 "SIM300", # yoda-conditions
212 "TD001", # invalid-todo-tag
213 "TD002", # missing-todo-author
214 "TD003", # missing-todo-link
215 "PLE0604", # invalid-all-object (false positives)
216 "PLE0643", # potential-index-error (false positives)
217 "PLW0603", # global-statement
218 "PLW1510", # subprocess-run-without-check
219 "PLW2901", # redefined-loop-name
220 "RUF001", # ambiguous-unicode-character-string
221 "RUF012", # mutable-class-default
222 "RUF100", # unused-noqa (flake8 has slightly different behavior)
225 "E", # pycodestyle Error
226 "W", # pycodestyle Warning
230 "N803", # invalid-argument-name
231 "N804", # invalid-first-argument-name-for-class-method
233 "B", # flake8-bugbear
234 "A", # flake8-builtins
235 "COM", # flake8-commas
236 "C4", # flake8-comprehensions
237 "FA", # flake8-future-annotations
238 "ISC", # flake8-implicit-str-concat
239 "ICN003", # banned-import-from
241 "T20", # flake8-print
242 "RSE", # flake8-raise
243 "RET504", # unnecessary-assign
244 "SIM", # flake8-simplify
245 "TID251", # banned-api
247 "PLC", # Pylint Convention
248 "PLE", # Pylint Error
249 "PLW", # Pylint Warning
250 "RUF", # Ruff-specific rules
253 [tool.ruff.lint.per-file-ignores]
254 "devscripts/lazy_load_template.py" = [
255 "F401", # unused-import
257 "!yt_dlp/extractor/**.py" = [
259 "ICN003", # banned-import-from
260 "T20", # flake8-print
261 "A002", # builtin-argument-shadowing
262 "C408", # unnecessary-collection-call
264 "yt_dlp/jsinterp.py" = [
265 "UP031", # printf-string-formatting
268 [tool.ruff.lint.isort]
269 known-first-party = [
274 relative-imports-order = "closest-to-furthest"
276 [tool.ruff.lint.flake8-quotes]
277 docstring-quotes = "double"
278 multiline-quotes = "single"
279 inline-quotes = "single"
282 [tool.ruff.lint.pep8-naming]
283 classmethod-decorators = [
284 "yt_dlp.utils.classproperty",
287 [tool.ruff.lint.flake8-import-conventions]
309 [tool.ruff.lint.flake8-tidy-imports.banned-api]
310 "yt_dlp.compat.compat_str".msg = "Use `str` instead."
311 "yt_dlp.compat.compat_b64decode".msg = "Use `base64.b64decode` instead."
312 "yt_dlp.compat.compat_urlparse".msg = "Use `urllib.parse` instead."
313 "yt_dlp.compat.compat_parse_qs".msg = "Use `urllib.parse.parse_qs` instead."
314 "yt_dlp.compat.compat_urllib_parse_unquote".msg = "Use `urllib.parse.unquote` instead."
315 "yt_dlp.compat.compat_urllib_parse_urlencode".msg = "Use `urllib.parse.urlencode` instead."
316 "yt_dlp.compat.compat_urllib_parse_urlparse".msg = "Use `urllib.parse.urlparse` instead."
317 "yt_dlp.compat.compat_shlex_quote".msg = "Use `yt_dlp.utils.shell_quote` instead."
318 "yt_dlp.utils.error_to_compat_str".msg = "Use `str` instead."
321 max_line_length = 120
382 [tool.pytest.ini_options]
383 addopts = "-ra -v --strict-markers"