|
@@ -188,7 +188,9 @@ def get_audio_from_description(text):
|
|
|
except ValueError:
|
|
|
logging.warning('could not parse txdate %s', metadata['txdate'])
|
|
|
del metadata['txdate']
|
|
|
- a = Audio(unquote(url), metadata.get('durata', None))
|
|
|
+ a = Audio(unquote(url),
|
|
|
+ duration=metadata.get('durata', None),
|
|
|
+ date=metadata.get('txdate', None))
|
|
|
|
|
|
if 'txdate' in metadata and 'replica' in metadata:
|
|
|
if metadata['replica'].endswith('g'):
|
|
@@ -214,7 +216,6 @@ def get_audio_from_dir(dirpath):
|
|
|
|
|
|
|
|
|
def get_item_date(el):
|
|
|
- # TODO: pick from txdate=
|
|
|
el_date = el.find('pubdate')
|
|
|
if el_date is not None:
|
|
|
return datetime.datetime.strptime(
|
|
@@ -234,7 +235,8 @@ def get_urls(tree):
|
|
|
except Exception as exc:
|
|
|
logging.info('error getting duration for `%s`' % title)
|
|
|
continue
|
|
|
- audio.date = get_item_date(it)
|
|
|
+ if audio.date is None:
|
|
|
+ audio.date = get_item_date(it)
|
|
|
yield audio
|
|
|
|
|
|
|