protected static function getEndPointFromRequest(Request $request, array $config)
    {
        //Search the oembed provider using the domain
        $class = self::getClassFromRequest($request);

        if (class_exists($class) && $request->match($class::getPatterns())) {
            return [
                'endPoint' => $class::getEndpoint(),
                'params' => $class::getParams($request),
            ];
        }

        //Search using embedly
        if (!empty($config['embedlyKey']) && $request->match(OEmbed\Embedly::getPatterns())) {
            return [
                'endPoint' => OEmbed\Embedly::getEndpoint(),
                'params' => OEmbed\Embedly::getParams($request) + ['key' => $config['embedlyKey']],
            ];
        }
    }