node-csfd-api 1.10.1 → 1.10.2

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.
@@ -91,13 +91,18 @@ const getPoster = (el) => {
91
91
  var _a;
92
92
  const poster = el.querySelector('.film-posters img');
93
93
  // Resolve empty image
94
- if ((_a = poster.classNames) === null || _a === void 0 ? void 0 : _a.includes('empty-image')) {
95
- return null;
94
+ if (poster) {
95
+ if ((_a = poster.classNames) === null || _a === void 0 ? void 0 : _a.includes('empty-image')) {
96
+ return null;
97
+ }
98
+ else {
99
+ // Full sized image (not thumb)
100
+ const imageThumb = poster.attributes.src.split('?')[0];
101
+ return imageThumb.replace(/\/w140\//, '/w1080/');
102
+ }
96
103
  }
97
104
  else {
98
- // Full sized image (not thumb)
99
- const imageThumb = poster.attributes.src.split('?')[0];
100
- return imageThumb.replace(/\/w140\//, '/w1080/');
105
+ return null;
101
106
  }
102
107
  };
103
108
  exports.getPoster = getPoster;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-csfd-api",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "description": "Simple NPM library for scraping CSFD",
5
5
  "main": "./index.js",
6
6
  "author": "BART! <bart@bartweb.cz>",