Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Monitor connections to iTunes4 sharing - method #2 Network

With the release of iTunes 4, interest in library sharing is growing. The iTunes Sharing preference pane tells you how many people are connected to your library, but not who they are. Here's a one-line terminal command (shown on two with the "" continuation character, so cut and paste should work) to show who is browsing your iTunes library:


  netstat -f inet -W | awk '$4 ~ /3689/ {print "iTunes connection from: "$5}' \
  | sed -e 's/\.[^.]*$//g'
If you want to kick off a specific user, all I can think to do is to add a rule to your firewall:
  sudo ipfw add deny tcp from (user) to any 3689
This blocks connections from that user to your iTunes sharing port. If anyone has further ideas or wants to wrap this into a pretty app, I'd love to see it!

PS: Note that sharing your library with strangers may violate the iTunes EULA; it may or may not fall under the "personal use" that you "click agree" to when you turn on the sharing feature. Share at your own risk.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[12,424 views]  

Monitor connections to iTunes4 sharing - method #2 | 8 comments | Create New Account
Click here to return to the 'Monitor connections to iTunes4 sharing - method #2' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Monitor connections to iTunes4 sharing - method #2
Authored by: jlgregg on May 02, '03 10:29:35AM
There's a great little widget called RedezWho for Konfabulator to show who is listening to your shared music. I'm sure with a little hacking it can be made to boot people, too.

[ Reply to This | # ]
Complete script for download
Authored by: mithras on May 02, '03 11:39:56AM

Since submitting that hint, I've put some improvement together in a shell script.

You can download the script, or copy-and-paste it.


Sample output:

[mithras@jukebox: ~] itunesshare
6 users browsing, 1 listening.
 
--- Browsers ---
port-212-202-171-27.reverse.qdsl-home.de
cdm-208-110-230-fayt.cox-internet.com
port-212-202-171-27.reverse.qdsl-home.de
50.muef.cmbr.bstma01r1.dsl.att.net
pcp155460pcs.lambrv01.nj.comcast.net
vdsl7.sttl.uswest.net
 
--- Listeners ---
50.muef.cmbr.bstma01r1.dsl.att.net
 
--- Files ---
/Volumes/Music/mp3s//Bill Monroe/The Millenium Collection/05 In The Pines.mp3

I also made this little PHP image script, whose code you can read here

---
--
Listen To My iTunes Library (6500+ songs, iTunes 4 required)

[ Reply to This | # ]

Complete script for download
Authored by: mithras on May 02, '03 11:40:32AM

Since submitting that hint, I've put some improvement together in a shell script.

You can download the script, or copy-and-paste it.


Sample output:

[mithras@jukebox: ~] itunesshare
6 users browsing, 1 listening.
 
--- Browsers ---
port-212-202-171-27.reverse.qdsl-home.de
cdm-208-110-230-fayt.cox-internet.com
port-212-202-171-27.reverse.qdsl-home.de
50.muef.cmbr.bstma01r1.dsl.att.net
pcp155460pcs.lambrv01.nj.comcast.net
vdsl7.sttl.uswest.net
 
--- Listeners ---
50.muef.cmbr.bstma01r1.dsl.att.net
 
--- Files ---
/Volumes/Music/mp3s//Bill Monroe/The Millenium Collection/05 In The Pines.mp3

I also made this little PHP image script, whose code you can read here

---
--
Listen To My iTunes Library (6500+ songs, iTunes 4 required)

[ Reply to This | # ]

Complete script for download
Authored by: joeholmes on May 02, '03 05:04:23PM

Hmmm.

I get this error:

sh: -/: unrecognized option

Any ideas? (And thanks for the script!)

-=-Joe



[ Reply to This | # ]
Meta-character issues?
Authored by: navratil on May 02, '03 01:18:21PM
There seems to be an issue with having shell meta-characters in the name of the track -- if a song has an ampersand, single (or double?) quotes, parenthesis, etc it won't be displayed. Interestingly (to me), dollar signs don't appear to cause problems.

Of course, this appears to be some sort of limitation in lsof, rather than the script offered. Does anyone know a way around this?

[ Reply to This | # ]

Monitor connections to iTunes4 sharing - method #2
Authored by: sigma8 on May 02, '03 05:39:07PM

This utility is great. Does anybody know of any way to find out
whose music YOU'RE listening to? There's someone on my
network (a campus) that has some good stuff. I'm listening to it
and am curious who it is. Their iTunes4 sharename is not very
helpful.



[ Reply to This | # ]
Monitor connections to iTunes4 sharing - method #2
Authored by: Johnny_B on May 04, '03 08:21:49AM

This will work at some point:
sudo lsof -i :3689
Can also be used on ports like :80 (Apache, webserver) etc.



[ Reply to This | # ]
Monitor connections to iTunes4 sharing - method #2
Authored by: bleed on May 05, '03 07:38:57AM

Does anyone know how to find out the URL of the stream that I am listening to.



[ Reply to This | # ]