if format.nil? || format == :json
        provider_endpoint ||= /<link[^>]*href=['"]*([^\s'"]+)['"]*[^>]*application\/json\+oembed[^>]*>/.match(res)[1] rescue nil
        provider_endpoint ||= /<link[^>]*application\/json\+oembed[^>]*href=['"]*([^\s'"]+)['"]*[^>]*>/.match(res)[1] rescue nil
        format ||= :json if provider_endpoint
      end