From 8e6c5c4b8f59e9874aa99bb5db5de8f521de0ab3 Mon Sep 17 00:00:00 2001 From: horus Date: Fri, 18 Sep 2020 21:27:29 +0200 Subject: camo the images --- app/helpers.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/helpers.php') diff --git a/app/helpers.php b/app/helpers.php index 9d1586c..4c946f7 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -116,3 +116,15 @@ function getSeasonFromDate($aired_at) { return array("name" => getSeason($aired_from->month), "year" => $aired_from->year); } + +function camo($url) { + if ( "" != env("GOCAMO_HMAC") && "" != env("GOCAMO_URL") ) { + $phpamo = new \WillWashburn\Phpamo\Phpamo( + env("GOCAMO_HMAC"), + env("GOCAMO_URL") + ); + return $phpamo->camo($url); + } + + return $url; +} -- cgit v1.2.3