Ok so i like watching flash videos online, but dont like it when they get removed or the fullscreen button doesnt work. So i did a bit of investigation and discovered this website. He has some good explanations of packet sniffing with wireshark and howto use wget, you dont really need to read these but i suggest you do as it will give you better understanding of what your doing!


The tools
So before we begin i am running Linux (Ubuntu Gutsy) but it should work on all linux and Mac OSX. You will need to download a couple of programs:


 
     tshark - required for capturing the packets.
 

 
     curl - this is required for downloading some urls that wget doesnt work with.
 

 
     this shell script - this parses the packets you capture and downloads the flv files. You can download this to any location, but for this example we will assume you have it on your desktop.
 

on ubuntu to install curl and tshark type in the following commands sudo apt-get install curl sudo apt-get install tshark


The Method

 
     Grab a beer
 
 
     open a terminal window
 

 
     enter the command sudo tshark -i eth0 > ~/Desktop/packets.txt and enter your password
 

 
     when tshark starts capturing visit this video on veoh (or any video you like)
 

 
     When the video starts playing you can close your browser window (repeat step 3 and 4 as many times as you wish)
 

 
     Switch to terminal and type Ctrl+c to stop tshark
 

 
     In terminal run the parseflv.sh shell script you downloaded earlier sh ~/Desktop/parseflv.sh ~/Desktop/downloads/ domo
 

 
     Your video should start downloading to the folder you specified in the shell script
 


Explanation

 
     First we open a terminal window and start tshark capturing packets on eth0 which is your ethernet port, if you are using wifi, or this doesnt capture any packets then you can type ifconfig to find out what the name of your device is. (my wifi is wifi0 so try that)
 

 
     you need to be root to use tshark and see all your network interfaces, so you need to use sudo and enter your password
 

 
     You can visit any video, ive found that all the videos on veoh and dailymotion work well, and all the links on sidereel seem to work fine. Youtube and Google videos dont work with this method at the moment (i assume they have some super stealth swf mechanism for fetching their flvs).
 

 
     You can repeat steps 3 & 4 as many times as you like, eg to download a full series
 

 
     The parseflv script takes 2 arguments, the first is the folder you want to download the flv's to, and the second is the prefix you wish to give these files. The script adds a counter to all your videos, so if you have the prefix S01E0 then your videos will be downloaded as S01E01, S01E02, S01E03 etc. Also the packets.txt and downloads.txt files are copied to your download directory for error checking.
 

At the moment this method is still a bit fiddly, a bit buggy, doesnt work on all sites and requires more actions than i would like, but for now it works well enough (i havent found a video on sidereel that it doesnt work on. I am planning to write this into a python application which will work on all platforms and just be a few button clicks.

Downloading flv videos on ubuntu and osx Sun, 06th Apr 2008

Ok so i like watching flash videos online, but dont like it when they get removed or the fullscreen button doesnt work. So i did a bit of investigation and discovered this website. He has some good explanations of packet sniffing with wireshark and howto use wget, you dont really need to read these but i suggest you do as it will give you better understanding of what your doing!

The tools

So before we begin i am running Linux (Ubuntu Gutsy) but it should work on all linux and Mac OSX. You will need to download a couple of programs:

  • tshark - required for capturing the packets.
  • curl - this is required for downloading some urls that wget doesnt work with.
  • this shell script - this parses the packets you capture and downloads the flv files. You can download this to any location, but for this example we will assume you have it on your desktop.

on ubuntu to install curl and tshark type in the following commands sudo apt-get install curl sudo apt-get install tshark

The Method

  1. Grab a beer
  2. open a terminal window
  3. enter the command sudo tshark -i eth0 > ~/Desktop/packets.txt and enter your password
  4. when tshark starts capturing visit this video on veoh (or any video you like)
  5. When the video starts playing you can close your browser window (repeat step 3 and 4 as many times as you wish)
  6. Switch to terminal and type Ctrl+c to stop tshark
  7. In terminal run the parseflv.sh shell script you downloaded earlier sh ~/Desktop/parseflv.sh ~/Desktop/downloads/ domo
  8. Your video should start downloading to the folder you specified in the shell script

Explanation

  1. First we open a terminal window and start tshark capturing packets on eth0 which is your ethernet port, if you are using wifi, or this doesnt capture any packets then you can type ifconfig to find out what the name of your device is. (my wifi is wifi0 so try that)
  2. you need to be root to use tshark and see all your network interfaces, so you need to use sudo and enter your password
  3. You can visit any video, ive found that all the videos on veoh and dailymotion work well, and all the links on sidereel seem to work fine. Youtube and Google videos dont work with this method at the moment (i assume they have some super stealth swf mechanism for fetching their flvs).
  4. You can repeat steps 3 & 4 as many times as you like, eg to download a full series
  5. The parseflv script takes 2 arguments, the first is the folder you want to download the flv's to, and the second is the prefix you wish to give these files. The script adds a counter to all your videos, so if you have the prefix S01E0 then your videos will be downloaded as S01E01, S01E02, S01E03 etc. Also the packets.txt and downloads.txt files are copied to your download directory for error checking.

At the moment this method is still a bit fiddly, a bit buggy, doesnt work on all sites and requires more actions than i would like, but for now it works well enough (i havent found a video on sidereel that it doesnt work on. I am planning to write this into a python application which will work on all platforms and just be a few button clicks.

Posted in :

Add your Comment

Navigation

Previous pic Previous Next pic Next