Skip to content

Instantly share code, notes, and snippets.

@cope
Last active December 29, 2020 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cope/e88f87fbfb7e19d455d273fc0b5c03f4 to your computer and use it in GitHub Desktop.
Save cope/e88f87fbfb7e19d455d273fc0b5c03f4 to your computer and use it in GitHub Desktop.
const fs = require('fs');
fs.readdirSync('./').forEach(file => {
if (file.endsWith('.mkv')) {
let clean = file.split('.');
let pos = clean.indexOf('720p');
clean = clean.slice(0, pos).join(' ') + '.mkv';
console.log(file, clean, pos);
fs.renameSync(file, clean);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment