dotfiles/scripts/prefix/bin/yt

18 lines
409 B
Text
Raw Normal View History

2017-08-21 11:56:07 +02:00
#!/bin/sh
YoutubeBrowser=$(which chromium-browser)
2016-03-25 12:28:57 +01:00
BaseSearchUrl=" --incognito https://www.youtube.com/results?search_query="
BaseUrl="https://www.youtube.com/feed/subscriptions"
# Any args?
if [[ -n "$@" ]]
then
# Concat 'em
SearchTerm=$(echo "$@" | sed 's/ /+/g')
# Search on youtube privately
$YoutubeBrowser $BaseSearchUrl$SearchTerm
else
# Open my subscriptions
$YoutubeBrowser $BaseUrl
fi