{"analyzedAt":"2022-06-25T02:09:08.098Z","collected":{"metadata":{"name":"yt-dl-streamer","scope":"unscoped","version":"1.0.1","description":"Script to capture yt-dl-core readable streams and write them to '.flv' or '.mp3' files on your disk.","keywords":["youtube","streamer","download","mp3","flv"],"date":"2020-02-08T22:09:26.354Z","author":{"name":"brunodev09"},"publisher":{"username":"brunodev09","email":"bruno.mayol.giannotti@gmail.com"},"maintainers":[{"username":"brunodev09","email":"bruno.mayol.giannotti@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/Brunodev09/bdv-yt-dl-streamer-to-file.git"},"links":{"npm":"https://www.npmjs.com/package/yt-dl-streamer","homepage":"https://github.com/Brunodev09/bdv-yt-dl-streamer-to-file#readme","repository":"https://github.com/Brunodev09/bdv-yt-dl-streamer-to-file","bugs":"https://github.com/Brunodev09/bdv-yt-dl-streamer-to-file/issues"},"license":"(MIT)","dependencies":{"fluent-ffmpeg":"^2.1.2","progress-stream":"^2.0.0","sanitize-filename":"^1.6.3","ytdl-core":"^1.0.7"},"devDependencies":{"@types/node":"^12.12.26","cors":"^2.8.5","typescript":"^3.7.5"},"releases":[{"from":"2022-05-26T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":0},{"from":"2022-03-27T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":1},{"from":"2021-12-27T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":1},{"from":"2021-06-25T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":1},{"from":"2020-06-25T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":1}],"readme":"# yt-dl-streamer\n\nScript to capture yt-dl-core readable streams and write them to \".flv\" or \".mp3\" files on your disk.\n\n## Description\n\nBasically a module that downloads Youtube audio and/or video to your disk using progress-stream to show you the progress.\n\n## Getting Started\n\n### Dependencies\n* Node.js\n* progress-stream\n* sanitize-filename\n* ytdl-core\n* fluent-ffmpeg (Optional, only for audio downloads)\n\n\n### Installing\n\n```\n$: npm i --save yt-dl-streamer\n```\n\n### Examples in Javascript\n\n* Downloading a video:\n\n```\nconst Streamer = require(\"yt-dl-streamer\").Streamer;\n\ntry {\n    const link = \"4oMJIyVOWL4\";\n    const outPath = \"/home/bgiannoti/Work/myStuff/videos\";\n    const format = \"Video\";\n    const quality = \"Highest\";\n    const timeoutBetweenProgressEmits = 1000;\n\n    const ytStream = new Streamer(format, quality, outPath, timeoutBetweenProgressEmits, null);\n    ytStream.download(link);\n    ytStream.runQueue();\n    \n    ytStream.on(\"finished\", (err, data) => {\n        console.log(JSON.stringify(data));\n        process.exit(0);\n    });\n\n    ytStream.on(\"error\", (error) => {\n        console.log(error);\n    });\n\n    ytStream.on(\"progress\", (progress) => {\n        console.log(JSON.stringify(progress));\n    });\n} catch (e) {\n    console.error(e)\n    process.exit(1);\n}\n\n```\n\n* Downloading a audio-only .mp3:\n\n```\nconst Streamer = require(\"./tsc/Streamer\").Streamer;\n\ntry {\n    const link = \"4oMJIyVOWL4\";\n    const outPath = \"/home/bgiannoti/Work/bdv-yt-dl-streamer-to-file/videos\";\n    const format = \"Audio\";\n    const quality = \"Highest\";\n    const pathToFfmpeg = \"/snap/bin/ffmpeg\";\n    const timeoutBetweenProgressEmits = 1000;\n\n    const ytStream = new Streamer(format, quality, outPath, timeoutBetweenProgressEmits, pathToFfmpeg);\n    ytStream.download(link);\n    ytStream.runQueue();\n    \n    ytStream.on(\"finished\", (err, data) => {\n        console.log(data);\n        process.exit(0);\n    });\n\n    ytStream.on(\"error\", (error) => {\n        console.log(error);\n    });\n\n    ytStream.on(\"progress\", (progress) => {\n        console.log(progress);\n    });\n} catch (e) {\n    console.error(e)\n    process.exit(1);\n}\n```\n\n\n### Types and definitions\n\nIn Javascript:\n```\nconst Streamer = require(\"./tsc/Streamer\").Streamer;\n```\n\nIn Typescript:\n```\nimport Streamer from \"./src/Streamer;\n```\nThe Streamer class is instantiated by passing the following parameters:\n ```\n    \"format\": <const string>,\n    \"quality\": <const string>,\n    \"out\": <string>,\n    \"timeout\": <number>,\n    \"codecPath\"?: <string>\n```\n\n- `format` accepts only two possible values: `'Audio'` or `'Video'`.\n- `quality` - accepts only two possible values: `'highest'` or `'lowest'`\n- `'out'` - the strigified path of the output on your disk you want files to be saved to. If you present a invalid path, the script will try to create it for you.\n- `'timeout'` - the timeout between each progress log emit of your downloaded file.\n- `'codecPath'` - Not mandatory, only if you want a .mp3 conversion. In that case you need to provide the path in your disk for the ffmpeg installation. (https://www.ffmpeg.org/download.html)\n\n\n```[Streamer].download(link: <string>): null```\n- `download` method is responsible for pushing your link to the download queue.\n\n```[Streamer].runQueue(link: <string>): null```\n- `runQueue` method is responsible for actively executing the binded download links in order.\n\n\n### Events emitted\n\n```[Streamer].on(\"progress\", [Function])```\n```[Streamer].on(\"finished\", [Function])```\n```[Streamer].on(\"error\", [Function])```\n\n## Authors\n\nBrunodev09 - Bruno Mayol Giannotti\n\n## License\n\nMIT"},"npm":{"downloads":[{"from":"2022-06-24T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":0},{"from":"2022-06-18T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":4},{"from":"2022-05-26T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":9},{"from":"2022-03-27T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":41},{"from":"2021-12-27T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":81},{"from":"2021-06-25T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":161}],"starsCount":0},"github":{"starsCount":1,"forksCount":0,"subscribersCount":2,"issues":{"count":0,"openCount":0,"distribution":{"3600":0,"10800":0,"32400":0,"97200":0,"291600":0,"874800":0,"2624400":0,"7873200":0,"23619600":0,"70858800":0,"212576400":0},"isDisabled":false},"contributors":[{"username":"Brunodev09","commitsCount":3}],"commits":[{"from":"2022-06-18T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":0},{"from":"2022-05-26T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":0},{"from":"2022-03-27T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":0},{"from":"2021-12-27T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":0},{"from":"2021-06-25T00:00:00.000Z","to":"2022-06-25T00:00:00.000Z","count":0}]},"source":{"files":{"readmeSize":3597,"testsSize":0},"outdatedDependencies":{"ytdl-core":{"required":"^1.0.7","stable":"4.11.0","latest":"4.11.0"}}}},"evaluation":{"quality":{"carefulness":0.71,"tests":0,"health":0.75,"branding":0},"popularity":{"communityInterest":4,"downloadsCount":13.666666666666666,"downloadsAcceleration":-0.03304794520547946,"dependentsCount":0},"maintenance":{"releasesFrequency":0.28664383561643836,"commitsFrequency":0,"openIssues":0.7,"issuesDistribution":0.7}},"score":{"final":0.4522469055732443,"detail":{"quality":0.5035053957346617,"popularity":0.03046425754848703,"maintenance":0.8300937048882155}}}