Alltube\VideoDownload::getURL PHP 메소드

getURL() 공개 메소드

Get URL of video from URL of page.
public getURL ( string $url, string $format = null ) : string
$url string URL of page
$format string Format to use for the video
리턴 string URL of video
    public function getURL($url, $format = null)
    {
        return $this->getProp($url, $format, 'get-url');
    }

Usage Example

예제 #1
0
 /**
  * Redirect to video file.
  *
  * @param Request  $request  PSR-7 request
  * @param Response $response PSR-7 response
  *
  * @return Response HTTP response
  */
 public function redirect(Request $request, Response $response)
 {
     $params = $request->getQueryParams();
     if (isset($params['url'])) {
         try {
             $url = $this->download->getURL($params['url'], $params['format']);
             return $response->withRedirect($url);
         } catch (\Exception $e) {
             $response->getBody()->write($e->getMessage());
             return $response->withHeader('Content-Type', 'text/plain');
         }
     }
 }
All Usage Examples Of Alltube\VideoDownload::getURL