Merge pull request #26290 from garbear/peripheral-improvements
[xbmc.git] / addons / metadata.generic.albums / lib / wikipedia.py
blobbfc6c318f02492b4d2c146dbf1610f01d1083fed
1 # -*- coding: utf-8 -*-
2 import re
4 def wikipedia_albumdetails(data):
5 albumdata = {}
6 # check in case musicbrainz did not provide a direct link
7 if 'extract' in data['query']['pages'][0] and not data['query']['pages'][0]['extract'].endswith('may refer to:'):
8 albumdata['description'] = re.sub('\n\n\n== .*? ==\n', ' ', data['query']['pages'][0]['extract'])
9 return albumdata