lib/domains/vimeo.com.js
async function vimeo_fetcher(env) {
      tpl.query.url = env.src;

      let response;

      try {
        response = await env.self.request(url.format(tpl));
      } catch (err) {
        if (err.statusCode) {
          throw new EmbedzaError(
            `Vimeo fetcher: Bad response code: ${err.statusCode}`,
            'EHTTP',
            err.statusCode);
        }
        throw err;
      }

      // that should not happen
      /* istanbul ignore next */
      if (response.statusCode !== 200) {
        throw new EmbedzaError(
          `Vimeo fetcher: Bad response code: ${response.statusCode}`,
          'EHTTP',
          response.statusCode);
      }

      try {
        env.data.oembed = JSON.parse(response.body);
      } catch (__) {
        throw new EmbedzaError(
          "Vimeo fetcher: Can't parse oembed JSON response",
          'ECONTENT');
      }
    }
async function vimeo_fetcher(env) {
      tpl.query.url = env.src;

      let response;

      try {
        response = await env.self.request(url.format(tpl));
      } catch (err) {
        if (err.statusCode) {
          throw new EmbedzaError(
            `Vimeo fetcher: Bad response code: ${err.statusCode}`,
            'EHTTP',
            err.statusCode);
        }
        throw err;
      }

      // that should not happen
      /* istanbul ignore next */
      if (response.statusCode !== 200) {
        throw new EmbedzaError(
          `Vimeo fetcher: Bad response code: ${response.statusCode}`,
          'EHTTP',
          response.statusCode);
      }

      try {
        env.data.oembed = JSON.parse(response.body);
      } catch (__) {
        throw new EmbedzaError(
          "Vimeo fetcher: Can't parse oembed JSON response",
          'ECONTENT');
      }
    }
async function vimeo_fetcher ( env ) { tpl . query . url = env . src ; let response ; try { response = await env . self . request ( url . format ( tpl ) ) ; } catch ( err ) { if ( err . statusCode ) { throw new EmbedzaError ( ` ${ err . statusCode } ` , 'EHTTP' , err . statusCode ) ; } throw err ; } // that should not happen /* istanbul ignore next */ if ( response . statusCode !== 200 ) { throw new EmbedzaError ( ` ${ response . statusCode } ` , 'EHTTP' , response . statusCode ) ; } try { env . data . oembed = JSON . parse ( response . body ) ; } catch ( __ ) { throw new EmbedzaError ( "Vimeo fetcher: Can't parse oembed JSON response" , 'ECONTENT' ) ; } }
Add a custom fetcher that retrieves only oembed data using a hardcoded endpoint.  The reason being that we have quite a lot of vimeo videos, and fetching html page for each of them triggers a temporary 1-day ip+user-agent ban with 429 status code.  This way fetcher misses out on favicon and flashplayer urls, but this data is not necessary to generate embedded videos with the templates we have now.
Add a custom fetcher that retrieves only oembed data using a hardcoded endpoint . The reason being that we have quite a lot of vimeo videos and fetching html page for each of them triggers a temporary 1 - day ip + user - agent ban with 429 status code . This way fetcher misses out on favicon and flashplayer urls but this data is not necessary to generate embedded videos with the templates we have now .