playflash.pet

Audio editors, music players, video players, burning software, etc.
Post Reply
Message
Author
jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#16 Post by jpeps »

muggins wrote:To save videos I use this script I googled:

Code: Select all

#!/usr/bin/env bash

for flashpid in $(pgrep -f flashplayer.so); do
cd "/proc/$flashpid/fd"
for video in $(file * | grep '/tmp/Flash' | sed 's/\(^[0-9]*\).*/\1/g'); do
echo "/proc/$flashpid/fd/$video"
cp "/proc/$flashpid/fd/$video" /mnt/home/vids/$1
done
done
So if I call it savevid, run like savevid videoname.

Doesn't work with dailymotion now, as they changed something to stymie!
I used a slightly different approach by adding a "-c" option to the flash script, where it copies to a designated folder with a date:minute stamp instead of playing it:

Code: Select all

#!/bin/sh

## USEAGE"  [-c] to copy video 

DIR="/mnt/sda2/Desktop/myvideos"  ## save directory 
var="$(stat -c %N /proc/*/fd/* 2>&1|awk -F[\`\'] '/lash/{print$2}')" 
echo "$var" >/tmp/flash

[ "$1" ] || sudo mplayer -cache 1000 ${var} 

## Log only working file in /tmp/flash 
while read line; do 
    var="$(ls -l ${line} 2>/dev/null | grep "Flash")"
        if [ ! "$var" ]; then 
          dl="$( echo ${line} | cut -d/ -f3)"
          sed -i "/$dl/d" /tmp/flash 
        fi
done </tmp/flash

if [ "$1" == "-c" ]; then
  nm="$(date +%d-%m-%y:%M)"
  cp `cat /tmp/flash`  "${DIR}/${nm}.vid"
fi

User avatar
Tman
Posts: 808
Joined: Sat 22 Jan 2011, 21:39
Location: Toronto

#17 Post by Tman »

Earlier, I recommended the FlashVideoReplacer plugin for Firefox but after using it to watch Youtube videos for a while, I found that sometimes it would skip and once in a while there would be problems with the video blacking out. So overall, I think that using playflash gives smoother playback.
FYI, one can alter the script for use with gnome-mplayer as well.

Post Reply