DEV Community

Sérgio Araújo
Sérgio Araújo

Posted on

2 2

Get youtube video title on termux

Intro

The main reason of this tutorial is to share an akward experience I used to have on android and solve it. Sometimes when I share a video from youtube on twitter it only shares the url for the video. I wanted also get the title, so I wrote this script

#!/data/data/com.termux/files/usr/bin/bash

URL=$(termux-clipboard-get)

TITLE=$(youtube-dl --skip-download --get-title --no-warnings $URL | sed 2d | awk '{print tolower($0)}')

echo "$TITLE' '$URL"  | tee termux-clipboard-set


Enter fullscreen mode Exit fullscreen mode

Setting pbcopy and pbpaste using termux

Open your termux and run

apt install termux-api neovim
Enter fullscreen mode Exit fullscreen mode

Now on your termux edit your ~/.bashrc

alias pbcopy='termux-clipboard-get'
alias pbpaste='termux-clipboard-set'
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay