diff options
Diffstat (limited to 'AirPlayService.py')
| -rw-r--r-- | AirPlayService.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/AirPlayService.py b/AirPlayService.py index 9e6ef3b..3c9557c 100644 --- a/AirPlayService.py +++ b/AirPlayService.py | |||
| @@ -25,6 +25,7 @@ import platform | |||
| 25 | import socket | 25 | import socket |
| 26 | import threading | 26 | import threading |
| 27 | import time | 27 | import time |
| 28 | import uuid | ||
| 28 | from datetime import datetime, date | 29 | from datetime import datetime, date |
| 29 | from urlparse import urlparse | 30 | from urlparse import urlparse |
| 30 | from ZeroconfService import ZeroconfService | 31 | from ZeroconfService import ZeroconfService |
| @@ -215,11 +216,15 @@ class AirPlayService(asyncore.dispatcher): | |||
| 215 | self.bind((host, port)) | 216 | self.bind((host, port)) |
| 216 | self.listen(5) | 217 | self.listen(5) |
| 217 | self.remote_clients = [] | 218 | self.remote_clients = [] |
| 219 | macstr = "%012X" % uuid.getnode() | ||
| 220 | self.deviceid = ''.join("%s:" % macstr[i:i+2] for i in range(0, len(macstr), 2))[:-1] | ||
| 221 | self.features = 0x07 # 0x77 on iOS 4.3.1 | ||
| 222 | self.model = "AppleTV2,1" | ||
| 218 | 223 | ||
| 219 | # create avahi service | 224 | # create avahi service |
| 220 | if (name is None): | 225 | if (name is None): |
| 221 | name = "Airplay Service on " + platform.node() | 226 | name = "Airplay Service on " + platform.node() |
| 222 | self.zeroconf_service = ZeroconfService(name, port=port, stype="_airplay._tcp", text=["Name="+name]) | 227 | self.zeroconf_service = ZeroconfService(name, port=port, stype="_airplay._tcp", text=["deviceid="+self.deviceid,"features="+hex(self.features),"model="+self.model]) |
| 223 | 228 | ||
| 224 | # publish avahi service | 229 | # publish avahi service |
| 225 | self.zeroconf_service.publish() | 230 | self.zeroconf_service.publish() |
