LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   youtube-dl and removing lines after processing? (https://www.linuxquestions.org/questions/linux-general-1/youtube-dl-and-removing-lines-after-processing-4175560735/)

ziphem 12-05-2015 11:04 AM

youtube-dl and removing lines after processing?
 
I have the following command:

Code:

#!/bin/bash
name=$(cat "/home/mydir/URLs.txt")
echo
echo $name
echo
youtube-dl -o /home/mydir/downloads/youtube-dl/'%(title)s'.flv -x --audio-format mp3 --audio-quality 320 -k --embed-subs $name

etc.

I'm looking for a way to remove each line in $name after it is successfully processed. I didn't see something like that as a function of a youtube-dl switch, so I'm wondering how I can do this in bash?

Would it work to follow the youtube-dl command with
Code:

&& $name | sed -e '1d'
But even if this works, it doesn't necessarily verify the file correctly downloaded. I'd greatly appreciate any feedback on this.

Thanks!!

ondoho 12-05-2015 03:09 PM

you can read the file with the urls into an array, then iterate over that array.

bash arrays are worth the learning curve.

http://mywiki.wooledge.org/BashGuide/Arrays


All times are GMT -5. The time now is 04:07 AM.