Compare commits
9 Commits
@@ -5,13 +5,15 @@ on:
|
||||
branches:
|
||||
- "dev"
|
||||
paths:
|
||||
- "cdl_downloader**"
|
||||
- "src**"
|
||||
- "requirements.txt"
|
||||
pull_request:
|
||||
branches:
|
||||
- "dev"
|
||||
- "main"
|
||||
paths:
|
||||
- "cdl_downloader**"
|
||||
- "src**"
|
||||
- "requirements.txt"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
@@ -26,7 +28,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r cdl_downloader/requirements.txt
|
||||
pip install -r requirements.txt
|
||||
pip install pylint
|
||||
- name: Analysing the code with pylint
|
||||
run: pylint --exit-zero $(git ls-files 'cdl_downloader/*.py')
|
||||
run: pylint --exit-zero $(git ls-files 'src/*.py')
|
||||
@@ -5,7 +5,8 @@ on:
|
||||
branches:
|
||||
- "main"
|
||||
paths:
|
||||
- "cdl_downloader**"
|
||||
- "src**"
|
||||
- "requirements.txt"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
@@ -20,10 +21,10 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r cdl_downloader/requirements.txt
|
||||
pip install -r requirements.txt
|
||||
pip install pylint
|
||||
- name: Analysing the code with pylint
|
||||
run: pylint --exit-zero $(git ls-files 'cdl_downloader/*.py')
|
||||
run: pylint --exit-zero $(git ls-files 'src/*.py')
|
||||
publish:
|
||||
name: Publish script
|
||||
needs: analyze
|
||||
@@ -45,22 +46,29 @@ jobs:
|
||||
id: gitversion
|
||||
with:
|
||||
configFilePath: ./.gitea/config/gitversion.yml
|
||||
- name: Create package root directory
|
||||
run: |
|
||||
mkdir package
|
||||
mkdir package/cdl_downloader
|
||||
cp -r src/* package/cdl_downloader/
|
||||
cp requirements.txt package/requirements.txt
|
||||
- name: Create .TAR.GZ archive
|
||||
uses: ksm2/archive-action@v1
|
||||
with:
|
||||
format: "tar.gz"
|
||||
name: cdl_downloader_${{steps.gitversion.outputs.SemVer}}
|
||||
include: "./cdl_downloader"
|
||||
root-directory: "package"
|
||||
- name: Create .ZIP archive
|
||||
uses: ksm2/archive-action@v1
|
||||
with:
|
||||
format: "zip"
|
||||
name: cdl_downloader_${{steps.gitversion.outputs.SemVer}}
|
||||
include: "./cdl_downloader"
|
||||
root-directory: "package"
|
||||
- name: Create Release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
tag_name: ${{steps.gitversion.outputs.SemVer}}
|
||||
name: ${{steps.gitversion.outputs.SemVer}}
|
||||
files: |-
|
||||
cdl_downloader_${{steps.gitversion.outputs.SemVer}}.tar.gz
|
||||
cdl_downloader_${{steps.gitversion.outputs.SemVer}}.zip
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
You can also use `requirements.txt` file to install PIP dependencies
|
||||
|
||||
```
|
||||
pip install -r cdl_downloader/requirements.txt
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -62,8 +62,10 @@ In case of success:
|
||||
{
|
||||
"success": true,
|
||||
"id": "e1ce9235-9c36-4b7a-b245-e2f1c3d3b1c0",
|
||||
"fileName": "/mnt/example/download_dir/e1ce9235-9c36-4b7a-b245-e2f1c3d3b1c0/TEST_FILE.pdf",
|
||||
"fileName": "TEST_FILE.pdf",
|
||||
"formattedDate": "2026.01.31",
|
||||
"resultTableHTML": "<table>...</table>"
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
With `--path /mnt/example/download_dir/` file will be saved under `/mnt/example/download_dir/e1ce9235-9c36-4b7a-b245-e2f1c3d3b1c0/TEST_FILE.pdf`
|
||||
@@ -24,7 +24,6 @@ args = parser.parse_args()
|
||||
id = str(uuid.uuid1())
|
||||
directory = os.path.join(args.path, id)
|
||||
|
||||
|
||||
options = Options()
|
||||
if (args.headless):
|
||||
options.add_argument("--headless")
|
||||
@@ -35,14 +34,15 @@ options.add_experimental_option("prefs", {"download.default_directory": director
|
||||
'download.prompt_for_download': False,
|
||||
'plugins.always_open_pdf_externally': True})
|
||||
|
||||
|
||||
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
|
||||
driver.get("https://ewyniki.cdl.pl/kl322-n/index.php?page=logowanie&barcodeLogin=true")
|
||||
|
||||
|
||||
def click(element):
|
||||
driver.execute_script("arguments[0].click();", element)
|
||||
|
||||
|
||||
|
||||
barcode_textbox = driver.find_element(By.NAME, "barcode")
|
||||
pesel_textbox = driver.find_element(By.NAME, "pesel")
|
||||
submit_button = driver.find_element(By.CLASS_NAME, "loginButton")
|
||||
Reference in New Issue
Block a user