m = re.search(r'modelExport: (\{.*\})', html)
try:
assert m
- download_url = 'https:' + json.loads(m.group(1))['main']['photo-models'][0]['sizes']['o']['url']
+ download_url = 'https:' + json.loads(m.group(1))['main']['photo-models'][0]['data']['sizes']['data']['o']['data']['url']
except (AssertionError, ValueError, IndexError, KeyError):
raise FlickrError('Error reading image URL.')
return {
if wikidata_match is not None:
qitem = wikidata_match.group(1)
client = Client()
+ client.opener.addheaders = [(
+ 'User-Agent', 'Wolne Lektury Redakcja / Python-wikidata'
+ )]
entity = client.get(qitem)
meta['title'] = entity.label.get('pl', str(entity.label))
author = entity.get(client.get(WIKIDATA.CREATOR))