def get_info_mpris2(name):
<EOL>bus_name = '<STR_LIT>' + name<EOL>path = '<STR_LIT>'<EOL>interface = '<STR_LIT>'<EOL>address = DBusAddress(path, bus_name=bus_name, interface=interface)<EOL>msg = Properties(address).get('<STR_LIT>')<EOL>connection = connect_and_authenticate()<EOL>response = connection.send_and_get_reply(msg)<EOL>metadata = dict(response[<NUM_LIT:0>][<NUM_LIT:1>])<EOL>keys = ['<STR_LIT>', '<STR_LIT:title>', '<STR_LIT>', '<STR_LIT>']<EOL>info = {}<EOL>metadata = {k: v for k, v in metadata.items() if '<STR_LIT>' in k}<EOL>for key, value in metadata.items():<EOL><INDENT>name = key.split('<STR_LIT::>')[<NUM_LIT:1>].lower()<EOL>value = value[<NUM_LIT:1>]<EOL>if name not in keys or name in info:<EOL><INDENT>continue<EOL><DEDENT>if isinstance(value, list):<EOL><INDENT>value = value[<NUM_LIT:0>]<EOL><DEDENT>info[name] = value<EOL><DEDENT>if '<STR_LIT>' in info:<EOL><INDENT>info['<STR_LIT>'] = info['<STR_LIT>']<EOL>del info['<STR_LIT>']<EOL><DEDENT>return Song(**info)<EOL>
Get the current playing song from an mpris2 compliant player.