Last active
December 9, 2019 16:38
-
-
Save raulcontrerasrubio/762b5ef5ce50d5b3df3dcdcc5bc8fd0a to your computer and use it in GitHub Desktop.
Youtube video url filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The aim of this file is get the correct video url from a youtube playlist to automatize the audio download with youtube-dl | |
*/ | |
const fs = require('fs'); | |
const filename = './videos.txt'; | |
const lines = require('fs').readFileSync(filename, 'utf-8') | |
.split('\n') | |
.filter(Boolean); | |
console.log('Start'); | |
for(let line of lines){ | |
console.log(new URLSearchParams(line).entries().next().value.join('=')); | |
} | |
console.log(`Total lines: ${lines.length}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment