Пример #1
0
 /**
  * Handle tmdb discover scraping.
  * 
  * @return Redirect
  */
 public function postTmdbDiscover()
 {
     $input = Input::except('_token');
     if (!($amount = $this->scraper->tmdbDiscover($input))) {
         return Redirect::back()->withFailure(trans('dash.failed to scrape'));
     }
     return Redirect::back()->withSuccess(trans('dash.scraped successfully', array('number' => $amount)));
 }
Пример #2
0
 /**
  * Exctract single trailer from tmdb response.
  * 
  * @return string
  */
 private function trailers()
 {
     if (isset($this->raw['videos']['results']) && is_array($this->raw['videos']['results'])) {
         foreach ($this->raw['videos']['results'] as $video) {
             if (strtolower($video['type']) === 'trailer' && strtolower($video['site']) === 'youtube') {
                 return $this->youtube . $video['key'];
             }
         }
     }
     return $this->scraper->getTrailer($this->getTitle(), $this->getReleaseDate());
 }
Пример #3
0
 /**
  * Exctract single trailer from tmdb response.
  * 
  * @return string
  */
 private function trailers()
 {
     if (isset($this->raw['trailers']['youtube'][0]['source'])) {
         return $this->youtube . $this->raw['trailers']['youtube'][0]['source'];
     } else {
         return $this->scraper->getTrailer($this->getTitle(), $this->getReleaseDate());
     }
 }