Quote:
Originally Posted by jpollard
no limits on pipes or sub-processes (other than what ulimit -a would show).
I think you have a grouping error... between the quotes and the ). Normally, I would have also expected a syntax error as the sequence "-o -" makes it outside the subprocess handling all the rest...
It is possible that is also what remained attached to the terminal and caused the block as the previous commands would not have interpreted the "-o -"... and bash never saw it due to the sequence being blocked.
Removing the $( and ) would then have allowed bash to properly interpret the command sequence... and the "-o -" would have been handled.
|
Thank you for looking at this.
The expected result of
Code:
youtube-dl -q --max-downloads 1 --no-playlist 'https://www.youtube.com/watch?v='$(curl 'https://www.youtube.com/results?search_query='$(echo $1 | tr ' ' +) | grep -oe '"[[:alnum:]]\{11\}"' | sed -n 3p | cut -b 2-12) -o -
should translate to
youtube-dl -q --max-downloads 1 --no-playlist https://www.youtube.com/watch?v=Sy8iUI_ayuo -o -
This is supposed to pipe into mplayer. youtube-dl uses -o for output template and specifying - as stdout is supported. So it's not part of the subproccess but rather of the overall youtube-dl command.
I ended up placing the -o - behind the $() part - but this did not change anything.
Code:
pyt() { youtube-dl -q --max-downloads 1 --no-playlist -o - 'https://www.youtube.com/watch?v='$(curl -s 'https://www.youtube.com/results?search_query='$(echo $1 | tr ' ' +) | grep -oe '"[[:alnum:]]\{11\}"' | sed -n 3p | cut -b 2-12) | mplayer -vo null /dev/fd/3 3<&0 </dev/tty; }
Quote:
I think you have a grouping error... between the quotes and the )
|
Unfortunately I've got a lot of quotes and closing parenthesis.. I'm not sure where you're indicating.