polytool 0.2.7__tar.gz → 0.2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {polytool-0.2.7 → polytool-0.2.8}/PKG-INFO +1 -1
  2. {polytool-0.2.7 → polytool-0.2.8}/pyproject.toml +1 -1
  3. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/__init__.py +1 -1
  4. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/dl.py +27 -5
  5. {polytool-0.2.7 → polytool-0.2.8}/.gitignore +0 -0
  6. {polytool-0.2.7 → polytool-0.2.8}/LICENSE +0 -0
  7. {polytool-0.2.7 → polytool-0.2.8}/README.md +0 -0
  8. {polytool-0.2.7 → polytool-0.2.8}/docs/README.md +0 -0
  9. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/__main__.py +0 -0
  10. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/__init__.py +0 -0
  11. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/clip.py +0 -0
  12. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/color.py +0 -0
  13. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/convert.py +0 -0
  14. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/cron.py +0 -0
  15. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/data.py +0 -0
  16. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/enc.py +0 -0
  17. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/file.py +0 -0
  18. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/gen.py +0 -0
  19. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/img.py +0 -0
  20. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/net.py +0 -0
  21. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/pdf.py +0 -0
  22. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/qr.py +0 -0
  23. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/shot.py +0 -0
  24. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/text.py +0 -0
  25. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/cli/vid.py +0 -0
  26. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/core/__init__.py +0 -0
  27. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/core/browsers.py +0 -0
  28. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/core/config.py +0 -0
  29. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/core/console.py +0 -0
  30. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/core/errors.py +0 -0
  31. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/core/ffmpeg.py +0 -0
  32. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/core/io.py +0 -0
  33. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/core/lazy.py +0 -0
  34. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/core/progress.py +0 -0
  35. {polytool-0.2.7 → polytool-0.2.8}/src/polytool/core/runtime.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polytool
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: One-binary CLI bundling 26 everyday utilities — image/video/PDF conversion, background removal, OCR, QR codes, hashing, downloads, and more
5
5
  Project-URL: Homepage, https://github.com/k6w/polytool
6
6
  Project-URL: Repository, https://github.com/k6w/polytool
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "polytool"
7
- version = "0.2.7"
7
+ version = "0.2.8"
8
8
  description = "One-binary CLI bundling 26 everyday utilities — image/video/PDF conversion, background removal, OCR, QR codes, hashing, downloads, and more"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.13"
@@ -1,4 +1,4 @@
1
1
  """polytool — one-binary CLI bundling 26 everyday utilities."""
2
2
 
3
- __version__ = "0.2.7"
3
+ __version__ = "0.2.8"
4
4
  __all__ = ["__version__"]
@@ -149,14 +149,36 @@ def _n_challenge_hint(messages: list[str]) -> str | None:
149
149
  text = " ".join(messages).lower()
150
150
  if not any(p in text for p in N_CHALLENGE_PATTERNS):
151
151
  return None
152
- return (
153
- "YouTube needs a JavaScript runtime to solve its n-challenge.\n\n"
154
- "Polytool can manage one for you (no system install needed):\n"
152
+
153
+ # When cookies are configured we know we're in a logged-in session — that's
154
+ # by far the most common cause of these errors (YouTube tightens access for
155
+ # accounts in their DRM A/B bucket). Try anonymous access first.
156
+ using_cookies = bool(
157
+ config.get("dl", "cookies_from_browser") or config.get("dl", "cookies_file")
158
+ )
159
+
160
+ fixes: list[str] = []
161
+ if using_cookies:
162
+ fixes.append(
163
+ "[bold]Most likely fix:[/bold] try without cookies. YouTube often gates "
164
+ "logged-in sessions into a DRM-only bucket.\n"
165
+ " [cyan]pt dl setup --clear[/cyan] [dim]# forget saved cookies (just for testing)[/dim]\n"
166
+ " [cyan]pt dl get URL[/cyan]\n"
167
+ "If that works, re-save cookies for sites that need them: "
168
+ "[cyan]pt dl setup --browser firefox[/cyan]"
169
+ )
170
+ fixes.append(
171
+ "If it still fails, make sure a JS runtime is on PATH. Polytool can manage one:\n"
155
172
  " [cyan]pt dl runtime install[/cyan] "
156
- "[dim]# downloads Deno (~50 MB) into ~/.polytool/runtime/[/dim]\n\n"
157
- "Then re-run [cyan]pt dl get[/cyan]. The runtime is auto-detected on every call."
173
+ "[dim]# downloads Deno (~50 MB) into ~/.polytool/runtime/[/dim]"
174
+ )
175
+ fixes.append(
176
+ "Some videos are flagged DRM in your specific YouTube session — those can't "
177
+ "be downloaded by any tool. Try a different video or account."
158
178
  )
159
179
 
180
+ return "\n\n".join(fixes)
181
+
160
182
 
161
183
  def _drm_hint(messages: list[str]) -> str | None:
162
184
  text = " ".join(messages).lower()
File without changes
File without changes
File without changes
File without changes