File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,19 @@ public function get(object $page, string $element)
3434 break ;
3535
3636 case "year " :
37- $ patterns = ["section section div div div ul li a " , ".title_wrapper h1 #titleYear a " ];
37+ $ patterns = ["section section div div div ul li a " , ".title_wrapper h1 #titleYear a " , " .title_wrapper .subtext a[title='See more release dates'] " ];
3838 $ year = $ this ->findMatchInPatterns ($ dom , $ page , $ patterns );
3939
40+ // Detect OLD IMDB + TV show
41+ if ($ this ->count ($ year ) > 4 ) {
42+ // Extract year from text
43+ // \d{4}.\d{4}
44+ $ matchYear = preg_replace ("/[^\d{4}-–\d{4}]/ " , "" , $ year );
45+ if ($ this ->count ($ matchYear ) > 0 ) {
46+ $ year = $ matchYear ;
47+ }
48+ }
49+
4050 return $ this ->strClean ($ year );
4151 break ;
4252
You can’t perform that action at this time.
0 commit comments