1.0.2 • Published 11 months ago

bottomdl v1.0.2

Weekly downloads
-
License
AGPL
Repository
-
Last release
11 months ago

BottomDL

A modular downloading tool. Includes code for a small collection of streaming services (does not come with accounts or tokens).

BottomDL is made to use few NodeJS dependencies and no system dependencies (...besides ffmpeg)

Usage

import Bottom from 'bottomdl'
import Tidal from 'bottomdl/streamers/tidal/main.js'
import Qobuz from 'bottomdl/streamers/qobuz/main.js'

const bottom = new Bottom({
	modules: {
		tidal: new Tidal({
			// tokens
		}),
		qobuz: new Qobuz({
			// tokens
		})
		// Any other modules
	},
	logins: {
		qobuz: {
			username: '',
			password: ''
		}
	}
})

const track = await bottom.getByUrl('https://tidal.com/browse/track/255207223')

await fs.promises.writeFile('test.flac', (await track.getStream()).stream)

For using a specific module, you can just use the functions built into the Streamer interface.

Project Structure

src/streamers/{app-name}

main.ts

Default export is a class which implements the Streamer interface:

interface Streamer {
	hostnames: string[]
	search(query: string, limit: number): Promise<SearchResults>
	getByUrl(url: string): Promise<GetByUrlResponse>
}

They can optionally include a login function in this class which takes a username and password (if supported):

async login(username: string, password: string): void

Options for the app, including tokens (if supported by the given app), are passed to the class's constructor:

new StreamerApp({ token: 'secret!' })

The classes can also include their own custom functions. Any function used by BottomDL's app-agnostic code should be defined in the Streamer interface for compatibility across multiple apps.

parse.ts

Functions for parsing the app's API into the types defined in src/types.ts.

constants.ts

Constants used by main.ts. Secrets should not be defined here (or anywhere else in the project).

src/index.ts

Wraps all the Streamers using a module system. See the usage section.

src/types.ts

Types used across the project. The purpose of many of these is to make sure all apps' functions return the same types so the rest of the logic can work across all apps the same.

Acknowledgements

BottomDL is partially inspired by OrpheusDL, a Python program for music archival which can be used similarly to BottomDL. Some scripts inside BottomDL are modeled after OrpheusDL modules.

License

Copyright Mollie Xx and Bunt4021. Licensed under AGPLv3.

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago