Changeset 1093
- Timestamp:
- 10/05/08 19:04:59 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/swisscenter/ext/parsers/tv/www.TheTVDB.com.php
r1054 r1093 16 16 17 17 Please help thetvdb.com website by contributing information and artwork if possible. 18 19 NOTE: This parser for thetvdb.com is _NOT_ an official part of SWISScenter, and is not supported by the20 SWISScenter developers.21 18 22 19 Version history: … … 93 90 { 94 91 // Zip extension not loaded so download non-zipped data 95 send_to_log(4,'Downloading remote file to the local filesystem',$series_xml_url); 96 if (!@copy($series_xml_url, $series_cache)) 97 send_to_log(6,'Failed to copy remote file to',$series_cache); 98 send_to_log(4,'Downloading remote file to the local filesystem',$banner_xml_url); 99 if (!@copy($banner_xml_url, $banner_cache)) 100 send_to_log(6,'Failed to copy remote file to',$banner_cache); 101 // send_to_log(4,'Downloading remote file to the local filesystem',$actors_xml_url); 102 // if (!@copy($actors_xml_url, $actors_cache)) 103 // send_to_log(6,'Failed to copy remote file to',$actors_cache); 92 file_download_and_save($series_xml_url, $series_cache, true); 93 file_download_and_save($banner_xml_url, $banner_cache, true); 94 // file_download_and_save($actors_xml_url, $actors_cache, true); 104 95 } 105 96 else 106 97 { 107 send_to_log(4,'Downloading remote file to the local filesystem',$series_zip_url); 108 if (!@copy($series_zip_url, $series_zip_cache)) 109 send_to_log(6,'Failed to copy remote file to',$series_zip_cache); 110 else 98 file_download_and_save($series_zip_url, $series_zip_cache, true); 99 if (file_exists($series_zip_cache)) 111 100 { 112 101 // Extract zip contents … … 297 286 $xmlmirror = $xmlmirrors[rand(0, count($xmlmirrors)-1)]; 298 287 else 299 $xmlmirror = false;288 $xmlmirror = 'http://thetvdb.com'; 300 289 301 290 if (count($bannermirrors)>0) 302 291 $bannermirror = $bannermirrors[rand(0, count($bannermirrors)-1)]; 303 292 else 304 $bannermirror = false;293 $bannermirror = 'http://thetvdb.com'; 305 294 } 306 295 trunk/swisscenter/ext/parsers/tv/www.epguides.com.php
r957 r1093 24 24 28-Jan-2008: v1.2: Encoded URL containing Programme name and improved search and error handling. 25 25 04_Mar-2008: v1.3: Minor fixes to url and episode searching. 26 26-Sep-2008: v1.4: Fixed for new layout at TV.com (synopsis and date). Fixes by Keith Solomon. 26 27 27 28 *************************************************************************************************/ … … 182 183 send_to_log(6,'Fetching information from: '.$url_load); 183 184 $html = file_get_contents( $url_load ); 184 185 185 186 // Year 186 $year = substr_between_strings($html,'First Aired:','  ');187 $year = substr_between_strings($html,'First Aired:','</li></ul>'); 187 188 $year = substr($year,strlen($year)-4); 188 189 189 190 // Synopsis 190 $start = strpos($html,'<div id=" main-col">');191 $end = strpos($html,' class="ta-r mt-10 f-bold">',$start+1);191 $start = strpos($html,'<div id="indepth_block" class="module">'); 192 $end = strpos($html,'</a></p>',$start+1); 192 193 $html_synopsis = substr($html,$start,$end-$start); 193 $start = strrpos_str($html_synopsis,' div>');194 $start = strrpos_str($html_synopsis,'<p class="deck">'); 194 195 $html_synopsis = substr($html_synopsis,$start); 195 $synopsis_ep = substr_between_strings($html_synopsis,'d iv>','<div');196 $synopsis_ep = substr_between_strings($html_synopsis,'deck">','<a href='); 196 197 197 198 // Director(s) … … 273 274 274 275 // Year 275 $year = substr_between_strings($html,'First Aired:','  ');276 $year = substr_between_strings($html,'First Aired:','</li></ul>'); 276 277 $year = substr($year,strlen($year)-4); 277 278 278 279 // Synopsis 279 $start = strpos($html,'<div id=" main-col">');280 $end = strpos($html,' class="ta-r mt-10 f-bold">',$start+1);280 $start = strpos($html,'<div id="indepth_block" class="module">'); 281 $end = strpos($html,'</a></p>',$start+1); 281 282 $html_synopsis = substr($html,$start,$end-$start); 282 $start = strrpos_str($html_synopsis,' div>');283 $start = strrpos_str($html_synopsis,'<p class="deck">'); 283 284 $html_synopsis = substr($html_synopsis,$start); 284 $synopsis_ep = substr_between_strings($html_synopsis,'d iv>','<div');285 285 $synopsis_ep = substr_between_strings($html_synopsis,'deck">','<a href='); 286 286 287 // Director(s) 287 288 $start = strpos($html,"Director:");