node-csfd-api-racintom 1.7.0 → 1.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.
Files changed (111) hide show
  1. package/.editorconfig +13 -0
  2. package/.eslintrc.json +33 -0
  3. package/.gitattributes +2 -0
  4. package/.github/FUNDING.yml +8 -0
  5. package/.github/pull_request_template.md +19 -0
  6. package/.github/workflows/main.yml +40 -0
  7. package/.github/workflows/publish.yml +73 -0
  8. package/.github/workflows/test.yml +43 -0
  9. package/.husky/pre-commit +1 -0
  10. package/.idea/codeStyles/Project.xml +72 -0
  11. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  12. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  13. package/.idea/misc.xml +6 -0
  14. package/.idea/modules.xml +8 -0
  15. package/.idea/node-csfd-api.iml +9 -0
  16. package/.idea/prettier.xml +6 -0
  17. package/.idea/vcs.xml +7 -0
  18. package/.nvmrc +1 -0
  19. package/.prettierignore +8 -0
  20. package/.prettierrc +10 -0
  21. package/.vscode/settings.json +16 -0
  22. package/Dockerfile +19 -0
  23. package/demo.ts +35 -0
  24. package/eslint.config.mjs +55 -0
  25. package/package.json +86 -62
  26. package/server.ts +66 -0
  27. package/src/fetchers/fetch.polyfill.ts +7 -0
  28. package/src/fetchers/index.ts +25 -0
  29. package/src/helpers/creator.helper.ts +95 -0
  30. package/src/helpers/global.helper.ts +70 -0
  31. package/src/helpers/movie.helper.ts +276 -0
  32. package/src/helpers/search-user.helper.ts +19 -0
  33. package/src/helpers/search.helper.ts +66 -0
  34. package/src/helpers/user-ratings.helper.ts +62 -0
  35. package/src/index.ts +50 -0
  36. package/src/interfaces/creator.interface.ts +14 -0
  37. package/src/interfaces/global.ts +36 -0
  38. package/src/interfaces/movie.interface.ts +157 -0
  39. package/src/interfaces/search.interface.ts +32 -0
  40. package/src/interfaces/season.interface.ts +12 -0
  41. package/src/interfaces/user-ratings.interface.ts +21 -0
  42. package/src/services/creator.service.ts +34 -0
  43. package/src/services/movie.service.ts +89 -0
  44. package/src/services/search.service.ts +101 -0
  45. package/src/services/season.service.ts +55 -0
  46. package/src/services/user-ratings.service.ts +106 -0
  47. package/src/vars.ts +16 -0
  48. package/tests/creator.test.ts +182 -0
  49. package/tests/fetchers.test.ts +109 -0
  50. package/tests/global.test.ts +35 -0
  51. package/tests/helpers.test.ts +59 -0
  52. package/tests/mocks/creator-actor.html.ts +2244 -0
  53. package/tests/mocks/creator-composer-empty.html.ts +683 -0
  54. package/tests/mocks/creator-director.html.ts +3407 -0
  55. package/tests/mocks/movie1.html.ts +1430 -0
  56. package/tests/mocks/movie2.html.ts +740 -0
  57. package/tests/mocks/movie3.html.ts +1843 -0
  58. package/tests/mocks/movie4.html.ts +1568 -0
  59. package/tests/mocks/search.html.ts +838 -0
  60. package/tests/mocks/series1.html.ts +1540 -0
  61. package/tests/mocks/userRatings.html.ts +1354 -0
  62. package/tests/movie.test.ts +606 -0
  63. package/tests/search.test.ts +379 -0
  64. package/tests/season.test.ts +115 -0
  65. package/tests/services.test.ts +106 -0
  66. package/tests/user-ratings.test.ts +142 -0
  67. package/tests/vars.test.ts +34 -0
  68. package/tsconfig.json +23 -0
  69. package/vitest.config.mts +10 -0
  70. package/fetchers/fetch.polyfill.d.ts +0 -1
  71. package/fetchers/fetch.polyfill.js +0 -9
  72. package/fetchers/index.d.ts +0 -1
  73. package/fetchers/index.js +0 -27
  74. package/helpers/creator.helper.d.ts +0 -17
  75. package/helpers/creator.helper.js +0 -87
  76. package/helpers/global.helper.d.ts +0 -17
  77. package/helpers/global.helper.js +0 -68
  78. package/helpers/movie.helper.d.ts +0 -26
  79. package/helpers/movie.helper.js +0 -270
  80. package/helpers/search-user.helper.d.ts +0 -5
  81. package/helpers/search-user.helper.js +0 -22
  82. package/helpers/search.helper.d.ts +0 -11
  83. package/helpers/search.helper.js +0 -62
  84. package/helpers/user-ratings.helper.d.ts +0 -13
  85. package/helpers/user-ratings.helper.js +0 -61
  86. package/index.d.ts +0 -24
  87. package/index.js +0 -39
  88. package/interfaces/creator.interface.d.ts +0 -12
  89. package/interfaces/creator.interface.js +0 -2
  90. package/interfaces/global.d.ts +0 -22
  91. package/interfaces/global.js +0 -2
  92. package/interfaces/movie.interface.d.ts +0 -73
  93. package/interfaces/movie.interface.js +0 -2
  94. package/interfaces/search.interface.d.ts +0 -27
  95. package/interfaces/search.interface.js +0 -2
  96. package/interfaces/season.interface.d.ts +0 -11
  97. package/interfaces/season.interface.js +0 -2
  98. package/interfaces/user-ratings.interface.d.ts +0 -18
  99. package/interfaces/user-ratings.interface.js +0 -2
  100. package/services/creator.service.d.ts +0 -6
  101. package/services/creator.service.js +0 -32
  102. package/services/movie.service.d.ts +0 -6
  103. package/services/movie.service.js +0 -59
  104. package/services/search.service.d.ts +0 -5
  105. package/services/search.service.js +0 -80
  106. package/services/season.service.d.ts +0 -9
  107. package/services/season.service.js +0 -42
  108. package/services/user-ratings.service.d.ts +0 -7
  109. package/services/user-ratings.service.js +0 -84
  110. package/vars.d.ts +0 -5
  111. package/vars.js +0 -13
@@ -1,11 +0,0 @@
1
- export type CSFDSeason = {
2
- description: string;
3
- thumbnail: string;
4
- episodeList: CSFDEpisodeInfo[];
5
- origin: string;
6
- };
7
- export type CSFDEpisodeInfo = {
8
- name: string;
9
- seasonEpisodeIdentifier: string;
10
- linkToDetail: string;
11
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,18 +0,0 @@
1
- import { CSFDFilmTypes, CSFDScreening, CSFDStars } from './global';
2
- export interface CSFDUserRatings extends CSFDScreening {
3
- userRating: CSFDStars;
4
- userDate: string;
5
- }
6
- export interface CSFDUserRatingConfig {
7
- includesOnly?: CSFDFilmTypes[];
8
- excludes?: CSFDFilmTypes[];
9
- /**
10
- * Fetch all ratings. (Warning: Use it wisely. Can be detected and banned. Consider using it together with `allPagesDelay` attribute)
11
- */
12
- allPages?: boolean;
13
- /**
14
- * Delay on each page request. In milliseconds
15
- */
16
- allPagesDelay?: number;
17
- }
18
- export type Colors = 'lightgrey' | 'blue' | 'red' | 'grey';
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- import { CSFDCreator } from '../interfaces/creator.interface';
2
- export declare class CreatorScraper {
3
- private person;
4
- creator(creatorId: number): Promise<CSFDCreator>;
5
- private buildCreator;
6
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreatorScraper = void 0;
4
- const node_html_parser_1 = require("node-html-parser");
5
- const fetchers_1 = require("../fetchers");
6
- const creator_helper_1 = require("../helpers/creator.helper");
7
- const vars_1 = require("../vars");
8
- class CreatorScraper {
9
- async creator(creatorId) {
10
- const url = (0, vars_1.creatorUrl)(+creatorId);
11
- const response = await (0, fetchers_1.fetchPage)(url);
12
- const creatorHtml = (0, node_html_parser_1.parse)(response);
13
- const asideNode = creatorHtml.querySelector('.creator-about');
14
- const filmsNode = creatorHtml.querySelector('.creator-filmography');
15
- this.buildCreator(+creatorId, asideNode, filmsNode);
16
- return this.person;
17
- }
18
- buildCreator(id, asideEl, filmsNode) {
19
- var _a, _b, _c;
20
- this.person = {
21
- id,
22
- name: (0, creator_helper_1.getName)(asideEl),
23
- birthday: (_a = (0, creator_helper_1.getBirthdayInfo)(asideEl)) === null || _a === void 0 ? void 0 : _a.birthday,
24
- birthplace: (_b = (0, creator_helper_1.getBirthdayInfo)(asideEl)) === null || _b === void 0 ? void 0 : _b.birthPlace,
25
- photo: (0, creator_helper_1.getPhoto)(asideEl),
26
- age: ((_c = (0, creator_helper_1.getBirthdayInfo)(asideEl)) === null || _c === void 0 ? void 0 : _c.age) || null,
27
- bio: (0, creator_helper_1.getBio)(asideEl),
28
- films: (0, creator_helper_1.getFilms)(filmsNode)
29
- };
30
- }
31
- }
32
- exports.CreatorScraper = CreatorScraper;
@@ -1,6 +0,0 @@
1
- import { CSFDMovie } from '../interfaces/movie.interface';
2
- export declare class MovieScraper {
3
- private film;
4
- movie(movieId: number): Promise<CSFDMovie>;
5
- private buildMovie;
6
- }
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MovieScraper = void 0;
4
- const node_html_parser_1 = require("node-html-parser");
5
- const fetchers_1 = require("../fetchers");
6
- const movie_helper_1 = require("../helpers/movie.helper");
7
- const vars_1 = require("../vars");
8
- class MovieScraper {
9
- async movie(movieId) {
10
- const url = (0, vars_1.movieUrl)(+movieId);
11
- const response = await (0, fetchers_1.fetchPage)(url);
12
- const movieHtml = (0, node_html_parser_1.parse)(response);
13
- const pageClasses = movieHtml.querySelector('.page-content').classNames.split(' ');
14
- const asideNode = movieHtml.querySelector('.aside-movie-profile');
15
- const movieNode = movieHtml.querySelector('.main-movie-profile');
16
- const jsonLd = movieHtml.querySelector('script[type="application/ld+json"]').innerText;
17
- this.buildMovie(+movieId, movieNode, asideNode, pageClasses, jsonLd);
18
- return this.film;
19
- }
20
- buildMovie(movieId, el, asideEl, pageClasses, jsonLd) {
21
- this.film = {
22
- id: movieId,
23
- title: (0, movie_helper_1.getTitle)(el),
24
- year: (0, movie_helper_1.getYear)(jsonLd),
25
- duration: (0, movie_helper_1.getDuration)(jsonLd, el),
26
- descriptions: (0, movie_helper_1.getDescriptions)(el),
27
- genres: (0, movie_helper_1.getGenres)(el),
28
- type: (0, movie_helper_1.getType)(el),
29
- url: (0, vars_1.movieUrl)(movieId),
30
- origins: (0, movie_helper_1.getOrigins)(el),
31
- colorRating: (0, movie_helper_1.getColorRating)(pageClasses),
32
- rating: (0, movie_helper_1.getRating)(asideEl),
33
- ratingCount: (0, movie_helper_1.getRatingCount)(asideEl),
34
- titlesOther: (0, movie_helper_1.getTitlesOther)(el),
35
- poster: (0, movie_helper_1.getPoster)(el),
36
- photo: (0, movie_helper_1.getRandomPhoto)(el),
37
- trivia: (0, movie_helper_1.getTrivia)(el),
38
- creators: {
39
- directors: (0, movie_helper_1.getGroup)(el, 'Režie'),
40
- writers: (0, movie_helper_1.getGroup)(el, 'Scénář'),
41
- cinematography: (0, movie_helper_1.getGroup)(el, 'Kamera'),
42
- music: (0, movie_helper_1.getGroup)(el, 'Hudba'),
43
- actors: (0, movie_helper_1.getGroup)(el, 'Hrají'),
44
- basedOn: (0, movie_helper_1.getGroup)(el, 'Předloha'),
45
- producers: (0, movie_helper_1.getGroup)(el, 'Produkce'),
46
- filmEditing: (0, movie_helper_1.getGroup)(el, 'Střih'),
47
- costumeDesign: (0, movie_helper_1.getGroup)(el, 'Kostýmy'),
48
- productionDesign: (0, movie_helper_1.getGroup)(el, 'Scénografie')
49
- },
50
- vod: (0, movie_helper_1.getVods)(asideEl),
51
- tags: (0, movie_helper_1.getTags)(asideEl),
52
- premieres: (0, movie_helper_1.getPremieres)(asideEl),
53
- related: (0, movie_helper_1.getBoxMovies)(asideEl, 'Související'),
54
- similar: (0, movie_helper_1.getBoxMovies)(asideEl, 'Podobné'),
55
- seasons: (0, movie_helper_1.getSeasonsInfo)(el)
56
- };
57
- }
58
- }
59
- exports.MovieScraper = MovieScraper;
@@ -1,5 +0,0 @@
1
- import { CSFDSearch } from '../interfaces/search.interface';
2
- export declare class SearchScraper {
3
- search(text: string): Promise<CSFDSearch>;
4
- private parseSearch;
5
- }
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchScraper = void 0;
4
- const node_html_parser_1 = require("node-html-parser");
5
- const fetchers_1 = require("../fetchers");
6
- const global_helper_1 = require("../helpers/global.helper");
7
- const search_user_helper_1 = require("../helpers/search-user.helper");
8
- const search_helper_1 = require("../helpers/search.helper");
9
- const vars_1 = require("../vars");
10
- class SearchScraper {
11
- async search(text) {
12
- const url = (0, vars_1.searchUrl)(text);
13
- const response = await (0, fetchers_1.fetchPage)(url);
14
- const html = (0, node_html_parser_1.parse)(response);
15
- const moviesNode = html.querySelectorAll('.main-movies article');
16
- const usersNode = html.querySelectorAll('.main-users article');
17
- const tvSeriesNode = html.querySelectorAll('.main-series article');
18
- return this.parseSearch(moviesNode, usersNode, tvSeriesNode);
19
- }
20
- parseSearch(moviesNode, usersNode, tvSeriesNode) {
21
- const movies = [];
22
- const users = [];
23
- const tvSeries = [];
24
- moviesNode.map((m) => {
25
- const url = (0, search_helper_1.getUrl)(m);
26
- const movie = {
27
- id: (0, global_helper_1.parseIdFromUrl)(url),
28
- title: (0, search_helper_1.getTitle)(m),
29
- year: (0, search_helper_1.getYear)(m),
30
- url: `https://www.csfd.cz${url}`,
31
- type: (0, search_helper_1.getType)(m),
32
- colorRating: (0, search_helper_1.getColorRating)(m),
33
- poster: (0, search_helper_1.getPoster)(m),
34
- origins: (0, search_helper_1.getOrigins)(m),
35
- creators: {
36
- directors: (0, search_helper_1.parsePeople)(m, 'directors'),
37
- actors: (0, search_helper_1.parsePeople)(m, 'actors')
38
- }
39
- };
40
- movies.push(movie);
41
- });
42
- usersNode.map((m) => {
43
- const url = (0, search_user_helper_1.getUserUrl)(m);
44
- const user = {
45
- id: (0, global_helper_1.parseIdFromUrl)(url),
46
- user: (0, search_user_helper_1.getUser)(m),
47
- userRealName: (0, search_user_helper_1.getUserRealName)(m),
48
- avatar: (0, search_user_helper_1.getAvatar)(m),
49
- url: `https://www.csfd.cz${url}`
50
- };
51
- users.push(user);
52
- });
53
- tvSeriesNode.map((m) => {
54
- const url = (0, search_helper_1.getUrl)(m);
55
- const user = {
56
- id: (0, global_helper_1.parseIdFromUrl)(url),
57
- title: (0, search_helper_1.getTitle)(m),
58
- year: (0, search_helper_1.getYear)(m),
59
- url: `https://www.csfd.cz${url}`,
60
- type: (0, search_helper_1.getType)(m),
61
- colorRating: (0, search_helper_1.getColorRating)(m),
62
- poster: (0, search_helper_1.getPoster)(m),
63
- origins: (0, search_helper_1.getOrigins)(m),
64
- creators: {
65
- directors: (0, search_helper_1.parsePeople)(m, 'directors'),
66
- actors: (0, search_helper_1.parsePeople)(m, 'actors')
67
- }
68
- };
69
- tvSeries.push(user);
70
- });
71
- const search = {
72
- movies: movies,
73
- users: users,
74
- tvSeries: tvSeries,
75
- creators: []
76
- };
77
- return search;
78
- }
79
- }
80
- exports.SearchScraper = SearchScraper;
@@ -1,9 +0,0 @@
1
- import { CSFDSeason } from '../interfaces/season.interface';
2
- export declare class SeasonScraper {
3
- season(url: string): Promise<CSFDSeason>;
4
- private buildSeason;
5
- private getOriginFromHtml;
6
- private getDescriptionFromHtml;
7
- private getThumbnailFromHtml;
8
- private getEpisodeListFromHtml;
9
- }
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SeasonScraper = void 0;
4
- const fetchers_1 = require("../fetchers");
5
- const node_html_parser_1 = require("node-html-parser");
6
- const vars_1 = require("../vars");
7
- class SeasonScraper {
8
- async season(url) {
9
- const response = await (0, fetchers_1.fetchPage)((0, vars_1.seasonUrl)(url));
10
- const seasonHtml = (0, node_html_parser_1.parse)(response);
11
- const movieNode = seasonHtml.querySelector('.main-movie-profile');
12
- return this.buildSeason(movieNode);
13
- }
14
- buildSeason(movieNode) {
15
- return {
16
- origin: this.getOriginFromHtml(movieNode),
17
- description: this.getDescriptionFromHtml(movieNode),
18
- thumbnail: this.getThumbnailFromHtml(movieNode),
19
- episodeList: this.getEpisodeListFromHtml(movieNode),
20
- };
21
- }
22
- getOriginFromHtml(movieNode) {
23
- return movieNode.querySelector('.film-info-content .origin').textContent;
24
- }
25
- getDescriptionFromHtml(movieNode) {
26
- return movieNode.querySelector('.plot-full').textContent;
27
- }
28
- getThumbnailFromHtml(movieNode) {
29
- return movieNode.querySelector('.film-posters img').getAttribute('src');
30
- }
31
- getEpisodeListFromHtml(movieNode) {
32
- return movieNode.querySelectorAll('.film-episodes-list li').map(container => {
33
- const nameContainer = container.querySelector('.film-title-name');
34
- return {
35
- name: nameContainer.textContent,
36
- seasonEpisodeIdentifier: container.querySelector('.film-title-info').textContent,
37
- linkToDetail: nameContainer.getAttribute('href'),
38
- };
39
- });
40
- }
41
- }
42
- exports.SeasonScraper = SeasonScraper;
@@ -1,7 +0,0 @@
1
- import { CSFDUserRatingConfig, CSFDUserRatings } from '../interfaces/user-ratings.interface';
2
- export declare class UserRatingsScraper {
3
- private films;
4
- userRatings(user: string | number, config?: CSFDUserRatingConfig): Promise<CSFDUserRatings[]>;
5
- private getPage;
6
- private buildUserRatings;
7
- }
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserRatingsScraper = void 0;
4
- const node_html_parser_1 = require("node-html-parser");
5
- const fetchers_1 = require("../fetchers");
6
- const user_ratings_helper_1 = require("../helpers/user-ratings.helper");
7
- const vars_1 = require("../vars");
8
- class UserRatingsScraper {
9
- constructor() {
10
- this.films = [];
11
- }
12
- async userRatings(user, config) {
13
- let allMovies = [];
14
- const url = (0, vars_1.userRatingsUrl)(user);
15
- const response = await (0, fetchers_1.fetchPage)(url);
16
- const items = (0, node_html_parser_1.parse)(response);
17
- const movies = items.querySelectorAll('.box-user-rating .table-container tbody tr');
18
- // Get number of pages
19
- const pagesNode = items.querySelector('.pagination');
20
- const pages = +(pagesNode === null || pagesNode === void 0 ? void 0 : pagesNode.childNodes[pagesNode.childNodes.length - 4].rawText) || 1;
21
- allMovies = this.getPage(config, movies);
22
- if (config === null || config === void 0 ? void 0 : config.allPages) {
23
- console.log('User', user, url);
24
- console.log('Fetching all pages', pages);
25
- for (let i = 2; i <= pages; i++) {
26
- console.log('Fetching page', i, 'out of', pages, '...');
27
- const url = (0, vars_1.userRatingsUrl)(user, i);
28
- const response = await (0, fetchers_1.fetchPage)(url);
29
- const items = (0, node_html_parser_1.parse)(response);
30
- const movies = items.querySelectorAll('.box-user-rating .table-container tbody tr');
31
- allMovies = [...this.getPage(config, movies)];
32
- // Sleep
33
- if (config.allPagesDelay) {
34
- await (0, user_ratings_helper_1.sleep)(config.allPagesDelay);
35
- }
36
- }
37
- return allMovies;
38
- }
39
- return allMovies;
40
- }
41
- getPage(config, movies) {
42
- var _a, _b, _c, _d;
43
- if (config) {
44
- if (((_a = config.includesOnly) === null || _a === void 0 ? void 0 : _a.length) && ((_b = config.excludes) === null || _b === void 0 ? void 0 : _b.length)) {
45
- console.warn(`node-csfd-api:
46
- You can not use both parameters 'includesOnly' and 'excludes'.
47
- Parameter 'includesOnly' will be used now:`, config.includesOnly);
48
- }
49
- }
50
- for (const el of movies) {
51
- const type = (0, user_ratings_helper_1.getType)(el);
52
- // Filtering includesOnly
53
- if ((_c = config === null || config === void 0 ? void 0 : config.includesOnly) === null || _c === void 0 ? void 0 : _c.length) {
54
- if (config.includesOnly.some((include) => type === include)) {
55
- this.buildUserRatings(el);
56
- }
57
- // Filter exludes
58
- }
59
- else if ((_d = config === null || config === void 0 ? void 0 : config.excludes) === null || _d === void 0 ? void 0 : _d.length) {
60
- if (!config.excludes.some((exclude) => type === exclude)) {
61
- this.buildUserRatings(el);
62
- }
63
- }
64
- else {
65
- // Without filtering
66
- this.buildUserRatings(el);
67
- }
68
- }
69
- return this.films;
70
- }
71
- buildUserRatings(el) {
72
- this.films.push({
73
- id: (0, user_ratings_helper_1.getId)(el),
74
- title: (0, user_ratings_helper_1.getTitle)(el),
75
- year: (0, user_ratings_helper_1.getYear)(el),
76
- type: (0, user_ratings_helper_1.getType)(el),
77
- url: (0, user_ratings_helper_1.getUrl)(el),
78
- colorRating: (0, user_ratings_helper_1.getColorRating)(el),
79
- userDate: (0, user_ratings_helper_1.getDate)(el),
80
- userRating: (0, user_ratings_helper_1.getUserRating)(el)
81
- });
82
- }
83
- }
84
- exports.UserRatingsScraper = UserRatingsScraper;
package/vars.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export declare const userRatingsUrl: (user: string | number, page?: number) => string;
2
- export declare const movieUrl: (movie: number) => string;
3
- export declare const creatorUrl: (creator: number | string) => string;
4
- export declare const searchUrl: (text: string) => string;
5
- export declare const seasonUrl: (url: string) => string;
package/vars.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.seasonUrl = exports.searchUrl = exports.creatorUrl = exports.movieUrl = exports.userRatingsUrl = void 0;
4
- const userRatingsUrl = (user, page) => `https://www.csfd.cz/uzivatel/${encodeURIComponent(user)}/hodnoceni/${page ? '?page=' + page : ''}`;
5
- exports.userRatingsUrl = userRatingsUrl;
6
- const movieUrl = (movie) => `https://www.csfd.cz/film/${encodeURIComponent(movie)}/prehled/`;
7
- exports.movieUrl = movieUrl;
8
- const creatorUrl = (creator) => `https://www.csfd.cz/tvurce/${encodeURIComponent(creator)}`;
9
- exports.creatorUrl = creatorUrl;
10
- const searchUrl = (text) => `https://www.csfd.cz/hledat/?q=${encodeURIComponent(text)}`;
11
- exports.searchUrl = searchUrl;
12
- const seasonUrl = (url) => `https://www.csfd.cz/${url}`;
13
- exports.seasonUrl = seasonUrl;