- url_node = find_xpath_attr(sources, 'source', 'id', 'HQ on')
- if url_node is None:
- url_node = find_xpath_attr(sources, 'source', 'id', 'HQ off')
+ url_node = next(node for node in [find_xpath_attr(sources, 'source', 'id', 'HQ %s' % key)
+ for key in ['on', 'av', 'off']] if node is not None)