I want to write a bash function to both start downloading a file and open it in a video player; I don't know how to get the path of the file being downloaded though:
function dl-and-stream() {
aria2c "$1" &
sleep 30
mpv #What to put here
}
PS: This is not my only use case, and I’m aware of --out
, but I like to keep the original file name.
Update: My use cases can be fulfilled via --on-download-complete
(and other event handlers), but I still prefer not using that if possible. (Because they need the creation of additional script files.)
arai2c
in the background and startmpv
beforearia2c
has even figured out how to access the URL and possibly followed some redirections?youtube-dl
then you should probably ask aboutyoutube-dl
and not about some other tool that is not so widely known. Consider we figure out thataria2c
writes the output filename to/etc/var/log/foo/output.file.name
and we'd give you the advice to read that file. Of what help would that be foryoutube-dl
?