Advertisement
Frannoe

DownFlash

Sep 16th, 2012
385
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. # By Frannoe@gmail.com
  4. # http://ubuntu-cosillas.blogspot.com/
  5. #-----------------------------------------------
  6. #Note:
  7. #Part of this code has been written by ajvajv:
  8. #lsof -n|grep Flash|while read ;
  9. #do
  10. #R1=`echo $REPLY|cut -d' ' -f2`;
  11. #R2=`echo $REPLY|cut -d' ' -f4`;
  12. #cp /proc/$R1/fd/${R2:0:2} video$R1$R2.flv;
  13. #done
  14. #------------------------------------------------
  15. if lsof -n|grep Flash
  16.     then
  17.        lsof -n|grep Flash|while read
  18. mkdir -p $HOME/DownFlash/
  19.      do
  20.        R1=`echo $REPLY|cut -d' ' -f2`
  21.        R2=`echo $REPLY|cut -d' ' -f4`
  22.      if cp /proc/$R1/fd/${R2:0:2} $HOME/DownFlash/video_$R1$R2.flv
  23.           then
  24.        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?"
  25.              if [ $? -eq 1 ]
  26.                   then
  27.                   zenity --error --title "Cancelado" --text="Todas las descargas han sido canceladas"
  28.                   break
  29.  
  30.              fi
  31.      else
  32.        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"
  33.        break
  34.      fi
  35.   done
  36. else
  37. 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."
  38.   fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement