This is a shell script designed to interact with the DLsite website, allowing you to log in, list your purchased products, inspect product metadata, and download them.
The script requires the following command-line tools to be installed on your system:
curl: A tool for transferring data with URLs.jq: A lightweight and flexible command-line JSON processor.aria2c: A multi-protocol and multi-source command-line download utility.
The script will check for these dependencies and exit if any are missing.
The script supports two main subcommands: login and product.
This subcommand handles the authentication process. It requires you to provide your DLsite username and password.
./dldw.sh login --username <YOUR_USERNAME> --password <YOUR_PASSWORD>Upon successful login, a dlsite-cookie.txt file will be created in the same directory, which stores the session cookies needed for subsequent commands.
This subcommand has three further options: list, info, and download.
-
list: Lists all the products you have purchased../dldw.sh product list
The output will display the product work number (
WORKNO) and the product name. -
info: Fetches the metadata of a product from the DLsite product API and prints it as JSON../dldw.sh product info <WORKNO>
By default the full API response is printed. Everything after the
WORKNOis joined and passed straight tojqas the filter, so you decide which parts of the response you want:# The whole response, pretty printed (same as '.'). ./dldw.sh product info <WORKNO> # A single field. ./dldw.sh product info <WORKNO> '.[].work_name' # The list of files in the product. ./dldw.sh product info <WORKNO> '.[].contents' # Any jq expression works, including pipelines and object construction. ./dldw.sh product info <WORKNO> '.[].contents | length' ./dldw.sh product info <WORKNO> '.[] | {workno, work_name, circle_id}'
Quote the filter in your shell so that characters like
[,|, and{}are not expanded before the script sees them. This command does not require a login. -
download: Downloads a specific product using itsWORKNO../dldw.sh product download <WORKNO>
You can optionally specify a download directory using the
-dor--dirflag. If not specified, the files will be downloaded to adownloadsdirectory created in the same location as the script../dldw.sh product download <WORKNO> --dir /path/to/your/download/folder
The script uses
aria2cfor downloads, leveraging its multi-connection capabilities for potentially faster downloads. It is configured to use 10 connections (-x 10) and 10 parallel downloads (-s 10).
| Short Option | Long Option | Description | Subcommand |
|---|---|---|---|
-u |
--username |
Your DLsite login ID. | login |
-p |
--password |
Your DLsite password. | login |
-d |
--dir |
The directory where files will be downloaded. | product |