summaryrefslogtreecommitdiff
path: root/pkgs/lightnovel-crawler.nix
blob: 59d227999b6e1b302a8c375a2c170ddad8fc88d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
  lib,
  python3Packages,
  fetchFromGitHub,
}:
python3Packages.buildPythonApplication rec {
  pname = "lightnovel-crawler";
  version = "3.7.5";
  # NOTE: the project uses a plain setup.py, but setting this is still recommended
  # see: https://nixos.org/manual/nixpkgs/stable/#buildpythonpackage-parameters
  pyproject = true;

  src = fetchFromGitHub {
    owner = "dipu-bd";
    repo = "lightnovel-crawler";
    rev = "v${version}";
    sha256 = "sha256-aYnx+t8DkSty9Kdz+NxYEQWiMFpJ6/5xWNpKkvcnkR8=";
  };

  build-system = with python3Packages; [
    setuptools
  ];

  dependencies = with python3Packages; [
    ascii
    regex
    pyease-grpc
    python-dotenv
    beautifulsoup4
    requests
    python-slugify
    colorama
    tqdm
    pyexecjs
    ebooklib
    pillow
    cloudscraper
    lxml
    lxml-html-clean
    readability-lxml
    questionary
    prompt-toolkit
    html5lib
    base58
    python-box
    pycryptodome
    selenium
    packaging
  ];

  # NOTE: I only want _one_ binary, called lncrawl
  # these are duplicates, deleting them
  # there's probably a smarter way to do this...
  postInstall = ''
    rm $out/bin/lightnovel-crawler $out/bin/lightnovel_crawler
  '';

  meta = {
    homepage = "https://github.com/dipu-bd/lightnovel-crawler";
    description = "Generate and download e-books from online sources";
    license = lib.licenses.gpl3;
  };
}