Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example
- // URL: http://uptobox.com/6f871tvewr7z
- // Original Filename: Last.Man.Standing.US.S05E01.480p.HDTV.X264-mRs.mkv
- // Cleaned Filename: Last Man Standing US S05E01.mkv
- var fullPath = link.getDownloadPath();
- var fullName = link.getName();
- var fileType = getPath(link.getDownloadPath()).getExtension();
- var extLength = fileType.length + 1;
- var fileName = fullName.substring(0, fullName.length - extLength);
- var cleanName = fileName.replace(/480p|HDTV|-mrs|x264/gi, '').replace(/\.|_/g, ' ');
- link.setName(cleanName.trim() + "." + fileType);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement