Service How to use current page url in Safari as variable?

So I am trying to write a service in Automator & cannot figure out how to take the current selected page url of Safari or Chrome to variable within this on run.

I obviously set ytURL explicitly here, but want to use a variable set to the page url instead.

When set explicitly it does work from testing.

on run {input, parameters}

set ytURL to "https://www.youtube.com/watch?v=Y-NB0GiPvh0"
tell application "Terminal"
	activate
	do script with command ("youtube-dl --extract-audio --audio-format mp3 " & ytURL)
end tell

return input

end run

So I guess what automator action step should I have above this one?

Is it “Set variable”? and if so how would I do that?

ANSWER:
Okay this is how I did it:

1st Automator step was “Get current webpage from Safari”
2nd Automator step was “Run Applescript”

on run {input, parameters}

set ytURL to input
tell application "Terminal"
	activate
	do script with command ("youtube-dl --extract-audio --audio-format mp3 " & ytURL)
end tell

return input

end run

You don’t have to start Terminal, you can use
AppleScript
on run {input, parameters}
do shell script "/usr/local/bin/youtube-dl --no-check-certificate --extract-audio --audio-format mp3 " & (input as text)
end run
or
Shell Script { Shell: /bin/bash/ Pass Input: as arguments }:
/usr/local/bin/youtube-dl --no-check-certificate --extract-audio --audio-format mp3 $1

You can set a custom download location by using
do shell script “cd ~/Youtube;” & "/usr/local/bin/youtube-dl --no-check-certificate --extract-audio --audio-format mp3 " & (input as text)

It works with a keyboard shortcut or if you right click the url in the address bar, but I can’t get it to work on right click on a url. Any suggestions?