Files
CDLDownloader/README.md

87 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

2026-02-09 16:17:33 +01:00
<p align="center"><img src=".gitea/readme/icon.png"/></p>
2026-02-03 21:54:42 +01:00
<h1 align="center">CDL Downloader</h1>
2026-02-01 22:10:09 +01:00
2026-02-03 21:54:42 +01:00
<h3 align="center"><b>Automation script for downloading medical test results files from <a href="ewyniki.cdl.pl">ewyniki.cdl.pl</a></b></h3>
<p align="center">CDL Downloader makes use of Selenium test software to automatically fill patient data textboxes and download PDF files.</p>
---
## Features
2026-02-09 18:40:09 +01:00
- Download medical test results files from <a href="ewyniki.cdl.pl">ewyniki.cdl.pl</a> automatically.
2026-02-03 21:54:42 +01:00
- Headless mode - can be used entirely without graphical interface
2026-02-09 18:40:09 +01:00
- Return basic information after download in JSON format, such as failure/success status and tests results as html table
2026-02-03 21:54:42 +01:00
2026-02-09 12:27:46 +01:00
## Installation
Download latest package version from <a href="https://repos.mateuszskoczek.com/MateuszSkoczek/CDLDownloader/releases">Releases</a> tab, unpack, install requirements and you good to go
**Requirements**
2026-02-03 21:54:42 +01:00
- Chrome Driver installed
2026-02-09 12:16:55 +01:00
- Python installed
2026-02-03 21:54:42 +01:00
- PIP packages:
- `selenium`
- `webdriver-manager`
- `argparse`
You can also use `requirements.txt` file to install PIP dependencies
```
2026-02-09 11:48:25 +01:00
pip install -r requirements.txt
2026-02-03 21:54:42 +01:00
```
## Usage
```
2026-02-09 17:51:51 +01:00
python cdl_downloader <pesel> <barcode> [additional_options]
2026-02-03 21:54:42 +01:00
```
**Additional options:**
- `--headless` - headless mode
- `--path <path>` - set download path
**Execution:**
1. Script starts browser
2. Goes to <a href="https://ewyniki.cdl.pl/kl322-n/index.php?page=logowanie&barcodeLogin=true">ewyniki.cdl.pl barcode login page</a>
3. Fills PESEL and barcode textbox and submit
4. Waits either for error message (and then stops and returns error) or download button
5. Gathers info about test results
6. Creates dedicated download directory
7. Downloads file
**Returned data:**
In case of failure:
```
{
"success": false
}
```
In case of success:
```
{
"success": true,
"id": "e1ce9235-9c36-4b7a-b245-e2f1c3d3b1c0",
2026-02-04 00:21:23 +01:00
"fileName": "TEST_FILE.pdf",
2026-02-03 21:54:42 +01:00
"formattedDate": "2026.01.31",
"resultTableHTML": "<table>...</table>"
}
2026-02-04 00:21:23 +01:00
```
2026-02-09 18:40:28 +01:00
With `--path /mnt/example/download_dir/` file will be saved as `/mnt/example/download_dir/e1ce9235-9c36-4b7a-b245-e2f1c3d3b1c0/TEST_FILE.pdf`
2026-02-09 16:17:33 +01:00
## Attribution
2026-02-09 18:36:44 +01:00
You can copy this repository and create your own version of the app freely. However, it would be nice if you included URL to this repository in the description to your repository or in README file.
2026-02-09 17:34:31 +01:00
**Other sources:**
2026-02-09 16:17:33 +01:00
- Icon by <a href="icons8.com">Icons8</a>