File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,13 @@ public function search($query, $category="all") {
7878 // Image object
7979 $ item_image = $ section_row ->find ("td.primary_photo img " );
8080 $ row ["image " ] = "" ;
81- if (count ($ item_image ) > 0 ) {
81+ if (count ($ item_image ) > 0 )
82+ {
8283 $ row ["image " ] = $ item_image ->src ;
84+ if (preg_match ('/@/ ' , $ row ["image " ]))
85+ {
86+ $ row ["image " ] = preg_split ('~@(?=[^@]*$)~ ' , $ row ["image " ])[0 ] . "@.jpg " ;
87+ }
8388 }
8489
8590 // Get the id of the link
@@ -152,9 +157,17 @@ public function film($query, $techSpecs=false) {
152157 $ response ["year " ] = $ this ->textClean ($ film_page ->find ('.title_wrapper h1 #titleYear a ' )->text );
153158 $ response ["rating " ] = $ this ->textClean ($ film_page ->find ('.ratings_wrapper .ratingValue strong span ' )->text );
154159 $ response ["length " ] = $ this ->textClean ($ film_page ->find ('.subtext time ' )->text );
155- $ response ["poster " ] = $ film_page ->find ('.poster img ' )->src ;
156160 $ response ["plot " ] = $ this ->textClean ($ film_page ->find ('.plot_summary .summary_text ' )->text );
157161
162+ // Get poster src
163+ $ response ["poster " ] = $ film_page ->find ('.poster img ' )->src ;
164+ // If '@' appears in poster link
165+ if (preg_match ('/@/ ' , $ response ["poster " ]))
166+ {
167+ // Remove predetermined size to get original image
168+ $ response ["poster " ] = preg_split ('~@(?=[^@]*$)~ ' , $ response ["poster " ])[0 ] . "@.jpg " ;
169+ }
170+
158171
159172 // Get all cast list
160173 $ cast_list_all = $ film_page ->find ('table.cast_list tr ' );
You can’t perform that action at this time.
0 commit comments