controllers/FrontController.php
public function info(Request $request, Response $response)
    {
        $url = $request->getQueryParam('url') ?: $request->getQueryParam('v');

        if (isset($url) && !empty($url)) {
            $this->video = new Video($url, $this->getFormat($request), $this->getPassword($request));

            if ($this->config->convert && $request->getQueryParam('audio')) {
                // We skip the info page and get directly to the download.
                return $response->withRedirect(
                    $this->container->get('router')->pathFor('download').
                    '?'.http_build_query($request->getQueryParams())
                );
            } else {
                return $this->getInfoResponse($request, $response);
            }
        } else {
            return $response->withRedirect($this->container->get('router')->pathFor('index'));
        }
    }
public function info(Request $request, Response $response)
    {
        $url = $request->getQueryParam('url') ?: $request->getQueryParam('v');

        if (isset($url) && !empty($url)) {
            $this->video = new Video($url, $this->getFormat($request), $this->getPassword($request));

            if ($this->config->convert && $request->getQueryParam('audio')) {
                // We skip the info page and get directly to the download.
                return $response->withRedirect(
                    $this->container->get('router')->pathFor('download').
                    '?'.http_build_query($request->getQueryParams())
                );
            } else {
                return $this->getInfoResponse($request, $response);
            }
        } else {
            return $response->withRedirect($this->container->get('router')->pathFor('index'));
        }
    }
public function info ( Request $ request , Response $ response ) { $ url = $ request -> getQueryParam ( 'url' ) ? : $ request -> getQueryParam ( 'v' ) ; if ( isset ( $ url ) && ! empty ( $ url ) ) { $ this -> video = new Video ( $ url , $ this -> getFormat ( $ request ) , $ this -> getPassword ( $ request ) ) ; if ( $ this -> config -> convert && $ request -> getQueryParam ( 'audio' ) ) { // We skip the info page and get directly to the download. return $ response -> withRedirect ( $ this -> container -> get ( 'router' ) -> pathFor ( 'download' ) . '?' . http_build_query ( $ request -> getQueryParams ( ) ) ) ; } else { return $ this -> getInfoResponse ( $ request , $ response ) ; } } else { return $ response -> withRedirect ( $ this -> container -> get ( 'router' ) -> pathFor ( 'index' ) ) ; } }
Dislay information about the video.

@param Request  $request  PSR-7 request
@param Response $response PSR-7 response

@return Response HTTP response
Dislay information about the video .