<commit_before>#!/usr/bin/env node

var _ = require('underscore');
var util = require('../lib/utils');
var pully = require('../lib/main');
var errorCodes = require('../data/error-codes');
require('colors');

(function () {

    // Test URL: https://www.youtube.com/watch?v=ZVOmv_vMIbA

    var options = parseArgs(process.argv);

    pully(options, function (err, info, videoPath) {

        if(err)
            console.error(err);
        else
            console.log('Download complete for "'+ info.title.yellow.bold +'"!\n    (' + videoPath.grey.bold + ')');

        console.log('');
    });

    function parseArgs(args) {
        // If no arguments, print the help message...
        if(args.length < 3) {
            printHelp();
        }

        // If too many errors, exit early...
        if(args.length > 5) {
            exit('Too many parameters, run `pully --help` for usage details.', errorCodes.TOO_MANY_ARGUMENTS);
        }

        var options = {
            url: args[2]
        };

        // TODO: Validate URL format.

        // If at least one argument is preset...
        if(args.length >= 4) {
            if(isNaN(args[3]))
                options.preset = args[3];
            else
                options.count = parseInt(args[3]);
        }

        // If a second argument is present...
        if(args.length === 5) {<commit_msg>Fixed final output.<commit_after>#!/usr/bin/env node

var _ = require('underscore');
var util = require('../lib/utils');
var pully = require('../lib/main');
var errorCodes = require('../data/error-codes');
require('colors');

(function () {

    // Test URL: https://www.youtube.com/watch?v=ZVOmv_vMIbA

    var options = parseArgs(process.argv);

    pully(options, function (err, info, videoPath) {

        if(err)
            console.error(err);
        else
            console.log('Download complete for "'+ info.title.yellow.bold +'"! (' + videoPath.grey.bold + ')');

        console.log('');
    });

    function parseArgs(args) {
        // If no arguments, print the help message...
        if(args.length < 3) {
            printHelp();
        }

        // If too many errors, exit early...
        if(args.length > 5) {
            exit('Too many parameters, run `pully --help` for usage details.', errorCodes.TOO_MANY_ARGUMENTS);
        }

        var options = {
            url: args[2]
        };

        // TODO: Validate URL format.

        // If at least one argument is preset...
        if(args.length >= 4) {
            if(isNaN(args[3]))
                options.preset = args[3];
            else
                options.count = parseInt(args[3]);
        }

        // If a second argument is present...
        if(args.length === 5) {
{'fraction_non_alphanumeric': 0.15587266739846323, 'fraction_numerical': 0.005854372484449323, 'mean_word_length': 1.8012295081967213, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3248493', 'n_tokens_mistral': 839, 'n_tokens_neox': 802, 'n_words': 195}