@boy-offi9-inc/tidepull 0.11.0 → 0.11.1

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.
@@ -22,9 +22,6 @@ export interface DownloadOpts {
22
22
  export declare function downloadHttp(url: string, dest: string, o: DownloadOpts & {
23
23
  resume: boolean;
24
24
  }): Promise<void>;
25
- export interface HlsOpts extends DownloadOpts {
26
- concurrency: number;
27
- }
28
25
  export interface SegmentRef {
29
26
  url: string;
30
27
  seq: number;
@@ -219,6 +219,8 @@ export async function downloadHls(url, dest, o) {
219
219
  return downloadSegments(segments, dest, o);
220
220
  }
221
221
  export async function downloadHlsLive(url, dest, o) {
222
+ if (o.from !== undefined || o.to !== undefined)
223
+ throw new TidepullError("Time-range clipping (--from/--to) only works on VOD playlists");
222
224
  const first = await o.http.text(url, { headers: o.headers, signal: o.signal });
223
225
  if (isMasterPlaylist(first.text))
224
226
  throw new TidepullError("Expected a media playlist, got a master playlist");
@@ -93,6 +93,10 @@ export async function downloadInfo(info, opts, ctx) {
93
93
  const limiter = opts.limitRate ? new RateLimiter(opts.limitRate) : undefined;
94
94
  const common = { http: ctx.http, headers: { ...f.http_headers, ...opts.headers }, signal: ctx.signal, limiter, onProgress };
95
95
  let ext = f.ext;
96
+ if (opts.from !== undefined || opts.to !== undefined) {
97
+ if (f.protocol !== "hls")
98
+ throw new TidepullError(`Time-range clipping (--from/--to) is only supported for HLS VOD downloads, not ${f.protocol}`);
99
+ }
96
100
  if (f.protocol === "hls")
97
101
  ({ ext } = await downloadHls(f.url, dest, { ...common, concurrency: opts.concurrency, live: opts.live, maxDuration: opts.maxDuration, maxSegments: opts.maxSegments, from: opts.from, to: opts.to }));
98
102
  else if (f.protocol === "dash")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boy-offi9-inc/tidepull",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "A minimal, from-scratch media downloader library: extractor plugins, yt-dlp-style format selection, resumable downloads.",
5
5
  "type": "module",
6
6
  "license": "MIT",