I'm trying to use you script in bash one liner.. How i can download X song via CLI in such case without going trough interactive mode? I overcame 1st interaction, but stucked with 2nd.
$ echo "Koyaanisqatsi" | ./download_mp3.py
What are you looking for? Searching..
| # | Artist | Track Title | Bitrate | Size |
|-----+---------------------------+-------------------------------------------------------+-----------+-----------|
| 1 | Philip Glass | Koyaanisqatsi | 320 Kb/s | 7.864 Mb |
| 2 | Philip Glass | ♫ Pruit Igoe | VBR | 9.694 Mb |
| 3 | Philip Glass | Koyaanisqatsi(Тяжелый взгляд уборщика) | 128 Kb/s | 3.144 Mb |
| 4 | Philip Glass | Koyaanisqatsi... | 320 Kb/s | 16.815 Mb |
| 5 | Phillip Glass | Koyaanisqatsi | VBR | 5.434 Mb |
| 6 | Philip Glass | Koyaanisqatsi | 192 Kb/s | 4.724 Mb |
| 7 | Philip Glass | Koyaanisqats ("Тяжелый взгляд Уборщика" OST Клиника) | 192 Kb/s | 4.724 Mb |
| 8 | Philip Glass | Koyaanisqatsi ("Тяжелый взгляд Уборщика" OST Клиника) | 256 Kb/s | 5.404 Mb |
| 9 | Philip Glass | Pruit Igoe | VBR | 9.844 Mb |
| 10 | Philip Glass | Koyaanisqatsi | 320 Kb/s | 7.844 Mb |
| 11 | Philip Glass | KOYAANISQATSI (Full version) | 320 Kb/s | 16.815 Mb |
| 12 | Philip Glass | Prophecies (Koyaanisqatsi) | VBR | 11.225 Mb |
| 13 | Philip Glass | Koyaanisqatsi | 320 Kb/s | 8.714 Mb |
| 14 | Philip Glass | SloMo People | 319 Kb/s | 7.614 Mb |
| 15 | Philip Glass | Life out of Balance | 128 Kb/s | 3.144 Mb |
| 16 | Phillip Glass | Koyaanisqats | VBR | 5.434 Mb |
| 17 | Philip Glass | Koyaanisqatsi ([Scrubs] тяжелый взгляд уборщика) | 192 Kb/s | 4.724 Mb |
| 18 | Koyaanisqatsy | Memoria (The Awakening) | VBR | 18.415 Mb |
| 19 | Philip Glass | Prophecies | VBR | 12.095 Mb |
| 20 | Philip Glass - Prophecies | Без названия | 160 Kb/s | 9.364 Mb |
Enter the song # you'd like to download, or press [Enter] to quit. Traceback (most recent call last):
File "./download_mp3.py", line 111, in <module>
display_results(search_string)
File "./download_mp3.py", line 86, in display_results
user_choice = raw_input(user_prompt)
EOFError: EOF when reading a line
$