   [index]
   (split-lines (:out (apply sh (flatten (conj (list index) iplayer-info))))))
 
+(defn get-download-modes
+  "build list of possible download-modes for a given index."
+  [lst]
+  (let [modes (first (filter #(re-find #"modes.*" %) lst))]
+    (remove nil? (list (re-find #"flashhigh" modes)
+                       (re-find #"flashvhigh" modes)
+                       (re-find #"flashhd" modes)
+                       (re-find #"flashlow" modes)))))
+
 (defn load-thumbandinfo-for-index
   "grep url for thumbnail size44, title and description
    for entered index."

    (list
     (map #(re-find #"htt.*" %) (filter #(re-find #"thumbnail4.*" %) ind))
     (map #(re-find #"[A-Z].*" %) (filter #(re-find #"desc:.*" %) ind))
     (map #(re-find #"[A-Z0-9].*" %) (filter #(re-find #"title:.*" %) ind)))))

(defn get-thumb-from-search
  "return list of thumbnail for searchterm."

(defn iplayer-download-command
  "concatenate index and mode to download command"
   [index mode]
   (list "get-iplayer" (apply str "modes=" mode "1\"")
         "output=\"$HOME/Videos\"" "-g" index)) 

(defn get-url
  "return /info url string concatenated with index"
