This file contains 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
<?php | |
/* Anime Rename script v1.0 by Werner Buck updatdate by squareatom 02/17/2011 and again update by fda 04/17/2011 and updated by jonjomckay 08/12/2015 | |
* | |
* Searches directory recursively for .mkv/.avi/.mp4 video files. | |
* When found it tries to find the season and episode on www.thetvdb.com to rename | |
* the file so it can be correctly scraped by XBMC's TvDB scraper. | |
* | |
* Can be used for SABnzbd and or as standalone script | |
* Requires: | |
* - PHP-CLI (ubuntu apt-get install php5-cli) |
This file contains 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
class Song | |
# Regular expressions | |
RE = { | |
:featured => /(featuring | ?ft\.? |feat\.? |f\. |w\/){1}/i, | |
:remixer => / remix| rmx| edit| bootleg| mix| remake| re-work| rework| extended remix| bootleg remix/i, | |
:mashup_split => / \+ | x | vs\.? /i, | |
:producer => /^(produced by|prod\.? by |prod\. )/i, | |
:cover => / cover/i, | |
:split => /([^,&]+)(& ?([^,&]+)|, ?([^,&]+))*/i, # Splits "one, two & three" | |
:open => /[\(\[\{]/, |