node-csfd-api 2.4.1 → 2.4.3
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/helpers/creator.helper.js +2 -1
- package/helpers/movie.helper.js +13 -10
- package/package.json +2 -2
|
@@ -56,7 +56,8 @@ const parseBirthPlace = (text) => {
|
|
|
56
56
|
};
|
|
57
57
|
exports.parseBirthPlace = parseBirthPlace;
|
|
58
58
|
const getFilms = (el) => {
|
|
59
|
-
|
|
59
|
+
var _a;
|
|
60
|
+
const filmNodes = (_a = el.querySelectorAll('.box')[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll('table tr');
|
|
60
61
|
let yearCache;
|
|
61
62
|
const films = filmNodes.map((filmNode) => {
|
|
62
63
|
var _a, _b, _c;
|
package/helpers/movie.helper.js
CHANGED
|
@@ -223,17 +223,20 @@ const getBoxMovies = (el, boxName) => {
|
|
|
223
223
|
};
|
|
224
224
|
exports.getBoxMovies = getBoxMovies;
|
|
225
225
|
const getPremieres = (el) => {
|
|
226
|
-
var _a;
|
|
227
|
-
const
|
|
226
|
+
var _a, _b;
|
|
227
|
+
const premiereNodes = el.querySelectorAll('.box-premieres li');
|
|
228
228
|
const premiere = [];
|
|
229
|
-
for (const premiereNode of
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
229
|
+
for (const premiereNode of premiereNodes) {
|
|
230
|
+
const title = premiereNode.querySelector('p + span').attributes.title;
|
|
231
|
+
if (title) {
|
|
232
|
+
const [date, ...company] = title === null || title === void 0 ? void 0 : title.split(' ');
|
|
233
|
+
premiere.push({
|
|
234
|
+
country: ((_a = premiereNode.querySelector('.flag')) === null || _a === void 0 ? void 0 : _a.attributes.title) || null,
|
|
235
|
+
format: (_b = premiereNode.querySelector('p').textContent.trim()) === null || _b === void 0 ? void 0 : _b.split(' od')[0],
|
|
236
|
+
date,
|
|
237
|
+
company: company.join(' ')
|
|
238
|
+
});
|
|
239
|
+
}
|
|
237
240
|
}
|
|
238
241
|
return premiere;
|
|
239
242
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-csfd-api",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
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>",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"cross-fetch": "^3.1.5",
|
|
26
|
-
"node-html-parser": "^
|
|
26
|
+
"node-html-parser": "^6.1.1"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
29
29
|
"url": "git+https://github.com/bartholomej/node-csfd-api.git",
|