sni-cli 1.2.4__tar.gz → 1.2.6__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 (45) hide show
  1. {sni_cli-1.2.4 → sni_cli-1.2.6}/PKG-INFO +1 -1
  2. {sni_cli-1.2.4 → sni_cli-1.2.6}/pyproject.toml +1 -1
  3. sni_cli-1.2.6/sni/__init__.py +1 -0
  4. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/providers/allanime.py +29 -2
  5. {sni_cli-1.2.4 → sni_cli-1.2.6}/worker/README.md +20 -7
  6. sni_cli-1.2.4/sni/__init__.py +0 -1
  7. {sni_cli-1.2.4 → sni_cli-1.2.6}/.gitignore +0 -0
  8. {sni_cli-1.2.4 → sni_cli-1.2.6}/LICENSE +0 -0
  9. {sni_cli-1.2.4 → sni_cli-1.2.6}/README.md +0 -0
  10. {sni_cli-1.2.4 → sni_cli-1.2.6}/install.ps1 +0 -0
  11. {sni_cli-1.2.4 → sni_cli-1.2.6}/install.sh +0 -0
  12. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/__main__.py +0 -0
  13. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/cli.py +0 -0
  14. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/config.py +0 -0
  15. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/exceptions.py +0 -0
  16. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/logger.py +0 -0
  17. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/player.py +0 -0
  18. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/providers/__init__.py +0 -0
  19. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/providers/base.py +0 -0
  20. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/providers/cache.py +0 -0
  21. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/providers/extractors/__init__.py +0 -0
  22. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/providers/extractors/megacloud.py +0 -0
  23. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/providers/extractors/vixcloud.py +0 -0
  24. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/providers/registry.py +0 -0
  25. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/__init__.py +0 -0
  26. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/app.py +0 -0
  27. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/bridge.py +0 -0
  28. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/screens/__init__.py +0 -0
  29. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/screens/help.py +0 -0
  30. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/screens/history.py +0 -0
  31. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/screens/home.py +0 -0
  32. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/screens/player.py +0 -0
  33. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/widgets/__init__.py +0 -0
  34. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/widgets/ascii_art.py +0 -0
  35. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/tui/widgets/info_box.py +0 -0
  36. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/ui.py +0 -0
  37. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/watch_history.py +0 -0
  38. {sni_cli-1.2.4 → sni_cli-1.2.6}/sni/wizard.py +0 -0
  39. {sni_cli-1.2.4 → sni_cli-1.2.6}/tests/__init__.py +0 -0
  40. {sni_cli-1.2.4 → sni_cli-1.2.6}/tests/conftest.py +0 -0
  41. {sni_cli-1.2.4 → sni_cli-1.2.6}/tests/test_allanime_captcha.py +0 -0
  42. {sni_cli-1.2.4 → sni_cli-1.2.6}/tests/test_cache.py +0 -0
  43. {sni_cli-1.2.4 → sni_cli-1.2.6}/tests/test_config.py +0 -0
  44. {sni_cli-1.2.4 → sni_cli-1.2.6}/tests/test_exceptions.py +0 -0
  45. {sni_cli-1.2.4 → sni_cli-1.2.6}/tests/test_providers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sni-cli
3
- Version: 1.2.4
3
+ Version: 1.2.6
4
4
  Summary: Stream Ninja Interface — terminal-based anime streaming CLI + TUI
5
5
  Project-URL: Homepage, https://github.com/sundeepyt2/SNI
6
6
  Project-URL: Source, https://github.com/sundeepyt2/SNI
@@ -9,7 +9,7 @@ build-backend = "hatchling.build"
9
9
  # just `sni` (defined below in [project.scripts]), so users run `sni play`,
10
10
  # `sni tui`, etc. — only `pip install sni-cli` differs from the bare name.
11
11
  name = "sni-cli"
12
- version = "1.2.4"
12
+ version = "1.2.6"
13
13
  description = "Stream Ninja Interface — terminal-based anime streaming CLI + TUI"
14
14
  readme = "README.md"
15
15
  requires-python = ">=3.10"
@@ -0,0 +1 @@
1
+ __version__ = "1.2.6"
@@ -220,6 +220,10 @@ class AllAnimeProvider(Provider):
220
220
  # calls instead of trying the dead primary every time.
221
221
  # None = direct (no proxy), 0 = first public proxy, etc.
222
222
  self._working_proxy_idx: Optional[int] = None
223
+ # If the CF Worker returns 5xx (account suspended/deleted), we mark it
224
+ # disabled for the rest of the session so we don't keep hitting a dead
225
+ # URL and getting 503 errors on every request.
226
+ self._worker_disabled: bool = False
223
227
 
224
228
  def _base_headers(self, *, json_body: bool = False) -> Dict[str, str]:
225
229
  h = {
@@ -255,7 +259,7 @@ class AllAnimeProvider(Provider):
255
259
  fallbacks: List[tuple] = [("direct", self.GRAPHQL_URL)]
256
260
  for i in range(len(self.PUBLIC_PROXIES)):
257
261
  fallbacks.append(("proxy", self._proxy_url(i, self.GRAPHQL_URL)))
258
- if self.cf_worker_url:
262
+ if self.cf_worker_url and not self._worker_disabled:
259
263
  # CF Worker v3 supports POST — body is forwarded as-is
260
264
  fallbacks.append(("worker", _build_cf_worker_url(
261
265
  self.cf_worker_url, self.GRAPHQL_URL,
@@ -283,6 +287,18 @@ class AllAnimeProvider(Provider):
283
287
  last_error = e
284
288
  continue
285
289
 
290
+ # If the CF Worker returns 5xx, the worker is dead/suspended.
291
+ # Disable it for the rest of the session so we don't keep
292
+ # hitting a dead URL on every subsequent request.
293
+ if kind == "worker" and resp.status_code >= 500:
294
+ self._worker_disabled = True
295
+ last_error = ProviderError(
296
+ f"Worker returned HTTP {resp.status_code} (worker may be "
297
+ f"suspended or down). Worker disabled for this session. "
298
+ f"Clear it with: sni config --update allanime_cf_worker_url=''"
299
+ )
300
+ continue
301
+
286
302
  if _is_captcha_response(resp):
287
303
  last_error = CaptchaRequiredError(
288
304
  f"AllAnime {kind} request returned HTTP {resp.status_code}",
@@ -336,7 +352,7 @@ class AllAnimeProvider(Provider):
336
352
  fallbacks: List[tuple] = [("direct", direct_url)]
337
353
  for i in range(len(self.PUBLIC_PROXIES)):
338
354
  fallbacks.append(("proxy", self._proxy_url(i, direct_url)))
339
- if self.cf_worker_url:
355
+ if self.cf_worker_url and not self._worker_disabled:
340
356
  fallbacks.append(("worker", _build_cf_worker_url(
341
357
  self.cf_worker_url, direct_url,
342
358
  extra_headers={"Referer": self.REFERER, "Origin": self.ORIGIN},
@@ -362,6 +378,17 @@ class AllAnimeProvider(Provider):
362
378
  last_error = e
363
379
  continue
364
380
 
381
+ # If the CF Worker returns 5xx, the worker is dead/suspended.
382
+ # Disable it for the rest of the session.
383
+ if kind == "worker" and resp.status_code >= 500:
384
+ self._worker_disabled = True
385
+ last_error = ProviderError(
386
+ f"Worker returned HTTP {resp.status_code} (worker may be "
387
+ f"suspended or down). Worker disabled for this session. "
388
+ f"Clear it with: sni config --update allanime_cf_worker_url=''"
389
+ )
390
+ continue
391
+
365
392
  if _is_captcha_response(resp):
366
393
  last_error = CaptchaRequiredError(
367
394
  f"AllAnime {kind} request returned HTTP {resp.status_code}",
@@ -28,20 +28,33 @@ Pick **one**. All three run the same JavaScript code (slightly different entry-p
28
28
 
29
29
  ## Option 1: Deno Deploy (recommended — most reliable)
30
30
 
31
+ **Easiest method — Playground (no GitHub repo needed):**
32
+
31
33
  1. Go to https://dash.deno.com → Sign in with GitHub
32
34
  2. Click **"New Project"**
33
- 3. Click **"Playground"** (top-right, lets you paste code directly no GitHub repo needed)
34
- 4. Delete the default code, paste the entire contents of [`proxy.deno.js`](./proxy.deno.js) from this directory
35
- 5. Click **"Save & Deploy"**
36
- 6. You'll get a URL like `https://your-project.deno.dev` — copy it
37
- 7. Test it in your browser: visit `https://your-project.deno.dev/`you should see `{"ok":true,"service":"sni-stream-proxy",...}`
38
- 8. Save it to SNI:
35
+ 3. Click **"Playground"** (top-right corner IMPORTANT: don't pick "Import from GitHub" or you'll hit the `/tmp/build/src/main.ts` not found error)
36
+ 4. Delete the default code in the editor
37
+ 5. Paste the entire contents of [`main.ts`](./main.ts) from this directory
38
+ 6. Click **"Save & Deploy"**
39
+ 7. You'll get a URL like `https://your-project.deno.dev`copy it
40
+ 8. Test it in your browser: visit `https://your-project.deno.dev/` — you should see `{"ok":true,"service":"sni-stream-proxy",...}`
41
+ 9. Save it to SNI:
39
42
 
40
43
  ```bash
41
44
  sni config --update allanime_cf_worker_url='https://your-project.deno.dev'
42
45
  ```
43
46
 
44
- 9. Try SNI: `sni play "one piece"`
47
+ 10. Try SNI: `sni play "one piece"`
48
+
49
+ **Alternative method — GitHub repo (if Playground doesn't work for you):**
50
+
51
+ 1. Fork the SNI repo on GitHub
52
+ 2. Go to https://dash.deno.com → "New Project" → pick your fork
53
+ 3. Deno Deploy auto-detects `main.ts` (or `deno.json`'s `entrypoint` field) as the entrypoint
54
+ 4. Click "Link" → "Deploy"
55
+ 5. Copy the URL, save to SNI as above
56
+
57
+ **If you see "Entrypoint at '/tmp/build/src/main.ts' not found":** This means you picked "New Project" but Deno Deploy can't find the entrypoint. Fix by either using the Playground (above) or pushing `main.ts` to the root of your GitHub repo (not inside `src/`).
45
58
 
46
59
  ---
47
60
 
@@ -1 +0,0 @@
1
- __version__ = "1.2.4"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes