diff options
author | Euro20179 <f> | 2021-03-01 13:25:41 -0800 |
---|---|---|
committer | Euro20179 <f> | 2021-03-01 13:25:41 -0800 |
commit | b22b2b56fd1a4f3dd316378281569fbb163cf09f (patch) | |
tree | 40b9c6dfb203031095f6f11331dc51af262b694e | |
parent | 39208f8d44006f3563b75e825732499b681484df (diff) | |
download | ytfzf-b22b2b56fd1a4f3dd316378281569fbb163cf09f.tar.gz |
fixed bug when n was more than results found
-rwxr-xr-x | ytfzf | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -300,8 +300,13 @@ user_selection () { [ -z "$shorturls" ] && exit; urls="" selected_data="" + #used so if n is more than results found it breaks + previous_url="" while read surl; do [ -z "$surl" ] && continue + # means it has found the last result + [ "$previous_url" = "$surl" ] && break + previous_url="$surl" urls="$urls\nhttps://www.youtube.com/watch?v=$surl" # to get back untrucated titles from formatting selected_data="$selected_data\n$(echo "$videos_data" | grep -m1 -e "$surl" )" |