Skip to content

Commit

Permalink
Merge pull request gabrielmagno#6 from jamincollins/master
Browse files Browse the repository at this point in the history
gracefully handle devices that don't support AVTransport
  • Loading branch information
gabrielmagno authored Jan 16, 2021
2 parents 1489bf2 + 6480d4b commit 9a29823
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions nanodlna/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ def register_device(location_url):

friendly_name = info.find("./device/friendlyName").text

path = info.find(
"./device/serviceList/service/[serviceType='{0}']/controlURL".format(
UPNP_DEFAULT_SERVICE_TYPE
)
).text
action_url = urllibparse.urljoin(location_url, path)
try:
path = info.find(
"./device/serviceList/service/"
"[serviceType='{0}']/controlURL".format(
UPNP_DEFAULT_SERVICE_TYPE
)
).text
action_url = urllibparse.urljoin(location_url, path)
except AttributeError:
action_url = None

device = {
"location": location_url,
Expand Down

0 comments on commit 9a29823

Please sign in to comment.