feat: Allow Youtube-like URLs

Fixes #184
This commit is contained in:
Pierre Rudloff 2018-08-04 15:46:49 +02:00
parent c5f3d8d1a1
commit b8b6180609
2 changed files with 9 additions and 0 deletions

View file

@ -343,6 +343,11 @@ class FrontController
public function video(Request $request, Response $response)
{
$params = $request->getQueryParams();
if (!isset($params['url']) && isset($params['v'])) {
$params['url'] = $params['v'];
}
if (isset($params['url'])) {
$password = $request->getParam('password');
if (isset($password)) {

View file

@ -47,6 +47,10 @@ $app->any(
'/video',
[$controller, 'video']
)->setName('video');
$app->any(
'/watch',
[$controller, 'video']
);
$app->get(
'/redirect',
[$controller, 'redirect']