Scrape Video information from hosting sites
@param  Null
@return String
339362
public function getTitle()
    {
        if ($this->getService() == 'YouTube') {
            $data = $this->getCachedJsonResponse(
                'https://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=' .
                $this->VideoID .
                '&format=json'
            );
            if ($data && !empty($data['title'])) {
                return $data['title'];
            }
        }
        if ($this->getService() == 'Vimeo') {
            $data = $this->getCachedJsonResponse(
                'https://vimeo.com/api/v2/video/' . $this->VideoID . '.json'
            );
            if ($data && !empty($data[0]) && !empty($data[0]['title'])) {
                return $data[0]['title'];
            }
        }
    }
464132
protected function matchVideo()
    {
        return ReplyRuleKeyword::find()
            ->andFilterWhere(['type' => [ReplyRuleKeyword::TYPE_VIDEO, ReplyRuleKeyword::TYPE_SHORT_VIDEO]])
            ->wechatRule($this->getWechat()->id)
            ->limitTime(TIMESTAMP)
            ->all();
    }
1142440
function getDownloadUrl() {
		$inputs = self::remoteXpathQuery($this->videoUrl, '/html/body/div[3]/div[2]/div[2]/div[7]/form/input[@name]');
		
		$postFields = [];
		foreach ($inputs as $input) {
			$postFields[$input->getAttribute('name')] = $input->getAttribute('value');
		}
		
		sleep(11);	//10 sek wait-time is required
		$scriptElements = self::remoteXpathQuery($this->videoUrl, '/html/body/div[3]/div[2]/div[2]/div[1]/script[3]', $postFields);
		
		$textContent = $scriptElements->item(0)->textContent;
		preg_match('/file: ".*\..*"/U', $textContent, $matches);
		$url = substr(reset($matches), 6);
		return trim($url, '"');
	}
1255383
static function getDownloadUrl($videoUrl) {
		$toplevelDomain = parse_url($videoUrl);
		$toplevelDomain = $toplevelDomain['host'];
		
		if (!is_dir(__DIR__ . DIRECTORY_SEPARATOR . 'ProviderHandler' . DIRECTORY_SEPARATOR . $toplevelDomain)) {
			throw new \Exception('There is no special implementation for the provider ' . $toplevelDomain . '!');
		}
		
		require_once __DIR__ . DIRECTORY_SEPARATOR . 'ProviderHandler' . DIRECTORY_SEPARATOR . $toplevelDomain . DIRECTORY_SEPARATOR . 'Provider.php';
		$provider = new \Provider($videoUrl);
		return $provider->getDownloadUrl();
	}
191466
public function getRecentlyFeaturedVideoFeed($location = null)
    {
        $standardFeedUri = self::STANDARD_RECENTLY_FEATURED_URI;

        if ($this->getMajorProtocolVersion() == 2) {
            $standardFeedUri = self::STANDARD_RECENTLY_FEATURED_URI_V2;
        }

        if ($location == null) {
            $uri = $standardFeedUri;
        } else if ($location instanceof Zend_Gdata_Query) {
            if ($location instanceof Zend_Gdata_YouTube_VideoQuery) {
                if (!isset($location->url)) {
                    $location->setFeedType('recently featured');
                }
            }
            $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
        } else {
            $uri = $location;
        }
        return parent::getFeed($uri, 'Zend_Gdata_YouTube_VideoFeed');
    }
660390
public function videoToHtml()
    {
        if (in_array($this->provider, $this->providers)) {
            $caption = '';
            if (!empty($this->caption)) {
                $caption = $this->parser->toHtml($this->caption);
            }

            // View
            return $this->view(
                'video.'.$this->provider,
                [
                    'remote' => $this->remoteId,
                    'caption' => $caption,
                ],
                $this->provider
            );
        }

        return '';
    }
342702
public function getVideo()
    {
        // This function is based on code by Wouter Sioen released under the MIT license
        // see woutersioen/sir-trevor-php
        // Regexps from http://stackoverflow.com/questions/10488943/easy-way-to-get-vimeo-id-from-a-vimeo-url
        // and http://stackoverflow.com/questions/3452546/javascript-regex-how-to-get-youtube-video-id-from-url
        if (preg_match('/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/', $this->getVideoUrl(), $matches)) {
            $data = array(
                'source' => 'youtube',
                'remote_id' => $matches[1]
            );
        } elseif (preg_match('/(?:https?:\/\/)?(?:www\.)?(?:player\.)?vimeo\.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/', $this->getVideoUrl(), $matches)) {
            $data = array(
                'source' => 'vimeo',
                'remote_id' => $matches[2]
            );
        } else {
            throw new \FelixOnline\Exceptions\InternalException('The specified video URL is not valid');
        }

        if ($data['source'] == 'youtube') {
            $html = '<iframe src="//www.youtube.com/embed/' . $data['remote_id'] . '?rel=0" ';
            $html .= 'frameborder="0" allowfullscreen></iframe>' . "\n";
        } else {
            $html = '<iframe src="//player.vimeo.com/video/' . $data['remote_id'];
            $html .= '?title=0&amp;byline=0" frameborder="0"></iframe>' . "\n";
        }

        return $html;
    }
1082552
public function getTagAttribute()
    {
        // Require sources and for the encoding to be complete
        if (!$sources = $this->getOutputsValue()) {
            return;
        }

        // Start the tag
        $tag = HtmlElement::video();
        $tag->value('Your browser does not support the video tag. You should <a href="http://whatbrowser.org/">consider updating</a>.');

        // Loop through the outputs and add them as sources
        $types = ['mp4', 'webm', 'ogg', 'playlist'];
        foreach ($sources as $type => $src) {

            // Only allow basic output types
            if (!in_array($type, $types)) {
                continue;
            }

            // Make the source
            $source = HtmlElement::source()->src($src);
            if ($type == 'playlist') {
                $source->type('application/x-mpegurl');
            } else {
                $source->type('video/'.$type);
            }

            // Add a source to the video tag
            $tag->appendChild($source);
        }

        // Return the tag
        return $tag;
    }
735281
public function getQueryUrl($majorProtocolVersion = null,
        $minorProtocolVersion = null)
    {
        if (isset($this->_url)) {
            $url = $this->_url;
        } else {
            $url = Zend_Gdata_YouTube::VIDEO_URI;
        }
        if ($this->getCategory() !== null) {
            $url .= '/-/' . $this->getCategory();
        }
        $url = $url . $this->getQueryString($majorProtocolVersion,
            $minorProtocolVersion);
        return $url;
    }
168692
public function getMovieInfo() {

		$post_id      = get_the_ID();
		$post_title   = get_the_title();
		$content_post = get_post( $post_id );

		$post_content = $content_post->post_content;
		$post_content = apply_filters( 'the_content', $post_content );
		$post_content = str_replace( ']]>', ']]&gt;', $post_content );

		$movie = [

			'Title'      => __( 'Title', 'extensions-for-grifus-copy' ),
			'Rated'      => __( 'Rated', 'extensions-for-grifus-copy' ),
			'Released'   => __( 'Published', 'extensions-for-grifus-copy' ),
			'imdbRating' => __( 'Rating', 'extensions-for-grifus-copy' ),
			'imdbVotes'  => __( 'Votes', 'extensions-for-grifus-copy' ),
			'Awards'     => __( 'Awards', 'extensions-for-grifus-copy' ),
			'Country'    => __( 'Country', 'extensions-for-grifus-copy' ),
		];

		foreach ( $movie as $key => $value ) {
			$data = info_movie_get_meta( $key );

			$movie[ $key ] .= ( $data ) ? ': ' . $data : ': ';
		}

		$movie['Original']  = __( 'Original', 'extensions-for-grifus-copy' );
		$movie['Original'] .= ': ';
		$movie['Original'] .= ( $post_title ) ? $post_title : '';

		$duration = get_post_custom_values( 'Runtime' );

		$movie['Duration']  = __( 'Duration', 'extensions-for-grifus-copy' );
		$movie['Duration'] .= ': ';
		$movie['Duration'] .= ( isset( $duration[0] ) ) ? $duration[0] : '';

		$movie['Sipnosis']  = __( 'Sipnosis', 'extensions-for-grifus-copy' );
		$movie['Sipnosis'] .= ': ';
		$movie['Sipnosis'] .= ( $post_content ) ? $post_content : '';

		$movie['Director']  = __( 'Director', 'extensions-for-grifus-copy' );
		$movie['Director'] .= ': ';

		$director = wp_get_post_terms( $post_id, 'director' );

		foreach ( $director as $key => $value ) {
			if ( isset( $value->name ) ) {
				$movie['Director'] .= $value->name . ', ';
			}
		}

		$movie['Stars'] = __( 'Stars', 'extensions-for-grifus-copy' ) . ': ';

		$stars = wp_get_post_terms( $post_id, 'star' );

		foreach ( $stars as $key => $value ) {
			if ( isset( $value->name ) ) {
				$movie['Stars'] .= $value->name . ', ';
			}
		}

		$movie['Cast'] = __( 'Cast', 'extensions-for-grifus-copy' ) . ': ';

		$cast = wp_get_post_terms( $post_id, 'actor' );

		foreach ( $cast as $key => $value ) {
			if ( isset( $value->name ) ) {
				$movie['Cast'] .= $value->name . ', ';
			}
		}

		$movie['Genre'] = __( 'Genre', 'extensions-for-grifus-copy' ) . ': ';

		$categories = get_the_category();

		foreach ( $categories as $key => $value ) {
			if ( isset( $value->name ) ) {
				$movie['Genre'] .= $value->name . ', ';
			}
		}

		$params = [

			'postID'      => $post_id,
			'movie_info'  => [

				'the_title' => $movie['Original'] . "\n\n",
				'title'     => $movie['Title'] . "\n\n",
				'published' => $movie['Released'] . "\n\n",
				'rated'     => $movie['Rated'] . "\n\n",
				'duration'  => $movie['Duration'] . "\n\n",
				'rating'    => $movie['imdbRating'] . "\n\n",
				'votes'     => $movie['imdbVotes'] . "\n\n",
				'awards'    => html_entity_decode( $movie['Awards'] ) . "\n\n",
				'country'   => $movie['Country'] . ".\n\n",
				'sipnosis'  => strip_tags( trim( $movie['Sipnosis'] ) ) . "\n\n",
				'director'  => trim( $movie['Director'], ', ' ) . ".\n\n",
				'stars'     => trim( $movie['Stars'], ', ' ) . ".\n\n",
				'cast'      => trim( $movie['Cast'], ', ' ) . ".\n\n",
				'genre'     => trim( $movie['Genre'], ', ' ) . '.',
			],
			'copy_title'  => __(
				'Copy information',
				'extensions-for-grifus-copy'
			),
			'copy_button' => __( 'Copy', 'extensions-for-grifus-copy' ),
		];

		return $params;
	}
1035163
public function getDescription($url) {
        return Template::raw(VideoEmbedder::$plugin->service->getInfo($url)->description);
    }
1318668
public function getVideoTitle()
    {
        $url = trim($this->value);
        return VideoLink::create()->setValue($url)->Title;
    }
903072
public function getVideoId($url)
    {
        // looks like there are, now let's only do this for YouTube and Vimeo
        if($this->getInfo($url)->type == 'video' && ($this->isYouTube($url) || $this->isVimeo($url)))
        {
            if ($this->isYouTube($url))
            {
                return $this->getYouTubeId($url);
            }
            else if ($this->isVimeo($url))
            {
                return $this->getVimeoId($url);
            }
        }
        else
        {
            // return empty string
            return '';
        }
    }
845051
protected function leadFLV()
	{
		$lead = $this->ffprobeFormat("flv");

		if ($lead === true)
		{
			return $this->closeCase("flv", "video/x-flv", $this->metadata);
		}

		return null;
	}
1073922
public function getPreview(): ?string
    {
        $array = glob($this->getPath() . '/assets/images/preview.{jpg,jpeg,png,gif}', GLOB_BRACE);
        if (isset($array[0])) {
            return sprintf('/themes/%s/images/%s', $this->shortName, (new SplFileInfo($array[0]))->getBasename());
        }

        return null;
    }
276267
public Video[] getVideo() {
		List<Video> list = getComponentModel().video;
		return list == null ? null : list.toArray(new Video[]{});
	}
1192939
def harvest_video_data(image)
      response = Typhoeus.get(image.video_url, followlocation: true)

      if response.success?
        raise "Invalid content type: " + response.headers['Content-Type'] unless (response.headers['Content-Type'] == 'video/mp4')
      elsif response.timed_out?
        raise "Request timed out"
      elsif response.code == 0
        raise "Could not get an HTTP response"
      else
        raise "HTTP request failed: " + response.code.to_s
      end

      response.body
    end