Tuesday, 3 April 2018

linux - gpaste get as STDIN for youtube-dl


I'm still fairly new to linux. I've been a user for about 2 months. I understand how to do basic pipings with grep and write STDOUT to text files.


I'm trying to do something similar with my clipboard utility gpaste. I'd like to use the text that I copy URL info from my gui browser and paste it into a terminal command. The next step would be to learn how to scrape this information automatically and run it through similar manipulations, but let's not get ahead of ourselves.


My process, I open gpaste ui and copy the youtube url in question. It gets entered into gpaste history. When I enter gpaste get [#] the correct entry is returned, great.


However when I attempt to manipulate that data in another application, like youtube-dl, I run into the error "gpaste is not a recognizable url."


Here's what I've tried:


youtube-dl | gpaste 0
gpaste get [#] | youtube-dl

Not very creative, I know, but what the hey...


Any suggestions?



Answer



Are you sure youtube-dl can read from stdin? If so your second example should work.


Try youtube-dl $(gpaste get [#])


To make sure $(gpaste get [#]) returns what you expect you can first do echo $(gpaste get [#])


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...