Skip to content

Instantly share code, notes, and snippets.

@raulcontrerasrubio
Last active December 9, 2019 16:38
Show Gist options
  • Save raulcontrerasrubio/762b5ef5ce50d5b3df3dcdcc5bc8fd0a to your computer and use it in GitHub Desktop.
Save raulcontrerasrubio/762b5ef5ce50d5b3df3dcdcc5bc8fd0a to your computer and use it in GitHub Desktop.
Youtube video url filter
/*
* 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