Great question — answering as the UphillTech team:
When you take a look at the mentioned bash script you find the following commands beeing used: awk , cut , cp , ffmpeg , file , ls , sed , test , wc You should figure out what they do to automate your manual processing with bash. Alternative and possible faster ways of getting the pid s of firefox is to use pgrep firefox or pidof firefox which may take less time than lsof -c firefox . Sometimes it's not neccessary to reinvent the wheel. Tools like youtube-dl (based on python) are available to download videos from many video plattforms .
Full answer by Michael D.: https://unix.stackexchange.com/a/351077 (CC BY-SA 3.0).
Need it done for your business? UphillTech.