nixamp 0.9.4 → 0.9.5

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.
@@ -24,10 +24,22 @@ export interface CatalogInfo {
24
24
  /** What went wrong the last time it was read, or "". */
25
25
  error: string;
26
26
  }
27
- /** A list bigger than this is not a playlist, it is a mistake. */
27
+ /**
28
+ * A list bigger than this is not a playlist, it is a mistake.
29
+ *
30
+ * Twenty megabytes was the first guess and a real provider's full list --
31
+ * every channel, every film, every series episode -- blew through it on the
32
+ * first try. Those run to tens of megabytes and six figures of entries, and
33
+ * a server with a disk can hold that; what this guards against is a URL that
34
+ * turns out to be a film rather than a list of them.
35
+ */
28
36
  export declare const MAX_LIST_BYTES: number;
29
- /** How long to wait for a provider before giving up on the list. */
30
- export declare const FETCH_TIMEOUT_MS = 30000;
37
+ /**
38
+ * How long to wait for a provider before giving up on the list. A full list
39
+ * is generated on the provider's side per request, and a slow panel takes a
40
+ * minute to write a hundred thousand lines.
41
+ */
42
+ export declare const FETCH_TIMEOUT_MS = 180000;
31
43
  /**
32
44
  * Live, or on demand?
33
45
  *
@@ -36,6 +48,16 @@ export declare const FETCH_TIMEOUT_MS = 30000;
36
48
  * /live/ for a channel; and a bare stream key, an .m3u8 or an .ts is a channel.
37
49
  */
38
50
  export declare function isLiveEntry(source: string, duration: number): boolean;
51
+ /**
52
+ * The richer form of an Xtream panel's list, when a plain one was given.
53
+ *
54
+ * A panel serves the same list two ways: `/m3u`, which is title and address
55
+ * and nothing else, and `/m3u_plus`, which carries the group and the logo.
56
+ * A person copies whichever their app printed, and a list of four hundred
57
+ * thousand entries with no groups is not browsable. So the richer form is
58
+ * asked for first, and the given one is what it falls back to.
59
+ */
60
+ export declare function preferPlus(source: string): string;
39
61
  export declare function entryId(source: string): string;
40
62
  /**
41
63
  * Parse an extended m3u: `#EXTINF:-1 tvg-name="CNN" group-title="News",CNN HD`
@@ -50,7 +72,7 @@ export interface Group {
50
72
  vod: number;
51
73
  }
52
74
  /** Read a list, from disk or over the network, within reason. */
53
- export declare function readCatalog(source: string, send?: typeof fetch): Promise<string>;
75
+ export declare function readCatalog(source: string, send?: typeof fetch, maxBytes?: number): Promise<string>;
54
76
  /**
55
77
  * The catalogs on one server, and their entries.
56
78
  *
package/dist/catalogs.js CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nixamp",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "It really whips the terminal's ass. A Winamp-shaped audio player for your terminal.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/catalogs.ts CHANGED
Binary file
package/web/dist/sw.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* nixamp service worker — generated, do not edit */
2
- const CACHE = "nixamp-1789037115599";
2
+ const CACHE = "nixamp-1789038657230";
3
3
  const PRECACHE = [
4
4
  "/",
5
5
  "/apple-touch-icon.png",