проверь код на ошибки и соответствие ES5
  var tmdb_proxy = {
    name: 'TMDB Proxy',
    version: '1.0.1',
    description: 'Проксирование постеров и API сайта TMDB',
    path_image: 'https://apn.ndst.pw/v1?url=https://image.tmdb.org/',
    path_api: 'https://apn.ndst.pw/v1?url=https://api.themoviedb.org/3/',
    stb_path_image: 'https://stream.ndst.pw/tmdb/img/',
    stb_path_api: 'https://apn.ndst.pw/v1?url=https://stream.ndst.pw/tmdb/api/3/'
  };
  //https:// - 8
  function filter_url(u, l) {
    var s = u.slice(0, l);
    var e = u.slice(l).replace(/\/+/g, '/');
    return s + e;
  }
  function checkCorruptUrl(url, type) {
    if (type == "api") {
      var stb = tmdb_proxy.stb_path_api;
    } else {
      if (type == "img") {
        var stb = tmdb_proxy.stb_path_image;
      } else {
        var stb = url
      }
    }
    url = filter_url(url, url.length)
    var xhrC = new XMLHttpRequest();
    xhrC.open('GET', url, true);
    xhrC.timeout = 2000;
    xhrC.onreadystatechange = function () {
      if (xhrC.readyState === 4) {
        if (xhrC.status >= 200 && xhrC.status < 300) {
          return url
        } else {
          return filter_url(stb, stb.length)
        }
      }
    };
    xhrC.ontimeout = function () {
      return filter_url(stb, stb.length)
    };
    xhrC.send();
  }
  Lampa.TMDB.image = function (url) {
    var base = Lampa.Utils.protocol() + ('image.tmdb.org/' + url).replace("//", "/");
    if (url.indexOf("kinopoiskapiunofficial.tech") !== -1) {
      return url.replace('t/p/w500/', '');
    }
    return checkCorruptUrl(Lampa.Storage.field('proxy_tmdb') ? tmdb_proxy.path_image + url : base, "img");
  };
  Lampa.TMDB.api = function (url) {
    var base = Lampa.Utils.protocol() + ('api.themoviedb.org/3/' + url).replace("//", "/");
    if (url.indexOf("apn.ndst.pw") !== -1) {
      var urlStartIndex = url.indexOf('?url=') + '?url='.length;
      var streamUrl = decodeURIComponent(url.substring(urlStartIndex));
      if (streamUrl && streamUrl.indexOf("https://stream.ndst.pw/ndi/aisearch") === 0) {
        var params = streamUrl.split('?')[1];
        if (params) {
          var paramPairs = params.split('&');
          var newParams = [];
          for (var i = 0; i < paramPairs.length; i++) {
            var pair = paramPairs[i];
            var equalIndex = pair.indexOf('=');
            if (equalIndex !== -1) {
              var paramName = decodeURIComponent(pair.substring(0, equalIndex));
              var paramValue = decodeURIComponent(pair.substring(equalIndex + 1));
              if (paramName === 'deviceid' || paramName === 'query') {
                newParams.push(paramName + '=' + paramValue);
              }
            }
          }
          var finalUrl = 'https://apn.ndst.pw/v1?url=https://stream.ndst.pw/ndi/aisearch?' + newParams.join('&');
          return finalUrl;
        }
      }

      return url; // Возврат оригинального URL, если не нашли необходимые параметры
    }
    return checkCorruptUrl(Lampa.Storage.field('proxy_tmdb') ? tmdb_proxy.path_api + url : base, "api");
  }
  Lampa.Settings.listener.follow('open', function (e) {
    if (e.name == 'tmdb') {
      e.body.find('[data-parent="proxy"]').remove();
    }
  });
  console.log('TMDB-Proxy', 'started, enabled:', Lampa.Storage.field('proxy_tmdb'));