Last active
October 11, 2015 21:18
-
-
Save kopiro/3920647 to your computer and use it in GitHub Desktop.
Rename in bash title of a TV serie from Wikipedia tables
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
| var commands = []; | |
| var serie = 1; | |
| var serietitle = prompt("Serie Title"); | |
| $('table tbody tr').each(function(k) | |
| { | |
| var title = $(this).find('td').eq(2).text(); | |
| if (!title) return; | |
| var episode = k<10 ? "0"+k : k; | |
| var finder = "*"+serie+"x"+episode+"*"; | |
| commands.push( "mv \"$(find . -name "+finder+")\" \""+serietitle+" - "+serie+"x"+episode+" - "+title+".avi\"" ); | |
| }); | |
| prompt('Execute this in the shell:', commands.join(';\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment