node-csfd-api-racintom 1.0.0 → 1.1.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/fetchers/fetch.polyfill.d.ts +1 -0
- package/fetchers/fetch.polyfill.js +9 -0
- package/fetchers/index.d.ts +1 -0
- package/fetchers/index.js +27 -0
- package/helpers/creator.helper.d.ts +17 -0
- package/helpers/creator.helper.js +87 -0
- package/helpers/global.helper.d.ts +17 -0
- package/helpers/global.helper.js +68 -0
- package/helpers/movie.helper.d.ts +26 -0
- package/helpers/movie.helper.js +270 -0
- package/helpers/search-user.helper.d.ts +5 -0
- package/helpers/search-user.helper.js +22 -0
- package/helpers/search.helper.d.ts +11 -0
- package/helpers/search.helper.js +62 -0
- package/helpers/user-ratings.helper.d.ts +13 -0
- package/helpers/user-ratings.helper.js +61 -0
- package/index.d.ts +20 -0
- package/index.js +33 -0
- package/interfaces/creator.interface.d.ts +12 -0
- package/interfaces/creator.interface.js +2 -0
- package/interfaces/global.d.ts +22 -0
- package/interfaces/global.js +2 -0
- package/interfaces/movie.interface.d.ts +73 -0
- package/interfaces/movie.interface.js +2 -0
- package/interfaces/search.interface.d.ts +27 -0
- package/interfaces/search.interface.js +2 -0
- package/interfaces/user-ratings.interface.d.ts +18 -0
- package/interfaces/user-ratings.interface.js +2 -0
- package/package.json +62 -86
- package/services/creator.service.d.ts +6 -0
- package/services/creator.service.js +32 -0
- package/services/movie.service.d.ts +6 -0
- package/services/movie.service.js +59 -0
- package/services/search.service.d.ts +5 -0
- package/services/search.service.js +80 -0
- package/services/user-ratings.service.d.ts +7 -0
- package/services/user-ratings.service.js +84 -0
- package/vars.d.ts +4 -0
- package/vars.js +11 -0
- package/.editorconfig +0 -13
- package/.eslintrc.json +0 -33
- package/.gitattributes +0 -2
- package/.github/FUNDING.yml +0 -8
- package/.github/pull_request_template.md +0 -19
- package/.github/workflows/main.yml +0 -40
- package/.github/workflows/publish.yml +0 -73
- package/.github/workflows/test.yml +0 -43
- package/.husky/pre-commit +0 -1
- package/.idea/codeStyles/Project.xml +0 -72
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/node-csfd-api.iml +0 -9
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -7
- package/.nvmrc +0 -1
- package/.prettierignore +0 -8
- package/.prettierrc +0 -10
- package/.vscode/settings.json +0 -16
- package/Dockerfile +0 -19
- package/demo.ts +0 -35
- package/eslint.config.mjs +0 -55
- package/server.ts +0 -66
- package/src/fetchers/fetch.polyfill.ts +0 -7
- package/src/fetchers/index.ts +0 -25
- package/src/helpers/creator.helper.ts +0 -95
- package/src/helpers/global.helper.ts +0 -70
- package/src/helpers/movie.helper.ts +0 -276
- package/src/helpers/search-user.helper.ts +0 -19
- package/src/helpers/search.helper.ts +0 -66
- package/src/helpers/user-ratings.helper.ts +0 -62
- package/src/index.ts +0 -42
- package/src/interfaces/creator.interface.ts +0 -14
- package/src/interfaces/global.ts +0 -36
- package/src/interfaces/movie.interface.ts +0 -157
- package/src/interfaces/search.interface.ts +0 -32
- package/src/interfaces/user-ratings.interface.ts +0 -21
- package/src/services/creator.service.ts +0 -34
- package/src/services/movie.service.ts +0 -89
- package/src/services/search.service.ts +0 -101
- package/src/services/user-ratings.service.ts +0 -106
- package/src/vars.ts +0 -13
- package/tests/creator.test.ts +0 -182
- package/tests/fetchers.test.ts +0 -109
- package/tests/global.test.ts +0 -35
- package/tests/helpers.test.ts +0 -59
- package/tests/mocks/creator-actor.html.ts +0 -2244
- package/tests/mocks/creator-composer-empty.html.ts +0 -683
- package/tests/mocks/creator-director.html.ts +0 -3407
- package/tests/mocks/movie1.html.ts +0 -1430
- package/tests/mocks/movie2.html.ts +0 -740
- package/tests/mocks/movie3.html.ts +0 -1843
- package/tests/mocks/movie4.html.ts +0 -1568
- package/tests/mocks/search.html.ts +0 -838
- package/tests/mocks/series1.html.ts +0 -1540
- package/tests/mocks/userRatings.html.ts +0 -1354
- package/tests/movie.test.ts +0 -606
- package/tests/search.test.ts +0 -379
- package/tests/services.test.ts +0 -106
- package/tests/user-ratings.test.ts +0 -142
- package/tests/vars.test.ts +0 -34
- package/tsconfig.json +0 -23
- package/vitest.config.mts +0 -10
|
@@ -0,0 +1,84 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
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;
|
package/vars.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
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;
|
package/.editorconfig
DELETED
package/.eslintrc.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"es6": true,
|
|
5
|
-
"node": true
|
|
6
|
-
},
|
|
7
|
-
"extends": ["google", "plugin:prettier/recommended"],
|
|
8
|
-
"globals": {
|
|
9
|
-
"Atomics": "readonly",
|
|
10
|
-
"SharedArrayBuffer": "readonly"
|
|
11
|
-
},
|
|
12
|
-
"parser": "@typescript-eslint/parser",
|
|
13
|
-
"parserOptions": {
|
|
14
|
-
"ecmaVersion": 2018,
|
|
15
|
-
"sourceType": "module"
|
|
16
|
-
},
|
|
17
|
-
"plugins": ["@typescript-eslint", "prettier"],
|
|
18
|
-
"rules": {
|
|
19
|
-
// disable googles JSDoc
|
|
20
|
-
"require-jsdoc": "off",
|
|
21
|
-
// no-unused vars for typescript config
|
|
22
|
-
"no-unused-vars": "off",
|
|
23
|
-
"@typescript-eslint/no-unused-vars": [
|
|
24
|
-
"error",
|
|
25
|
-
{
|
|
26
|
-
"vars": "all",
|
|
27
|
-
"args": "after-used",
|
|
28
|
-
"ignoreRestSiblings": false
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
"prettier/prettier": "error"
|
|
32
|
-
}
|
|
33
|
-
}
|
package/.gitattributes
DELETED
package/.github/FUNDING.yml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# These are supported funding model platforms
|
|
2
|
-
|
|
3
|
-
github: [bartholomej] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
4
|
-
patreon: # Replace with a single Patreon username
|
|
5
|
-
open_collective: # Replace with a single Open Collective username
|
|
6
|
-
ko_fi: bartholomej
|
|
7
|
-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
8
|
-
custom: ['https://www.paypal.me/bartholomej']
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
## What's new and why I made this pull request?
|
|
2
|
-
|
|
3
|
-
-
|
|
4
|
-
|
|
5
|
-
## Pull request type
|
|
6
|
-
|
|
7
|
-
What kind of change does this PR introduce?
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
[ ] Bugfix
|
|
11
|
-
[ ] Feature
|
|
12
|
-
[ ] Code style update (formatting, local variables)
|
|
13
|
-
[ ] Refactoring (no functional changes, no api changes)
|
|
14
|
-
[ ] Build related changes
|
|
15
|
-
[ ] CI related changes
|
|
16
|
-
[ ] Documentation content changes
|
|
17
|
-
[ ] Tests
|
|
18
|
-
[ ] Other
|
|
19
|
-
```
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
name: Build
|
|
2
|
-
|
|
3
|
-
on: [push]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
build:
|
|
7
|
-
runs-on: ubuntu-latest
|
|
8
|
-
|
|
9
|
-
steps:
|
|
10
|
-
- uses: actions/checkout@v4
|
|
11
|
-
- name: Use Node.js
|
|
12
|
-
uses: actions/setup-node@v4
|
|
13
|
-
with:
|
|
14
|
-
node-version: 24
|
|
15
|
-
|
|
16
|
-
- name: Cache node modules
|
|
17
|
-
uses: actions/cache@v4
|
|
18
|
-
with:
|
|
19
|
-
path: node_modules
|
|
20
|
-
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
|
|
21
|
-
restore-keys: |
|
|
22
|
-
${{ runner.OS }}-build-${{ env.cache-name }}-
|
|
23
|
-
${{ runner.OS }}-build-
|
|
24
|
-
${{ runner.OS }}-
|
|
25
|
-
|
|
26
|
-
- name: Install dependencies
|
|
27
|
-
run: yarn
|
|
28
|
-
|
|
29
|
-
- name: Build app
|
|
30
|
-
run: yarn build
|
|
31
|
-
|
|
32
|
-
- name: Run tests
|
|
33
|
-
run: yarn test:coverage
|
|
34
|
-
|
|
35
|
-
- name: Upload coverage to Codecov
|
|
36
|
-
uses: codecov/codecov-action@v5
|
|
37
|
-
with:
|
|
38
|
-
fail_ci_if_error: true
|
|
39
|
-
env:
|
|
40
|
-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
name: Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*'
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v4
|
|
14
|
-
- name: Use Node.js
|
|
15
|
-
uses: actions/setup-node@v4
|
|
16
|
-
with:
|
|
17
|
-
node-version: 24
|
|
18
|
-
registry-url: 'https://registry.npmjs.org'
|
|
19
|
-
|
|
20
|
-
- name: Cache node modules
|
|
21
|
-
uses: actions/cache@v4
|
|
22
|
-
with:
|
|
23
|
-
path: node_modules
|
|
24
|
-
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
|
|
25
|
-
restore-keys: |
|
|
26
|
-
${{ runner.OS }}-build-${{ env.cache-name }}-
|
|
27
|
-
${{ runner.OS }}-build-
|
|
28
|
-
${{ runner.OS }}-
|
|
29
|
-
|
|
30
|
-
- name: Install dependencies
|
|
31
|
-
run: yarn
|
|
32
|
-
|
|
33
|
-
- name: Build app
|
|
34
|
-
run: yarn build
|
|
35
|
-
|
|
36
|
-
- name: Run tests
|
|
37
|
-
run: yarn test:coverage
|
|
38
|
-
|
|
39
|
-
- name: Upload coverage to Codecov
|
|
40
|
-
uses: codecov/codecov-action@v5
|
|
41
|
-
with:
|
|
42
|
-
fail_ci_if_error: true
|
|
43
|
-
env:
|
|
44
|
-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
45
|
-
|
|
46
|
-
- name: Publish NPM
|
|
47
|
-
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == false
|
|
48
|
-
run: cd dist && npm publish --access public
|
|
49
|
-
env:
|
|
50
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
51
|
-
|
|
52
|
-
- name: Publish NPM BETA
|
|
53
|
-
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'beta') == true
|
|
54
|
-
run: cd dist && npm publish --access public --tag beta
|
|
55
|
-
env:
|
|
56
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
57
|
-
|
|
58
|
-
# - name: Set up package for GPR
|
|
59
|
-
# run: yarn gpr:setup
|
|
60
|
-
|
|
61
|
-
# - name: Use GPR
|
|
62
|
-
# uses: actions/setup-node@master
|
|
63
|
-
# with:
|
|
64
|
-
# node-version: 13
|
|
65
|
-
# registry-url: https://npm.pkg.github.com/
|
|
66
|
-
# scope: 'bartholomej'
|
|
67
|
-
|
|
68
|
-
# - name: Publish to GitHub Package Registry
|
|
69
|
-
# run: |
|
|
70
|
-
# cd dist
|
|
71
|
-
# npm publish
|
|
72
|
-
# env:
|
|
73
|
-
# NODE_AUTH_TOKEN: ${{github.token}}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
name: Build && Test
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
schedule:
|
|
5
|
-
- cron: '0 9 * * TUE'
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
build:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v4
|
|
13
|
-
- name: Use Node.js
|
|
14
|
-
uses: actions/setup-node@v4
|
|
15
|
-
with:
|
|
16
|
-
node-version: 24
|
|
17
|
-
|
|
18
|
-
- name: Cache node modules
|
|
19
|
-
uses: actions/cache@v4
|
|
20
|
-
with:
|
|
21
|
-
path: node_modules
|
|
22
|
-
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
|
|
23
|
-
restore-keys: |
|
|
24
|
-
${{ runner.OS }}-build-${{ env.cache-name }}-
|
|
25
|
-
${{ runner.OS }}-build-
|
|
26
|
-
${{ runner.OS }}-
|
|
27
|
-
|
|
28
|
-
- name: Install dependencies
|
|
29
|
-
run: yarn
|
|
30
|
-
|
|
31
|
-
- name: Build app
|
|
32
|
-
run: yarn build
|
|
33
|
-
|
|
34
|
-
- name: Build app
|
|
35
|
-
run: yarn test:coverage
|
|
36
|
-
|
|
37
|
-
- name: Upload coverage to Codecov
|
|
38
|
-
uses: codecov/codecov-action@v5
|
|
39
|
-
with:
|
|
40
|
-
fail_ci_if_error: true
|
|
41
|
-
verbose: true
|
|
42
|
-
env:
|
|
43
|
-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
package/.husky/pre-commit
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npx lint-staged
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
-
<code_scheme name="Project" version="173">
|
|
3
|
-
<HTMLCodeStyleSettings>
|
|
4
|
-
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
-
</HTMLCodeStyleSettings>
|
|
6
|
-
<JSCodeStyleSettings version="0">
|
|
7
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
9
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
10
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
-
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
|
|
12
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
-
</JSCodeStyleSettings>
|
|
15
|
-
<JavaCodeStyleSettings>
|
|
16
|
-
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
|
|
17
|
-
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
|
|
18
|
-
</JavaCodeStyleSettings>
|
|
19
|
-
<TypeScriptCodeStyleSettings version="0">
|
|
20
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
21
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
22
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
23
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
24
|
-
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
|
|
25
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
26
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
27
|
-
</TypeScriptCodeStyleSettings>
|
|
28
|
-
<VueCodeStyleSettings>
|
|
29
|
-
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
30
|
-
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
31
|
-
</VueCodeStyleSettings>
|
|
32
|
-
<codeStyleSettings language="CoffeeScript">
|
|
33
|
-
<indentOptions>
|
|
34
|
-
<option name="TAB_SIZE" value="4" />
|
|
35
|
-
</indentOptions>
|
|
36
|
-
</codeStyleSettings>
|
|
37
|
-
<codeStyleSettings language="HTML">
|
|
38
|
-
<option name="SOFT_MARGINS" value="100" />
|
|
39
|
-
<indentOptions>
|
|
40
|
-
<option name="INDENT_SIZE" value="2" />
|
|
41
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
42
|
-
<option name="TAB_SIZE" value="2" />
|
|
43
|
-
</indentOptions>
|
|
44
|
-
</codeStyleSettings>
|
|
45
|
-
<codeStyleSettings language="JavaScript">
|
|
46
|
-
<option name="SOFT_MARGINS" value="100" />
|
|
47
|
-
<indentOptions>
|
|
48
|
-
<option name="INDENT_SIZE" value="2" />
|
|
49
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
50
|
-
<option name="TAB_SIZE" value="2" />
|
|
51
|
-
</indentOptions>
|
|
52
|
-
</codeStyleSettings>
|
|
53
|
-
<codeStyleSettings language="PHP">
|
|
54
|
-
<option name="CLASS_BRACE_STYLE" value="1" />
|
|
55
|
-
<option name="METHOD_BRACE_STYLE" value="1" />
|
|
56
|
-
</codeStyleSettings>
|
|
57
|
-
<codeStyleSettings language="TypeScript">
|
|
58
|
-
<option name="SOFT_MARGINS" value="100" />
|
|
59
|
-
<indentOptions>
|
|
60
|
-
<option name="INDENT_SIZE" value="2" />
|
|
61
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
62
|
-
<option name="TAB_SIZE" value="2" />
|
|
63
|
-
</indentOptions>
|
|
64
|
-
</codeStyleSettings>
|
|
65
|
-
<codeStyleSettings language="Vue">
|
|
66
|
-
<option name="SOFT_MARGINS" value="100" />
|
|
67
|
-
<indentOptions>
|
|
68
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
69
|
-
</indentOptions>
|
|
70
|
-
</codeStyleSettings>
|
|
71
|
-
</code_scheme>
|
|
72
|
-
</component>
|
package/.idea/misc.xml
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
|
4
|
-
<output url="file://$PROJECT_DIR$/out" />
|
|
5
|
-
</component>
|
|
6
|
-
</project>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/node-csfd-api.iml" filepath="$PROJECT_DIR$/.idea/node-csfd-api.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/node-csfd-api.iml
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="JAVA_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
-
<exclude-output />
|
|
5
|
-
<content url="file://$MODULE_DIR$" />
|
|
6
|
-
<orderEntry type="inheritedJdk" />
|
|
7
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
8
|
-
</component>
|
|
9
|
-
</module>
|
package/.idea/prettier.xml
DELETED
package/.idea/vcs.xml
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
24
|
package/.prettierignore
DELETED
package/.prettierrc
DELETED
package/.vscode/settings.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"workbench.colorCustomizations": {
|
|
3
|
-
"statusBar.background": "#000"
|
|
4
|
-
},
|
|
5
|
-
"editor.codeActionsOnSave": {
|
|
6
|
-
"source.organizeImports": "explicit",
|
|
7
|
-
"source.fixAll.eslint": "explicit"
|
|
8
|
-
},
|
|
9
|
-
"[html]": {
|
|
10
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
11
|
-
"editor.formatOnSave": false
|
|
12
|
-
},
|
|
13
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
14
|
-
"editor.formatOnSave": true,
|
|
15
|
-
"typescript.tsdk": "node_modules/typescript/lib"
|
|
16
|
-
}
|
package/Dockerfile
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
FROM node:24-alpine
|
|
2
|
-
|
|
3
|
-
# Create app directory
|
|
4
|
-
WORKDIR /usr/src/app
|
|
5
|
-
|
|
6
|
-
# Copy package.json and yarn.lock
|
|
7
|
-
COPY package.json yarn.lock ./
|
|
8
|
-
|
|
9
|
-
# Install dependencies
|
|
10
|
-
RUN yarn install
|
|
11
|
-
|
|
12
|
-
# Copy the application code
|
|
13
|
-
COPY . .
|
|
14
|
-
|
|
15
|
-
# Expose the app's port
|
|
16
|
-
EXPOSE 3000
|
|
17
|
-
|
|
18
|
-
# Start the application
|
|
19
|
-
CMD ["yarn", "tsx", "server.ts"]
|
package/demo.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// import { writeFile } from 'fs';
|
|
2
|
-
import { csfd } from './src';
|
|
3
|
-
|
|
4
|
-
// Parse movie
|
|
5
|
-
csfd.movie(10135).then((movie) => console.log(movie));
|
|
6
|
-
|
|
7
|
-
// csfd.search('matrix').then((search) => console.log(search));
|
|
8
|
-
|
|
9
|
-
// Parse creator
|
|
10
|
-
csfd.creator(2120).then((creator) => console.log(creator));
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* USER RATINGS
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
// Save all pages in json file
|
|
17
|
-
// const userId = 912;
|
|
18
|
-
|
|
19
|
-
// csfd
|
|
20
|
-
// .userRatings(userId, {
|
|
21
|
-
// excludes: ['epizoda', 'pořad', 'série'],
|
|
22
|
-
// allPages: false,
|
|
23
|
-
// allPagesDelay: 2000
|
|
24
|
-
// })
|
|
25
|
-
// .then((ratings) => {
|
|
26
|
-
// console.log('Saved in file:', `./${userId}.json`);
|
|
27
|
-
// writeFile(`${userId}.json`, JSON.stringify(ratings), (err) => {
|
|
28
|
-
// if (err) return console.log(err);
|
|
29
|
-
// });
|
|
30
|
-
// });
|
|
31
|
-
|
|
32
|
-
// Only TV series
|
|
33
|
-
// csfd
|
|
34
|
-
// .userRatings('912-bart', { includesOnly: ['seriál'] })
|
|
35
|
-
// .then((ratings) => console.log(ratings));
|
package/eslint.config.mjs
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { FlatCompat } from '@eslint/eslintrc';
|
|
2
|
-
import js from '@eslint/js';
|
|
3
|
-
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
4
|
-
import tsParser from '@typescript-eslint/parser';
|
|
5
|
-
import prettier from 'eslint-plugin-prettier';
|
|
6
|
-
import globals from 'globals';
|
|
7
|
-
import path from 'node:path';
|
|
8
|
-
import { fileURLToPath } from 'node:url';
|
|
9
|
-
|
|
10
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
-
const __dirname = path.dirname(__filename);
|
|
12
|
-
const compat = new FlatCompat({
|
|
13
|
-
baseDirectory: __dirname,
|
|
14
|
-
recommendedConfig: js.configs.recommended,
|
|
15
|
-
allConfig: js.configs.all
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export default [
|
|
19
|
-
...compat.extends('google', 'plugin:prettier/recommended'),
|
|
20
|
-
{
|
|
21
|
-
plugins: {
|
|
22
|
-
'@typescript-eslint': typescriptEslint,
|
|
23
|
-
prettier
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
languageOptions: {
|
|
27
|
-
globals: {
|
|
28
|
-
...globals.browser,
|
|
29
|
-
...globals.node,
|
|
30
|
-
Atomics: 'readonly',
|
|
31
|
-
SharedArrayBuffer: 'readonly'
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
parser: tsParser,
|
|
35
|
-
ecmaVersion: 2018,
|
|
36
|
-
sourceType: 'module'
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
rules: {
|
|
40
|
-
'require-jsdoc': 'off',
|
|
41
|
-
'no-unused-vars': 'off',
|
|
42
|
-
|
|
43
|
-
'@typescript-eslint/no-unused-vars': [
|
|
44
|
-
'error',
|
|
45
|
-
{
|
|
46
|
-
vars: 'all',
|
|
47
|
-
args: 'after-used',
|
|
48
|
-
ignoreRestSiblings: false
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
|
|
52
|
-
'prettier/prettier': 'error'
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
];
|