playflash.pet

Audio editors, music players, video players, burning software, etc.
Post Reply
Message
Author
User avatar
Tman
Posts: 808
Joined: Sat 22 Jan 2011, 21:39
Location: Toronto

playflash.pet

#1 Post by Tman »

I recently came a across a fantastic script from stu90 when I stumbled across this thread:
http://www.murga-linux.com/puppy/viewtopic.php?t=70690

What the script does is it plays youtube videos from Mplayer, instead of the Adobe Flashplayer. This takes up less resources, allowing smoother playback on older machines.

I then decided to package stu90's script into a pet with an icon entry in the Multimedia folder. One can then link the play_flash.desktop file to the desktop or to a quick launch bar.

For this to work, you must have Mplayer installed. ( or Gnome-Mplayer )

Instructions:

1) Launch a youtube video from your favorite browser and pause the video once you see it begins to play.
2) Launch playflash from the menu and the video should open up in Mplayer
- alternatively, you can also type playflash in the terminal

enjoy! :wink:
Attachments
playflash.jpg
playflash in action
(43.04 KiB) Downloaded 1359 times
playflash.pet
Play youtube videos in Mplayer
(2.56 KiB) Downloaded 643 times
Last edited by Tman on Mon 10 Oct 2011, 01:26, edited 1 time in total.

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

#2 Post by Tman »

I have discovered that you also need a pupsavefile for playflash to work.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#3 Post by jpeps »

You can also save the video by copying the /proc file, so it's helpful to create a log:

Code: Select all

#!/bin/sh
var="$(stat -c %N /proc/*/fd/* 2>&1|awk -F[\`\'] '/lash/{print$2}')"
echo "$var" >/tmp/flash  
mplayer -cache 1000 ${var} 

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#4 Post by 8-bit »

Is it possible to plug playflash into a browser as an external application and remove flashplayer from the browser?
Or would flashplayer still be needed?
I know quite a few users would like to have an alternative to flashplayer and trying to keep up with security updates.

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#5 Post by pemasu »

http://groups.google.com/group/gecko-me ... 08c99fe6de

I havent tested it...yet. But it sounds worth of a test.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#6 Post by 8-bit »

pemasu,
Thank you for the link. I run the latest version of SeaMonkey and will give it a try along with removal of flashplayer.
I am curious though as to how it would handle a flash file that tried to run bad code on a PC.
I normally have NoScript, Better Privacy, and ghost as well as flashblock installed in SeaMonkey as addons.

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

#7 Post by DaveS »

pemasu wrote:http://groups.google.com/group/gecko-me ... 08c99fe6de

I havent tested it...yet. But it sounds worth of a test.
Could not get FF7 to use it :(
Spup Frugal HD and USB
Root forever!

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#8 Post by pemasu »

Found this post when searching more info of that script:
https://github.com/Rob-ot/Youtube-Without-Flash

stu90

#9 Post by stu90 »

pemasu wrote:Found this post when searching more info of that script:
https://github.com/Rob-ot/Youtube-Without-Flash
Hi Pemasu,
The readme on there says the script is broken:
At the time of writing this the script is broken, sorry, its been broken for a while actually and I dont have time to hack on it anymore (same old story - finished college, got a fulltime job) so I am hoping by putting it on github you other hackers can apply your ideas and have at it.

If someone out there is interested in being a maintainer email me at dsmlover@gmail.com.
requirements: you must not suck at javascript, you must hate flash :D

I will also post a branch with my prototype for a full on flash replacing framework I started making although thats probably broken on youtube too.

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#10 Post by pemasu »

Yep. Thats why I posted the link. Just did it from work, so I didnt have time to quote.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#11 Post by MU »

for me the only reliable method is to run mplayer with the temporary flashfile in /tmp, like /tmp/FlashXxgrdt.

Unfortunately, new flashplayers no longer store it there :(

As I use opera as defaultbrowser, I placed the NEW flashplayer somewhere like /root/newflash/libflashplayer.so
Then in operas options, in the plugin settings, I have set the pluginpath to /root/newflash/.

To grab videos from youtube, I use firefox with the OLD flashplayer /root/.mozilla/plugins/libflashplayer.so (firefox uses the player there by default, it is version 10,0,15,3).

Like this I have two browsers, one with the new player for sites that need it, and one with the old player.

To view a video now in mplayer, I use the old playflash script I posted here:
http://www.murga-linux.com/puppy/viewtopic.php?t=34008

You'll need this old flashplayer:
http://noforum.de/files/libflashplayer. ... 5.3.tar.gz


Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

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

#12 Post by Tman »

Mu,

I had no idea your playflash.pet existed until today. Same name too . Image

Perhaps someone would be able to merge code from both playflash pets. We could have a utility that scans the new folder where flashplayer stores its temporary files and have Mplayer launch it.
An on/off function for it would be good as well, so it doesn't constantly scan for videos every few seconds when one isn't using the internet. My coding skills are weak, but I might be able to do this...might

The link that Pemasu posted, is an even better idea, but I wouldn't how to to implement it, as it is beyond my skills.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#13 Post by MU »

no problem about the name, it was just a simple script, as small utility.
Feel free to use it/extract what you need, and continue it as "playflash".

I'm currently too busy to continue it, so I'm happy if the fragments can help others in newer projects.

I had googled about the topic some weeks ago, and if I remember well, the new flashplayers do no longer store a single flashfile.
The file is splitted in parts, what makes it more difficult to grab it.
I found it too complicated to find out the exact mechanism, and so installed the old flashplayer instead.
Maybe meanwhile people found a solution that can be found with google though :)

Greets, Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#14 Post by muggins »

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!

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

#15 Post by Tman »

muggins,

I use a Firefox plugin to save streaming video, but that's a great script for non-Firefox users.
MU wrote: Feel free to use it/extract what you need, and continue it as "playflash".
Thank you MU, but it may not be necessary for me to continue modifying playflash.
After a bit of googling, I discovered a plugin for Firefox that will allow users to play flash videos with a stand-alone video player. I tried it with Gnome-mplayer, regular Mplayer and VLC. It was a bit slow to react with VLC but worked with all three players You just need to install the plugin and adjust the preferences.

Of course, this only helps Firefox users.

https://addons.mozilla.org/addon/flashvideoreplacer/
Attachments
FlashVideoReplacer.jpg
(37.61 KiB) Downloaded 1362 times

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