#!/usr/bin/env node import {EOL} from 'os'; import {readFileSync, writeFileSync} from 'fs'; import {dirname, join, resolve, sep} from 'path'; import {Command} from 'commander'; import gradient from 'gradient-string'; import {getUser, initDeezerApi, searchMusic, parseInfo} from 'd-fi-core'; import prompts from 'prompts'; import logUpdate from 'log-update'; import PQueue from 'p-queue'; import chalk from 'chalk'; import {trueCasePathSync} from 'true-case-path'; import signale from './lib/signale'; import downloadTrack from './lib/download-track'; import Config from './lib/config'; import updateCheck from './lib/update-check'; import autoUpdater from './lib/auto-updater'; import {commonPath, formatSecondsReadable, sanitizeFilename} from './lib/util'; import pkg from '../package.json'; import type {artistType, trackType, albumType, playlistInfoMinimal} from 'd-fi-core/dist/types'; // App info console.log( gradient('red', 'yellow', 'orange')(` ♥ d-fi - ${pkg.version} ♥ `) + '\n' + gradient('orange', 'yellow', 'red')(' ──────────────────────────────────────────────') + '\n' + gradient('red', 'yellow', 'orange')(' │ repo https://notabug.org/sayem314/d-fi │ ') + '\n' + gradient('red', 'yellow', 'orange')(' │ github https://github.com/sayem314 │ ') + '\n' + gradient('red', 'yellow', 'orange')(' │ coffee https://ko-fi.com/sayemchowdhury │ ') + '\n' + gradient('red', 'yellow', 'orange')(' ──────────────────────────────────────────────'), ); const cmd = new Command() .option('-q, --quality ', 'The quality of the files to download: 128/320/flac ') .option('-o, --output