# URL sniffer ? [SOLVED]

## darkarchon

Anyone know of a good URL sniffer on Linux ? Something similar or better than Net Transport on Windows. 

I am looking to extract the URL of streaming media. 

Thanks!

----------

## alex.blackbit

provide an example of a file/url that contains a url you want to extract.

----------

## darkarchon

Please go to this PBS Nova website and click on the "Windows Media (hi)" link for Chapter 1. The direct link is here.

The URL Sniffer of Net Transport (XP) extracts the URLs as shown in this screenshot. The text format of the extracted URLs is below:

```
http://media.pbs.org/asxgen/general/windows/wgbh/nova/zero-3501c01-350.wmv.asx?v1st=226A26B770E8D356&vsdomain=pbs

rtsp://pbs.wmod.llnwd.net/a1863/e1/general/windows/wgbh/nova/zero-3501c01-350.wmv?v1st=92A5E859B49EFE60&vsdomain=pbs
```

I cannot get this website to work properly in Gentoo (using Firefox and the mplayerplug-in), although other sites work fine. Basically, I am looking to see if I can extract the direct URLs for streaming media, so I can download the media and watch it locally.

----------

## alex.blackbit

unfortunately i cannot follow this link, because i am not located in the u.s.

just try a curl on that url.

----------

## darkarchon

That works really well. I have included the curl output. Thanks!   :Very Happy: 

```
saab@lungi ~ $ curl "http://www.pbs.org/wgbh/nova/programs/ht/as/3501_01.asx"

<asx version="3.0">

      <entry>

                <ref href="http://media.pbs.org/asxgen/general/windows/wgbh/nova/zero-3501c01-350.wmv.asx?v1st=none&vsdomain=pbs" />

      </entry>

</asx>

saab@lungi ~ $ curl "http://media.pbs.org/asxgen/general/windows/wgbh/nova/zero-3501c01-350.wmv.asx?v1st=none&vsdomain=pbs"

<ASX Version = "3.0">

  <ENTRY>

    <REF HREF = "mms://pbs.wmod.llnwd.net/a1863/e1/general/windows/wgbh/nova/zero-3501c01-350.wmv?v1st=none&vsdomain=pbs"/>

  </ENTRY>

</ASX>

saab@lungi ~ $ mplayer "mms://pbs.wmod.llnwd.net/a1863/e1/general/windows/wgbh/nova/zero-3501c01-350.wmv?v1st=none&vsdomain=pbs"
```

----------

## alex.blackbit

as you see, there is no black magic in getting those urls.

you can use a simple sed expression or something similar to open such a stream with mplayer directly.

please mark the thread [SOLVED] if you are satisfied.

----------

## tarpman

Last I checked mplayer supported the ASX format; you should be able to play that URL directly.

----------

## Alanceil

 *tarpman wrote:*   

> Last I checked mplayer supported the ASX format; you should be able to play that URL directly.

 

Don't forget to add the -playlist option to mplayer, or you will run in problems along the way.

As for the URL sniffing, you could set up wireshark and use the 'Edit -> Find Packet -> String' function (or some filters) to find URLs.

----------

## darkarchon

 *Alanceil wrote:*   

> Don't forget to add the -playlist option to mplayer, or you will run in problems along the way.

 

You are indeed correct. The following command worked, and I was able to watch the video. Thanks!

```
mplayer -playlist "http://media.pbs.org/asxgen/general/windows/wgbh/nova/zero-3501c01-350.wmv.asx?v1st=none&vsdomain=pbs"
```

----------

## darkarchon

 *alex.blackbit wrote:*   

> please mark the thread [SOLVED] if you are satisfied.

 Done. Thanks for the reminder.   :Very Happy: 

----------

