JadedCtrl / shellTube

💀 Shell YouTube client. (🪞)
https://hak.xwx.moe/jadedctrl/shelltube
GNU General Public License v3.0
24 stars 3 forks source link

search not working #3

Closed hoijui closed 5 years ago

hoijui commented 7 years ago

hey! :-) am on Trisquel 7 in bash and using shellTube from this repo as of 26. april 2017. i start:

./shellTube

then try to search:

>> / funny
./lib/yt-search: 32: [: -i: unexpected operator
./lib/yt-search: 42: ./lib/yt-search: Syntax error: "(" unexpected
sed: -e expression #1, char 1: unknown command: `f'
sed: -e expression #1, char 1: unknown command: `f'
No video specified.

any idea? am i doing it wrong?

happyGNU commented 7 years ago

try ./shelltube.sh >>help

It will give you an output like

>>help clear Clear the screen. download Download the selected video. exit Exit Shelltube. help Display this message. metadata Display selected video's metadata. search Perform a search. stream Stream the selected video. video Select video based on URL or ID.

So now you can remember commands :)

You can do >>search funny

  1. https://lifeawesome.net/ Life Awesome | </div | kwoLsW_qDYE
  2. AFV Funny Vines Fails Compilation - Best Vines 2016 VineAholic | </div | 0pxaHyz_E5w
  3. Funny videos 2016 : Stupid people doing stupid things YTLaugh | </div | GgxSvFoQ59k
  4. TRY NOT TO LAUGH or GRIN - Funny Kids Fails Compilation 2017 - Co Viners Co Viners | </div | vhkcRxCXcyo

You have to copy the ID of the video the part after |</div| and write video ID

>> video kT_KMsh1ARs

and it will output something like this

>> video kT_KMsh1ARs

Top New Zach King Funny Magic Vines - Best Magic Tricks Ever JokerIsME | 7365920 | </div><div class="yt-lockup-content"><h3 class="yt-lockup-title "><a href="/watch?v=kT_KMsh1ARs" class="yt-uix-tile-link yt-ui-ellipsis yt-ui-ellipsis-2 yt-uix-sessionlink spf-link " data-sessionlink="itct=CCYQ3DAYACITCJql_s-Uw9MCFQNbPwod3r0M4yj0JFILa1RfS01zaDFBUnM" title="Top New Zach King Funny Magic Vines - Best Magic Tricks Ever" aria-describedby="description-id-978209" rel="spf-prefetch" dir="ltr">Top New Zach King Funny Magic Vines - Best Magic Tricks Ever</a><span class="accessible-description" id="description-id-978209"> - Duración: 16:53</span></h3><div class="yt-lockup-byline "><a href="/channel/UC1A6qwJmTY77-n_HqqLNUFw" class="g-hovercard yt-uix-sessionlink spf-link " data-ytid="UC1A6qwJmTY77-n_HqqLNUFw" data-sessionlink="itct=CCYQ3DAYACITCJql_s-Uw9MCFQNbPwod3r0M4yj0JA" >JokerIsME</a>&nbsp;<span class="yt-uix-tooltip yt-channel-title-icon-verified yt-sprite" title="Verificada"></span></div><div class="yt-lockup-meta "><ul class="yt-lockup-meta-info"><li>Hace 1 mes</li><li>7,284,271 vistas</li></ul></div><div class="yt-lockup-description yt-ui-ellipsis yt-ui-ellipsis-2" dir="ltr">Top New Zach King Funny Magic Vines - Best Magic Tricks Ever More Zach King magic vines : <a href="https://youtu | 2017-03-24 | kT_KMsh1ARs kT_KMsh1ARs >>

So now do stream

kT_KMsh1ARs >> stream

Formats: 1. mp4,hd720 2. webm,medium 3. mp4,medium 4. 3gpp,small 5. 3gpp,small >>

Select prefered format (this case 2)

>>2

Enjoy :) (it will use VLC so make sure you have it)

JadedCtrl commented 7 years ago

Hey, that might be a usage error, like alberto pointed out-- "/ this" should be "/this" It also might be an issue with the first line of the script, "#!/bin/sh" Running the script with "./" instead of "bash" invokes sh, which in some systems (including Trisquel, I think) means dash. Shelltube does not support dash. Every attempt at being compatible with dash has broken compatibility with a few other shells... it's just not worth it. You should try replacing "#!/bin/sh" with "#!/bin/bash" in every script of Shelltube. Please try this and get back to me-- I can't test on bash right now, so I'd really appreciate it! :)

hoijui commented 7 years ago

thanks guys! :-) but it seems to be neither of the two... i made sure that bash is used with:

find . -name "s*" -o -name "y*" | xargs sed --in-place --expression='s|bin/sh|bin/bash|'

and - as i already tried before - i tried with "/funny" or "search funny", and i still get the same problem (plus some new ones!):

 >> search funny
./shelltube: line 48: yt-search: command not found
sed: -e expression #1, char 1: unknown command: `f'
sed: -e expression #1, char 1: unknown command: `f'
./shelltube: line 54: yt-meta: command not found

looks like the aliases are not working.. no idea why, cause that if statement is evaluated as true.

$ /bin/bash --version
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
JadedCtrl commented 7 years ago

Thanks, I'll check it out. :)

JadedCtrl commented 5 years ago

Well, it's been a while, jajaja-- but with this re-write, this isn't a problem anymore.