getVideoPageUrl($request); $this->video = $this->downloader->getVideo( $url, $this->getFormat($request), $this->getPassword($request) ); return $response->withJson($this->video->getJson()); } catch (InvalidURLException $e) { return $response->withJson(['error' => $e->getMessage()]) ->withStatus(StatusCode::HTTP_BAD_REQUEST); } } }