mirror of
https://codeberg.org/lucida/lucida.git
synced 2026-11-13 23:27:24 -05:00
drop node-fetch dependency, use undici
undici's fetch implementation is included in node and has been considered stable since version 21. for some time I think depending on the undici package instead of the built-in is a good idea so that older nodejs versions will still work correctly.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import fetch from 'node-fetch'
|
||||
import { fetch } from 'undici'
|
||||
import { spawn } from 'child_process'
|
||||
import {
|
||||
ItemType,
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
parseMpd,
|
||||
parseTrack
|
||||
} from './parse.js'
|
||||
import Stream from 'stream'
|
||||
import Stream, { Readable } from 'stream'
|
||||
|
||||
interface TidalOptions {
|
||||
tvToken: string
|
||||
@@ -354,7 +354,7 @@ export default class Tidal implements Streamer {
|
||||
return {
|
||||
mimeType: manifest.mimeType,
|
||||
sizeBytes: parseInt(<string>streamResponse.headers.get('Content-Length')),
|
||||
stream: <NodeJS.ReadableStream>streamResponse.body
|
||||
stream: Readable.fromWeb(streamResponse.body!)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user