Page 1 of 1

cclive problems (for me)SOLVED

Posted: Sat Oct 03, 2015 4:29 pm
by rust collector
So, I have tried adipositas, and proof, but I can not get the cclive thing working.

I get an error, saying "clive not found"

I have mplayer, youtube-dl installed

Also, is cclive supposed to work in a plain tty with bash, framebuffer, or ?? (does it work in tmux, or dvtm? or even in X?)

I am sure it is something very simple, that I am missing, but I am not sure where to start?

Re: cclive problems (for me)

Posted: Sat Oct 03, 2015 7:45 pm
by machinebacon
To make it work in elinks (pressing o on a link in youtube) you need to

nano ~/.elinks

press Ctrl-\ and then enter clive and change the value to cclive

edit ~/.ccliverc, it should just contain this one line:

exec = /usr/bin/mplayer %f

Sorry about these, the syntax changed when clive changed to cclive in Debian.

It is supposed to work in X and framebuffer (not necessary to go into framebuffer mode in TTY first). In dvtm and tmux it will probably not work.

If you are in X, you need to edit ~/.mplayer/conf to *NOT* use fbdev2.

Re: cclive problems (for me)

Posted: Sat Oct 03, 2015 8:05 pm
by rust collector
aha! thank you!

I get a new error now, but it is mpalyer, so I can probably figure that out.

Re: cclive problems (for me)

Posted: Sat Oct 03, 2015 8:20 pm
by machinebacon
Sure it's an "error"? Might be "exec = /usr/bin/mplayer %I" instead of %f, but mplayer always throws some "warnings" (like LIRC no supported), this needs the --really-quiet option then.

Re: cclive problems (for me)

Posted: Sat Oct 03, 2015 8:38 pm
by rust collector
I will tinker, and see what I can figure out.
If I get something useful, I will post it here.

Re: cclive problems (for me)

Posted: Mon Oct 05, 2015 8:47 pm
by rust collector
Well, I believe the problem is that it downloads the file from the youtube link, which is stored like:

The Sexy Cat Jumps Over A Moving Train .

so mplayer does not see it properly, and believes it is 8 separate files.

If I type mplayer Th[tab] it does not find it.
If I type mv Th[tab] it does, and it replaces the spaces, and I can move back, and replace mv with mplayer, and it works.

So I guess I have to figure out how to sed or awk the file name, to replace the spaces, before running mplayer.

I figure I could run the file renaming thing before the mplayer line in .ccliverc?

Oh well, that is all I have today. I hope I am not completely wrong, lol

Re: cclive problems (for me)

Posted: Mon Oct 05, 2015 9:07 pm
by pidsley
Here is a modification of rhowaldt's fclean script that should take care of the spaces.

Code: Select all

#!/bin/bash

#replace spaces and other junk in file names

for OLDNAME in *; do
    NEWNAME=$(echo $OLDNAME | tr ' ' '-' | tr '_' '-' | tr [A-Z] [a-z])
    mv -v "$OLDNAME" "$NEWNAME"
done
Just use the first part of the "tr" line if you only want to clean one filename, and only care about spaces.

What if you use this in .ccliverc? (Or some other way to surround the filename in quotes -- I did not test this.)

Code: Select all

exec = /usr/bin/mplayer \"%f\"

Re: cclive problems (for me)

Posted: Mon Oct 05, 2015 9:39 pm
by rust collector
Thanks for those.
I tried the second idea, and it is not working yet, but that is a good idea.

Re: cclive problems (for me)

Posted: Tue Oct 06, 2015 12:16 pm
by rhowaldt
definitely, fclean the fuck out of all your files. if you want the full script (which cleans a bit more than pidsley's modification) let me know and i will post it (it probably is on the forums somewhere already but can't be fucked to search). oh well, since it is no effort whatsoever, here it is:

Code: Select all

#!/bin/bash
# obtained from paramthegreat @ Arch forums
# replaces spaces with underscores
# removes unwanted characters
# makes everything lowercase
# replaces hyphen after numbers with underscore

ls | while read -r FILE
do
    mv -v -- "$FILE" `echo $FILE | tr ' ' '_' | tr -d '[{}(),\!]' | tr -d "\'" | tr '[A-Z]' '[a-z]' | sed 's/\([0-9][0-9]\)-/\1_/'`
done
exit 0
pidsley's is different i see not only in what it removes but also in how it is executed, doesn't use the ugly ls to while loop pipe etc. this works for me so i use it, a lot. you are old enough to make your own decisions ;)

Re: cclive problems (for me)

Posted: Tue Oct 06, 2015 1:49 pm
by rust collector
Hmm, it also seem like mplayer wants an .mp4, or flv, or whatever at the end?
You can force feed it, and it works, but...

Otoh, if I use youtube-dl the filename is "correct".
I need to learn much more to get cclive working, so I guess I will just use youtube-dl for now.

Thanks for those cleanup tools.

Added later:

So, pidsley was right... again.

I put this in .ccliverc

Code: Select all

 exec = /usr/bin/mplayer "%f" 
and it works (I am still in x, on smoothie. Going to try it on adiposita now.

Oh, and mplayer can be replaced with mpv, if you want. (at least in x)

Added even later

Works on adipositas too, even in (or on top of) dvtm.

Thanks people!

Re: cclive problems (for me)SOLVED

Posted: Wed Oct 07, 2015 2:54 am
by machinebacon
clive needs to update their fucking manpage :(

Re: cclive problems (for me)

Posted: Wed Oct 07, 2015 6:25 am
by darry1966
Russy wrote:
and it works (I am still in x, on smoothie. Going to try it on adiposita now.

Oh, and mplayer can be replaced with mpv, if you want. (at least in x"

Thanks people!

Yes enjoying Mpv, very low on resources.:)