node-csfd-api 2.7.11 → 2.8.0

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.
package/README.md CHANGED
@@ -3,14 +3,14 @@
3
3
  [![Build & Publish](https://github.com/bartholomej/node-csfd-api/workflows/Publish/badge.svg)](https://github.com/bartholomej/node-csfd-api/actions)
4
4
  [![codecov](https://codecov.io/gh/bartholomej/node-csfd-api/branch/master/graph/badge.svg?token=YQH9UoVrGP)](https://codecov.io/gh/bartholomej/node-csfd-api)
5
5
 
6
- # CSFD API 🎥 2024
6
+ # CSFD API 🎥 2025
7
7
 
8
8
  > JavaScript NPM library for scraping **Czech Movie Database (csfd.cz)**
9
9
  >
10
10
  > - JavaScript / TypeScript
11
11
  > - Browser + Node.js (SSR)
12
12
  > - Tested (~100% Code coverage)
13
- > - ✅ Ready for new ČSFD 2024!
13
+ > - ✅ Ready for new ČSFD 2025!
14
14
  > - You can use in:
15
15
  > - Firebase function
16
16
  > - AWS λ (lambda function)
@@ -463,7 +463,7 @@ That's why, with node-csfd-api, what happens on your device stays on your device
463
463
 
464
464
  ## 📝 License
465
465
 
466
- Copyright © 2020 – 2024 [Lukas Bartak](http://bartweb.cz)
466
+ Copyright © 2020 – 2025 [Lukas Bartak](http://bartweb.cz)
467
467
 
468
468
  Proudly powered by nature 🗻, wind 💨, tea 🍵 and beer 🍺 ;)
469
469
 
@@ -18,19 +18,19 @@ const getName = (el) => {
18
18
  };
19
19
  exports.getName = getName;
20
20
  const getBirthdayInfo = (el) => {
21
- const text = el.querySelector('h1 + p').innerHTML.trim();
22
- const parts = text.split('\n');
23
- let birthday;
24
- let age;
25
- let birthPlace;
26
- if (parts.length) {
21
+ var _a, _b;
22
+ const infoBlock = el.querySelector('h1 + p');
23
+ const text = infoBlock === null || infoBlock === void 0 ? void 0 : infoBlock.innerHTML.trim();
24
+ const birthPlaceRow = (_a = infoBlock === null || infoBlock === void 0 ? void 0 : infoBlock.querySelector('.info-place')) === null || _a === void 0 ? void 0 : _a.innerHTML.trim();
25
+ const ageRow = (_b = infoBlock === null || infoBlock === void 0 ? void 0 : infoBlock.querySelector('.info')) === null || _b === void 0 ? void 0 : _b.innerHTML.trim();
26
+ let birthday = '';
27
+ if (text) {
28
+ const parts = text.split('\n');
27
29
  const birthdayRow = parts.find((x) => x.includes('nar.'));
28
- const ageRow = parts.find((x) => x.includes('let)'));
29
- const birthPlaceRow = parts.find((x) => x.includes('<br>')); // Ugly but there is no other way to detect
30
30
  birthday = birthdayRow ? (0, exports.parseBirthday)(birthdayRow) : '';
31
- age = ageRow ? +(0, exports.parseAge)(ageRow) : null;
32
- birthPlace = birthPlaceRow ? (0, exports.parseBirthPlace)(birthPlaceRow) : '';
33
31
  }
32
+ const age = ageRow ? +(0, exports.parseAge)(ageRow) : null;
33
+ const birthPlace = birthPlaceRow ? (0, exports.parseBirthPlace)(birthPlaceRow) : '';
34
34
  return { birthday, age, birthPlace };
35
35
  };
36
36
  exports.getBirthdayInfo = getBirthdayInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-csfd-api",
3
- "version": "2.7.11",
3
+ "version": "2.8.0",
4
4
  "description": "ČSFD API in JavaScript. Amazing NPM library for scrapping csfd.cz :)",
5
5
  "main": "./index.js",
6
6
  "author": "BART! <bart@bartweb.cz>",