mirror of
https://github.com/elenapan/dotfiles.git
synced 2025-12-26 23:34:57 +08:00
Add ability to search video to rofi_mpvtube script (#77)
This commit is contained in:
parent
a31b2aa26a
commit
06458c76a2
1 changed files with 3 additions and 2 deletions
|
|
@ -56,9 +56,10 @@ main() {
|
|||
|
||||
# Get URL
|
||||
linktoplay="$(grep -m 1 "$choice" $playlist_file | cut -d '@' -f 2)"
|
||||
# If the choice does not exist, exit
|
||||
# If the choice does not exist, try searching for it
|
||||
if [ ${#linktoplay} -eq "0" ]; then
|
||||
exit 1
|
||||
yid=$(youtube-dl ytsearch:"$choice" -s | grep "\[youtube\]" | cut -d ']' -f 2 | awk -F ':' '{print $1}' | cut -c 2-)
|
||||
linktoplay=https://www.youtube.com/watch\?v\="$yid"
|
||||
fi
|
||||
|
||||
# Send notification
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue