Advertisement
Frannoe

DownFlash

Sep 16th, 2012
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.73 KB | None | 0 0
  1. #!/bin/bash
  2. # Script(Gui)to download it in the folder /Home/User/DownFlas videos that are playing Firefox or Chrome
  3. # http://ubuntu-cosillas.blogspot.com/
  4. #-----------------------------------------------
  5. #Note:
  6. #Part of this code has been written by ajvajv:
  7. #lsof -n|grep Flash|while read ;
  8. #do
  9. #R1=`echo $REPLY|cut -d' ' -f2`;
  10. #R2=`echo $REPLY|cut -d' ' -f4`;
  11. #cp /proc/$R1/fd/${R2:0:2} video$R1$R2.flv;
  12. #done
  13. #------------------------------------------------
  14. if lsof -n|grep Flash
  15.     then
  16.        lsof -n|grep Flash|while read
  17. mkdir -p $HOME/DownFlash/
  18.      do
  19.        R1=`echo $REPLY|cut -d' ' -f2`
  20.        R2=`echo $REPLY|cut -d' ' -f4`
  21.      if cp /proc/$R1/fd/${R2:0:2} $HOME/DownFlash/video_$R1$R2.flv
  22.           then
  23.        zenity --question --title "Vídeos Flash Player" --text="El vídeo <b>$R1$R2.flv</b> ha sido descargado en la siguiente ruta:\n<b> $HOME/DownFlash/ </b>\n\n¿Desea comprobar si quedan más vídeos para descargar?"
  24.              if [ $? -eq 1 ]
  25.                   then
  26.                   zenity --error --title "Cancelado" --text="Todas las descargas han sido canceladas"
  27.                   break
  28.  
  29.              fi
  30.      else
  31.        zenity --info --title "Sin más datos" --text="No hay más <b>vídeos</b> que se estén reproducciendo\no se puedan descargar en este momento"
  32.        break
  33.      fi
  34.   done
  35. else
  36. zenity --info --title "Aviso" --text="No hay vídeos de <b>Flash Player</b> reproduciendose en su navegador.\n\nAsegúrese de que los vídeos que quiera descargarse han comenzado su reproducción aunque sea una vez y contengan\npreferiblemente su Buffer al completo para que la descarga se realice en su totalidad y no tan sólo en parte.\nLuego vuelva a intentarlo."
  37.   fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement