It takes a CSV file as an input (as you said you want to add some text to the URL too), reads the file, gets the first URL and text, then shells out to a program (just bash in this example) and then rewrites the CSV with the first entry removed.
I tested it on my Pihole and it ran without problem.