Last active
August 29, 2015 14:23
-
-
Save OstlerDev/afa32b9b2bfc8ab1e2d4 to your computer and use it in GitHub Desktop.
Get Strike Parser
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 | |
$titles = [ | |
'MyTV.Show.S09E01.HDTV.XviD', | |
'Game of Thrones S05E04 WEBRip XviD-FUM[ettv]', | |
'Breaking Bad S01E07 FINAL FRENCH DVDRip XviD-JMT', | |
'Breaking Bad S01E02 720p x265 HEVC - UTR']; | |
foreach($titles as $title){ | |
$pattern = "/S(\d+)E(\d+)\.(.+)/"; | |
preg_match($pattern, str_replace(' ', '.', $title), $matches); | |
$qualities = ['HDTV', '720p', '1080p']; | |
$epqual = 'HDTV'; | |
foreach($qualities as $quality){ | |
if (stripos($matches[3], $quality) !== false) $epqual = $quality; | |
} | |
print_r('Season ' . $matches[1] . ' Episode ' . $matches[2] . ' Quality ' . $epqual . "\r\n"); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment