@acephale-green-party/coomer-downloader
Version:
Downloads images/videos from Coomer/Kemono/Reddit-NSFW user posts
26 lines (18 loc) • 630 B
JavaScript
import os from 'node:os';
import path from 'node:path';
import { downloadFiles } from './src/downloader.js';
import { apiHandler } from './src/api/index.js';
import { argumentHander } from './src/args-handler.js';
async function run() {
const { url, dir, media } = argumentHander();
const { dirName, files } = await apiHandler(url, media);
console.log(' ', files.length, 'files found');
const downloadDir =
dir === './'
? path.resolve(dir, dirName)
: path.join(os.homedir(), path.join(dir, dirName));
await downloadFiles(files, downloadDir, url);
console.log('\n');
}
run();