Build a text file that looks like the following, where the URL is on a separate line, and the renamed file is on the second line, of each URL couplet. This structure is key to the proper functioning of the AppleScript. I called this file url_list.txt, and put it on my Desktop. Tested on OS X 10.11.5.
"https://discussions.apple.com/content/attachment/729230040"
-o foo.jpg
https://discussions.apple.com/content/attachment/729230040
-o foobar.jpg
https://discussions.apple.com/content/attachment/729230040
-o bar.jpg
AppleScript
-- Prompt for a text file containing a list of URLs and the output filenames for each URL
-- Process the input list and write files to designated output folder
-- xargs -P2 uses two process threads on the list
-- -n3 there are three items per URL couplet 1) URL, 2) -o and 3) filename
property loc : ((path to desktop) as text)
property outdir : POSIX path of loc & "curlyFiles" as text
property foldername : "curlyFiles"
set url_list to POSIX path of (choose file with prompt "Choose URL list file for cURL")
tell application "Finder"
if not (existsfolderoutdir) is true then makenewfolderatlocwith properties {name:foldername}
end tell
set status to (do shell script "(cd " & outdir & " && xargs -P2 -n3 <" & url_list's quoted form & " curl -sL)")
if not status is "" then
display alert "Processing of URL list: " & url_list & " has failed." giving up after 10
end if
return