From c49467dd54dba739a554c53c7606f7da3fb00687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=8A=E3=82=B9=E3=82=BF=E3=82=B7=E3=82=A2?= Date: Sat, 20 Aug 2016 09:58:39 -0400 Subject: [PATCH] Fix Crunchyroll Detection --- detectstream/MediaStreamParse.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/detectstream/MediaStreamParse.m b/detectstream/MediaStreamParse.m index 15cd870..9cf8d97 100644 --- a/detectstream/MediaStreamParse.m +++ b/detectstream/MediaStreamParse.m @@ -44,10 +44,11 @@ +(NSArray *)parse:(NSArray *)pages{ //Perform Sanitation regextitle = [ez searchreplace:regextitle pattern:@"Crunchyroll - Watch\\s"]; regextitle = [ez searchreplace:regextitle pattern:@"\\s-\\sMovie\\s-\\sMovie"]; - regextitle = [ez searchreplace:regextitle pattern:@"\\sEpisode"]; - regextitle = [ez searchreplace:regextitle pattern:@"\\D-\\s*.*$"]; - tmpepisode = [ez findMatch:regextitle pattern:@"(\\d+)" rangeatindex:0]; - title = [ez findMatch:regextitle pattern:@"\\b.*\\D" rangeatindex:0]; + tmpepisode = [ez findMatch:regextitle pattern:@"\\sEpisode (\\d+)" rangeatindex:0]; + regextitle = [regextitle stringByReplacingOccurrencesOfString:tmpepisode withString:@""]; + tmpepisode = [ez searchreplace:tmpepisode pattern:@"\\sEpisode"]; + regextitle = [ez searchreplace:regextitle pattern:@"\\s-\\s*.*"]; + title = regextitle; } else continue; @@ -111,6 +112,7 @@ +(NSArray *)parse:(NSArray *)pages{ title = [ez findMatch:[NSString stringWithFormat:@"%@", DOM] pattern:@"
\\s+

*.*
" rangeatindex:0]; title = [ez searchreplace:title pattern:@"
\\s+

"]; title = [title stringByReplacingOccurrencesOfString:@"
" withString:@""]; + title = [ez searchreplace:title pattern:@"\\s-\\s*.*"]; } else continue; // Invalid address