diff --git a/destreamer.ts b/destreamer.ts index 6ce18f7..45804fb 100644 --- a/destreamer.ts +++ b/destreamer.ts @@ -1,4 +1,4 @@ -import { sleep, getVideoUrls, checkRequirements } from './utils'; +import { sleep, parseVideoUrls, checkRequirements } from './utils'; import { TokenCache } from './TokenCache'; import { getVideoMetadata } from './Metadata'; import { Metadata, Session } from './Types'; @@ -78,6 +78,7 @@ function init() { } async function DoInteractiveLogin(username?: string): Promise { + console.log('Launching headless Chrome to perform the OpenID Connect dance...'); const browser = await puppeteer.launch({ headless: false, @@ -230,7 +231,7 @@ async function main() { process.exit(-1); } - videoUrls = getVideoUrls(argv.videoUrls); + videoUrls = parseVideoUrls(argv.videoUrls); if (videoUrls.length === 0) { console.error(colors.red('\nERROR: No valid URL has been found!\n')); process.exit(-1); diff --git a/test/test.ts b/test/test.ts index 4b3b611..3bd6a51 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1,4 +1,4 @@ -import { getVideoUrls } from '../utils'; +import { parseVideoUrls } from '../utils'; import puppeteer from 'puppeteer'; import assert from 'assert'; import tmp from 'tmp'; @@ -53,7 +53,7 @@ describe('Destreamer', () => { fs.writeFileSync(tmpFile.fd, testIn.join('\r\n')); - testOut = getVideoUrls([tmpFile.name]); + testOut = parseVideoUrls([tmpFile.name]); if (testOut.length !== expectedOut.length) assert.strictEqual(testOut, expectedOut, "URL list not sanitized"); @@ -64,4 +64,4 @@ describe('Destreamer', () => { assert.ok("sanitizeUrls ok"); }); -}); \ No newline at end of file +}); diff --git a/utils.ts b/utils.ts index 4bd55b4..4eed2bd 100644 --- a/utils.ts +++ b/utils.ts @@ -27,7 +27,7 @@ function sanitizeUrls(urls: string[]) { return sanitized; } -export function getVideoUrls(videoUrls: any) { +export function parseVideoUrls(videoUrls: any) { const t = videoUrls[0] as string; const isPath = t.substring(t.length-4) === '.txt'; let urls: string[]; @@ -56,4 +56,4 @@ export function checkRequirements() { )); process.exit(22); } -} \ No newline at end of file +}