Skip to main content

Console tools to download online novel and convert to text file.

Project description

xsget

Console tools to download online novel and convert to text file.

Installation

Stable version From PyPI using pipx:

pipx install xsget playwright
playwright install

Stable version From PyPI using pip:

python3 -m pip install xsget playwright
playwright install

Upgrade to latest stable version:

python3 -m pip install xsget --upgrade

Latest development version from GitHub:

python3 -m pip install -e git+https://github.com/kianmeng/xsget.git
playwright install

xsget

xsget -h
usage: xsget [-l CSS_PATH] [-p URL_PARAM] [-g [FILENAME] | -c [FILENAME]] [-r]
             [-t] [-b] [-bs SESSION] [-bd DELAY] [-od OUTPUT_DIR] [-q] [--env]
             [-d] [-h] [-V]
             URL

xsget is a console app that crawl and download online novel.

website: https://github.com/kianmeng/xsget
changelog: https://github.com/kianmeng/xsget/blob/master/CHANGELOG.md
issues: https://github.com/kianmeng/xsget/issues

positional arguments:
  URL   set url of the index page to crawl

options:
  -l, --link-css-path CSS_PATH
        set css path of the link to a chapter (default: 'a')
  -p, -url-param-as-filename URL_PARAM
        use url param key as filename (default: '')
  -g, --generate-config-file [FILENAME]
        generate config file from options (default: 'xsget.toml')
  -c, --config-file [FILENAME]
        load config from file (default: 'xsget.toml')
  -r, --refresh
        refresh the index page
  -t, --test
        show extracted urls without crawling
  -b, --browser
        crawl by actual browser (default: 'False')
  -bs, --browser-session SESSION
        set the number of browser session (default: 2)
  -bd, --browser-delay DELAY
        set the second to wait for page to load in browser (default: 0)
  -od, --output-dir OUTPUT_DIR
        set default output folder (default: 'output')
  -q, --quiet
        suppress all logging
  --env
        print environment information for bug reporting
  -d, --debug
        show debugging log and stacktrace
  -h, --help
        show this help message and exit
  -V, --version
        show program's version number and exit

examples:
  xsget http://localhost
  xsget http://localhost/page[1-100].html
  xsget -g -l "a" -p "id" http://localhost

xstxt

xstxt -h
usage: xstxt [-pt CSS_PATH] [-pb CSS_PATH] [-la LANGUAGE] [-ps SEPARATOR]
             [-rh REGEX REGEX] [-rt REGEX REGEX] [-bt TITLE] [-ba AUTHOR]
             [-ic INDENT_CHARS] [-fw] [-oi] [-ow] [-i GLOB_PATTERN]
             [-e GLOB_PATTERN] [-l TOTAL_FILES] [-w WIDTH] [-o FILENAME]
             [-od OUTPUT_DIR] [-y] [-p] [-g [FILENAME] | -c [FILENAME]] [-m]
             [-q] [--env] [-d] [-h] [-V]

xstxt is a console app that extract content from HTML to text file.

website: https://github.com/kianmeng/xsget
changelog: https://github.com/kianmeng/xsget/blob/master/CHANGELOG.md
issues: https://github.com/kianmeng/xsget/issues

options:
  -pt, --title-css-path CSS_PATH
        set css path of chapter title (default: 'title')
  -pb, --body-css-path CSS_PATH
        set css path of chapter body (default: 'body')
  -la, --language LANGUAGE
        language of the ebook (default: 'zh')
  -ps, --paragraph-separator SEPARATOR
        set paragraph separator (default: '\n\n')
  -rh, --html-replace REGEX REGEX
        set regex to replace word or pharase in html file
  -rt, --txt-replace REGEX REGEX
        set regex to replace word or pharase in txt file
  -bt, --book-title TITLE
        set title of the novel (default: '不详')
  -ba, --book-author AUTHOR
        set author of the novel (default: '不详')
  -ic, --indent-chars INDENT_CHARS
        set indent characters for a paragraph (default: '')
  -fw, --fullwidth
        convert ASCII character to from halfwidth to fullwidth (default: 'False')
  -oi, --output-individual-file
        convert each html file into own txt file
  -ow, --overwrite
        overwrite output file
  -i, --input GLOB_PATTERN
        set glob pattern of html files to process (default: '['./*.html']')
  -e, --exclude GLOB_PATTERN
        set glob pattern of html files to exclude (default: '[]')
  -l, --limit TOTAL_FILES
        set number of html files to process (default: '3')
  -w, --width WIDTH
        set the line width for wrapping (default: 0, 0 to disable)
  -o, --output FILENAME
        set output txt file name (default: 'book.txt')
  -od, --output-dir OUTPUT_DIR
        set output directory (default: 'output')
  -y, --yes
        yes to prompt
  -p, --purge
        remove extracted files specified by --output-folder option (default: 'False')
  -g, --generate-config-file [FILENAME]
        generate config file from options (default: 'xstxt.toml')
  -c, --config-file [FILENAME]
        load config from file (default: 'xstxt.toml')
  -m, --monitor
        monitor config file changes and re-run when needed
  -q, --quiet
        suppress all logging
  --env
        print environment information for bug reporting
  -d, --debug
        show debugging log and stacktrace
  -h, --help
        show this help message and exit
  -V, --version
        show program's version number and exit

examples:
  xsget -g
  xstxt --input *.html
  xstxt --output-individual-file --input *.html
  xstxt --config --monitor

Copyright and License

Copyright (C) 2021,2022,2023,2024 Kian-Meng Ang

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xsget-0.1.15.tar.gz (204.1 kB view details)

Uploaded Source

Built Distribution

xsget-0.1.15-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file xsget-0.1.15.tar.gz.

File metadata

  • Download URL: xsget-0.1.15.tar.gz
  • Upload date:
  • Size: 204.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for xsget-0.1.15.tar.gz
Algorithm Hash digest
SHA256 7ba752dfa7d1fd808d14f601484f0ca058a9d1137753d62ec241a2016284e7ad
MD5 0b9c8be9470ae7dd50de5de248ee868a
BLAKE2b-256 0bedf892ad8cfe01bb2f1f5ac5b746833ec7ce2360e3692d3f24e852a8d55dab

See more details on using hashes here.

File details

Details for the file xsget-0.1.15-py3-none-any.whl.

File metadata

  • Download URL: xsget-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for xsget-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 9641f154562ca52f8b4a50809dce876b4452ce36cf41676c05fdabfd4e9b9c2f
MD5 6276cc43cbb2fa1df0273bf6120687f2
BLAKE2b-256 3fa51d98edee32681e6edc08aafe84024fda2061c6bd0b369ddb95ecd166556f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page