Automate reporting of song usage to CCLI. Drop your report files into the Reports folder and run the script—each song is resolved and submitted, with clear, per-song output.
- Create your config
- Copy
variables_example.pytovariables.py - Fill in
ccli_userameandccli_password
- Install dependencies
pip install requests selenium
- Prepare your input
- Preferred: Export a FreeShow JSON report and put it in
Reports/. - Alternative: Place an OpenSong
ActivityLog.xmlinReports/(or keep your OpenSong folder configured for the legacy fallback).
- Run
python auto_ccli.py
On first run, a browser window may open so you can complete the login. After that, the script reuses the saved cookies and anti-forgery token.
- Collects CCLI numbers from your input files:
- FreeShow JSON (.json)
- OpenSong ActivityLog.xml (.xml)
- For each unique CCLI number:
- Uses a local cache when possible
- Otherwise searches CCLI for song ID and official title
- Prints a verbose line per song (cache/search, title, song_id)
- Submits a report to CCLI
- Moves processed input to
Reports/Done/(handles name collisions safely)
Example console output:
Attempting to get RequestVerificationToken and Cookie from file.
RequestVerificationToken and Cookie read from file.
Processing 2025-10-26_11-58.json (43 items)...
[cache] 798108 - Ancient Of Days - daeca40a-7f82-42c1-bb44-305a5c68a697
[search] Fetching details for CCLI 2447467...
[found] 2447467 - Some Title - 123e4567-e89b-12d3-a456-426614174000
[missing] Could not resolve CCLI 9999999
Reporting the following songs:
798108 - Ancient Of Days - daeca40a-7f82-42c1-bb44-305a5c68a697
...
43 songs reported successfully.
Moved 2025-10-26_11-58.json to Done/
CCLI does not provide a public reporting API. The script authenticates via a normal browser login and captures the required cookies and anti-forgery token. These are saved for reuse:
Cookie.txtRequestVerificationToken.txt
The script validates these values and can refresh the token from the server if needed. You can also obtain them manually from your browser dev tools and paste them into the files above.
Preferred: place .json or .xml files in Reports/ and run the script.
Legacy fallback (optional): you can still report from a list without files.
- In
variables.py, define:getFromOpenSong = TrueandopensongFolder = r"C:\\Program Files\\OpenSong", orsong_list = ["12345", "67890"]If these variables are absent, the script skips the legacy flow.
This repo ignores sensitive and local-only artifacts (see .gitignore):
variables.py, cookies/token files, cache (song_cache.json)Reports/and processedSettings/Reported/- logs (
debug.log,*.log),__pycache__/,.vscode/, virtual envs
- If a console encoding error appears, the script auto-configures robust UTF‑8 printing and also logs diagnostics to
debug.log. - If requests fail with 401/409, the script can refresh tokens and will prompt a new login if necessary.
For test runs, you can delete reports from the last 3 months:
python delete_all.py