- raise FlickrError('License does not look like CC: %s' % license_url)
- license_name = 'CC %s %s' % (m.group(1).upper(), m.group(2))
+ re_pd = re.compile(r'https?://creativecommons.org/publicdomain/([^/]*)/([^/]*)/.*')
+ m = re_pd.match(license_url)
+ if not m:
+ raise FlickrError('License does not look like CC: %s' % license_url)
+ if m.group(1).lower() == 'zero':
+ license_name = 'Public domain (CC0 %s)' % m.group(2)
+ else:
+ license_name = 'Public domain'
+ else:
+ license_name = 'CC %s %s' % (m.group(1).upper(), m.group(2))