Saving Youtube Videos in Fedora
Petrus de Calguarium
pgueckel at gmail.com
Wed Jun 15 17:32:45 UTC 2011
Suvayu Ali wrote:
> On Wed, 15 Jun 2011 00:26:57 -0400
> james tate <binarynut at comcast.net> wrote:
>
>> At one time Youtube videos were being temp. downloaded while playing
>> to the /tmp directory where you could save from, but now it seems
>> that is no longer the case.
>>
>> Where are they being temp. downloaded to in Fedora now ?
>
> Two solutions:
>
> 1. # yum install youtube-dl
> 2. I use this shell function sometimes: (beware of word wrapping)
>
> function play_flash()
> {
> for idx in $(pgrep -u $USER -f 'flashplayer\.so'); do
> echo "Browser:" $(egrep 'Name:' /proc/${idx}/status| cut -f 2) "PID:" $idx
> echo -n " FDs:"
> for fd in $(lsof -p $idx|egrep '/tmp/Flash'|egrep -o -E '\<[0-9]+[a-z]\>'|
> tr -d 'a-z'); do
> echo -n " $fd"
> done
> echo
> echo
> done
>
> echo "Select browser (by PID) and file descriptor (space separated)"
> read -p ': ' PID FD
> echo
> [ ! -z ${PID} ] && mplayer -ontop $@ /proc/${PID}/fd/${FD}
> }
>
> GL
>
I have been using your old version for months now, since we last conversed on
this subject, and it is the best!!!
I had a little problem, however, as I use flash with nspluginwrapper, so
grepping on libflashplayer.so didn't quite work.
I had to kind of dissect your code, as I don't know how to write such a
complex script, and this is what I use at present...
*
To save flash videos currently displayed in Firefox, get the pid of the flash
plugin (and nspluginwrapper, if being used) and the file descriptors for the
flash files.
Without nspluginwraper:
ps -fu yourlogin | egrep 'libflashplayer\.so'
With nspluginwrapper:
ps -fu yourlogin | egrep 'libflashplayer\.so' | egrep 'npviewer.bin'
Navigate to:
/proc/<pid_from_above>/fd
Copy the deleted /tmp/Flash* files:
cp <links_to_deleted_files> ~/Documents/tmp/
More information about the users
mailing list