title: Renaming downloaded YT videos with the youtube-dl
body: <p>I have a link list with names in the first column and links in the last column. I want to write a script that downloads the files and names the file according to the first column.
  My code is</p>
  
  <blockquote>
    <p>#!/bin/bash
    x="/group/cgl/2018/04/list.dat"</p>
    
    <p>title=$(awk '{print $1}' $x)</p>
    
    <p>Parameter=$(awk '{print $NF}' $x)</p>
    
    <p>youtube-dl -x --audio-format mp3 -o "%("$title")s.%(ext)s" $Parameter</p>
  </blockquote>
  
  <p>it is able to download and convert the files to mp3 if i leave the </p>
  
  <blockquote>
    <p>-o "%("$title")s.%(ext)s"</p>
  </blockquote>
  
  <p>out. Whats wrong with this code, it gives me the error </p>
  
  <blockquote>
    <p>youtube-dl: error: Cannot download a video and extract audio into the same file! Use "%(heuteXpress.%(ext)s" instead of "%(heuteXpress" as the output template</p>
  </blockquote>
  
  <p>but fixing it like that doesnt solve it and gives a simmilar error.</p>