stormcloud-video-player 0.7.28 → 0.7.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5796,7 +5796,7 @@ function parseRSSXml(xmlText, maxItems) {
5796
5796
  }
5797
5797
  function fetchRSSItems(rssUrl, maxItems) {
5798
5798
  return _async_to_generator(function() {
5799
- var encoded, resp2, data, unused, resp21, text2, unused1, resp, text;
5799
+ var encoded, origin, resp, text, unused, resp1, data, unused1, resp2, text1, unused2;
5800
5800
  return _ts_generator(this, function(_state) {
5801
5801
  switch(_state.label){
5802
5802
  case 0:
@@ -5809,25 +5809,26 @@ function fetchRSSItems(rssUrl, maxItems) {
5809
5809
  ,
5810
5810
  6
5811
5811
  ]);
5812
+ origin = typeof window !== "undefined" ? window.location.origin : "";
5812
5813
  return [
5813
5814
  4,
5814
- fetch("https://api.allorigins.win/get?url=".concat(encoded))
5815
+ fetch("".concat(origin, "/api/rss-proxy?url=").concat(encoded))
5815
5816
  ];
5816
5817
  case 2:
5817
- resp2 = _state.sent();
5818
- if (!resp2.ok) return [
5818
+ resp = _state.sent();
5819
+ if (!resp.ok) return [
5819
5820
  3,
5820
5821
  4
5821
5822
  ];
5822
5823
  return [
5823
5824
  4,
5824
- resp2.json()
5825
+ resp.text()
5825
5826
  ];
5826
5827
  case 3:
5827
- data = _state.sent();
5828
- if (data.contents) return [
5828
+ text = _state.sent();
5829
+ if (text.includes("<item")) return [
5829
5830
  2,
5830
- parseRSSXml(data.contents, maxItems)
5831
+ parseRSSXml(text, maxItems)
5831
5832
  ];
5832
5833
  _state.label = 4;
5833
5834
  case 4:
@@ -5850,23 +5851,23 @@ function fetchRSSItems(rssUrl, maxItems) {
5850
5851
  ]);
5851
5852
  return [
5852
5853
  4,
5853
- fetch("https://corsproxy.io/?url=".concat(encoded))
5854
+ fetch("https://api.allorigins.win/get?url=".concat(encoded))
5854
5855
  ];
5855
5856
  case 7:
5856
- resp21 = _state.sent();
5857
- if (!resp21.ok) return [
5857
+ resp1 = _state.sent();
5858
+ if (!resp1.ok) return [
5858
5859
  3,
5859
5860
  9
5860
5861
  ];
5861
5862
  return [
5862
5863
  4,
5863
- resp21.text()
5864
+ resp1.json()
5864
5865
  ];
5865
5866
  case 8:
5866
- text2 = _state.sent();
5867
- if (text2) return [
5867
+ data = _state.sent();
5868
+ if (data.contents) return [
5868
5869
  2,
5869
- parseRSSXml(text2, maxItems)
5870
+ parseRSSXml(data.contents, maxItems)
5870
5871
  ];
5871
5872
  _state.label = 9;
5872
5873
  case 9:
@@ -5881,23 +5882,46 @@ function fetchRSSItems(rssUrl, maxItems) {
5881
5882
  11
5882
5883
  ];
5883
5884
  case 11:
5885
+ _state.trys.push([
5886
+ 11,
5887
+ 15,
5888
+ ,
5889
+ 16
5890
+ ]);
5884
5891
  return [
5885
5892
  4,
5886
- fetch("https://thingproxy.freeboard.io/fetch/".concat(rssUrl))
5893
+ fetch("https://corsproxy.io/?url=".concat(encoded))
5887
5894
  ];
5888
5895
  case 12:
5889
- resp = _state.sent();
5890
- if (!resp.ok) throw new Error("RSS fetch failed: ".concat(resp.status));
5896
+ resp2 = _state.sent();
5897
+ if (!resp2.ok) return [
5898
+ 3,
5899
+ 14
5900
+ ];
5891
5901
  return [
5892
5902
  4,
5893
- resp.text()
5903
+ resp2.text()
5894
5904
  ];
5895
5905
  case 13:
5896
- text = _state.sent();
5897
- return [
5906
+ text1 = _state.sent();
5907
+ if (text1) return [
5898
5908
  2,
5899
- parseRSSXml(text, maxItems)
5909
+ parseRSSXml(text1, maxItems)
5910
+ ];
5911
+ _state.label = 14;
5912
+ case 14:
5913
+ return [
5914
+ 3,
5915
+ 16
5916
+ ];
5917
+ case 15:
5918
+ unused2 = _state.sent();
5919
+ return [
5920
+ 3,
5921
+ 16
5900
5922
  ];
5923
+ case 16:
5924
+ throw new Error("All RSS proxies failed");
5901
5925
  }
5902
5926
  });
5903
5927
  })();