node-csfd-api 2.14.1 → 2.14.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.
@@ -1,14 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getUserUrl = exports.getAvatar = exports.getUserRealName = exports.getUser = void 0;
4
+ const node_html_parser_1 = require("node-html-parser");
4
5
  const global_helper_1 = require("./global.helper");
5
6
  const getUser = (el) => {
6
7
  return el.querySelector('.user-title-name').text;
7
8
  };
8
9
  exports.getUser = getUser;
9
10
  const getUserRealName = (el) => {
10
- var _a;
11
- return ((_a = el.querySelector('.user-real-name')) === null || _a === void 0 ? void 0 : _a.text.trim()) || null;
11
+ const p = el.querySelector('.article-content p');
12
+ if (!p)
13
+ return null;
14
+ const textNodes = p.childNodes.filter(n => n.nodeType === node_html_parser_1.NodeType.TEXT_NODE && n.rawText.trim() !== '');
15
+ const name = textNodes.length ? textNodes[0].rawText.trim() : null;
16
+ return name;
12
17
  };
13
18
  exports.getUserRealName = getUserRealName;
14
19
  const getAvatar = (el) => {
@@ -17,7 +17,7 @@ export interface CSFDMovie extends CSFDScreening {
17
17
  related: CSFDMovieListItem[];
18
18
  similar: CSFDMovieListItem[];
19
19
  }
20
- export type CSFDVodService = 'Netflix' | 'hbogo' | 'Prime Video' | 'Apple TV+' | 'iTunes' | 'KVIFF.TV' | 'Edisonline' | 'o2tv' | 'SledovaniTV' | 'Starmax' | 'DAFilms' | 'FILMY ČESKY A ZADARMO' | 'Youtube Česká filmová klasika' | 'VAPET' | 'VOREL FILM' | 'ivysilani' | 'Google Play' | 'Voyo' | 'DVD';
20
+ export type CSFDVodService = 'Netflix' | 'hbogo' | 'Prime Video' | 'Apple TV+' | 'iTunes' | 'KVIFF.TV' | 'Edisonline' | 'o2tv' | 'SledovaniTV' | 'Starmax' | 'DAFilms' | 'FILMY ČESKY A ZADARMO' | 'Youtube Česká filmová klasika' | 'VAPET' | 'VOREL FILM' | 'ivysilani' | 'Google Play' | 'Voyo' | 'YouTube Movies' | 'prima+' | 'Lepší.TV' | 'Blu-ray' | 'DVD';
21
21
  export interface CSFDVod {
22
22
  title: CSFDVodService;
23
23
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-csfd-api",
3
- "version": "2.14.1",
3
+ "version": "2.14.2",
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>",