I have an issue with youtube-dl in Linux, so I want to create a bash script letting me download a playlist and put all the videos in a separate folder having the name of that playlist here is my attempt :
#!/bin/bash
echo 'Enter the URL of the playlist : '
read url
title = youtube-dl -o "%(title)s \"$url\""
mkdir "$title"
cd $title
youtube-dl --download-archive archive.txt $url
but it always gives this error :
[gerzal@dhcppc1 Videos]$ ./try.bash
Enter the URL of the playlist :
ff
youtube-dl -o %(title)s "ff"
./try.bash: line 6: title: command not found
mkdir: cannot create directory ‘’: No such file or directory
thanks in advance for help and it will be really appreciated.
update information:
I contacted one of the youtube-dl developers and he gave me the solution in one command line without adding mkdir command, here is the command line:
youtube-dl --download-archive archive.txt -o '%(playlist_title)s/%(title)s-%(id)s.%(ext)s' "$url"