From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1I3ih7-0006Bf-9U for garchives@archives.gentoo.org; Thu, 28 Jun 2007 01:21:13 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l5S1JuTe004891; Thu, 28 Jun 2007 01:19:56 GMT Received: from mailout1.igs.net (mailout1.igs.net [216.58.97.34]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l5S1Flx6032734 for ; Thu, 28 Jun 2007 01:15:47 GMT Received: from waltdnes.org (i209-195-86-69.cia.com [209.195.86.69]) by mailout1.igs.net (Postfix) with SMTP id B9D2D61AF for ; Wed, 27 Jun 2007 16:15:25 -0400 (EDT) Received: by waltdnes.org (sSMTP sendmail emulation); Wed, 27 Jun 2007 21:15:42 -0400 From: "Walter Dnes" Date: Wed, 27 Jun 2007 21:15:41 -0400 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Downloading Flash videos Message-ID: <20070628011541.GA6828@waltdnes.org> References: <200706262143.04270.michaelkintzios@gmail.com> <200706270027.25841.volker.armin.hemmann@tu-clausthal.de> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200706270027.25841.volker.armin.hemmann@tu-clausthal.de> User-Agent: Mutt/1.5.13 (2006-08-11) X-Archives-Salt: 1fc999d4-eff6-42dd-a395-c56d3befb258 X-Archives-Hash: 4d88c3ef8c1606b1668e190091ac022c On Wed, Jun 27, 2007 at 12:27:25AM +0200, Hemmann, Volker Armin wrote > open site. Wait until flash starts to load > ls -lhtr /tmp > the last file, starting with FLASH is the one. > Wait for it to be fully loaded, copy it somewhere. There's an automated way of doing this. I've written a bash script that will find flash video files in the current directory *REGARDLESS OF THE NAME*, and move them over to a specified directory with sequential names, i.e. mm000.flv, mm001.flv, mm002.flv, etc. Here's the setup... 1) mkdir ~/mvflv 2) save the script below as ~/bin/mvflv and make it executable. This bash script is released under GPL version 2. You don't know me, so you may want to wade through the code to ensure that it doesn't do anything nasty, especially in the backtick expansions. (I originally wrote the decrement(), increment(), and getnextversion() functions for use with my system backups, so that they would be sequentially numbered). 3) cd to either /tmp or Firefox's Cache directory and execute mvflv The script lists each file it moves into ~/flvfiles ################################################################## #!/bin/bash decrement() { echo $(( $1 - 1 )) } increment() { echo $(( $1 + 1 )) } getnextversion() { NUMBER= DIGITPOINTER=0 while [ ${DIGITPOINTER} -lt ${1} ] do NUMBER=${NUMBER}0 DIGIT[${DIGITPOINTER}]=0 DIGITPOINTER=`increment ${DIGITPOINTER}` done while [ -e ${2}${NUMBER}${3} ] do DIGITPOINTER=`decrement ${1}` DIGITPNTLEFT=`decrement ${DIGITPOINTER}` DIGIT[${DIGITPOINTER}]=`increment ${DIGIT[${DIGITPOINTER}]}` NUMBER= while [ ${DIGITPOINTER} -ge 0 ] do if [ ${DIGIT[${DIGITPOINTER}]} -eq 10 ] then DIGIT[${DIGITPOINTER}]=0 if [ ${DIGITPNTLEFT} -gt 0 ] then DIGIT[${DIGITPNTLEFT}]=`increment ${DIGIT[${DIGITPNTLEFT}]}` fi fi NUMBER=${DIGIT[${DIGITPOINTER}]}${NUMBER} DIGITPOINTER=${DIGITPNTLEFT} DIGITPNTLEFT=`decrement ${DIGITPNTLEFT}` done done echo ${2}${NUMBER}${3} } for filename in * do if echo "`file ${filename}`" | grep "Macromedia Flash Video" ; then newfilename=`getnextversion 3 ~/flvfiles/mm .flv` mv ${filename} ${newfilename} echo ${newfilename} fi done ################################################################## -- Walter Dnes In linux /sbin/init is Job #1 Q. Mr. Ghandi, what do you think of Microsoft security? A. I think it would be a good idea. -- gentoo-user@gentoo.org mailing list