Commit 94b3a1cd authored by Stefano Rivera's avatar Stefano Rivera

Add details_url field to videos

parent 0e0d10db
......@@ -52,6 +52,7 @@ videos:
description: >
The opening talk for DebConf X. We will introduce the DebConf Team, the
codes of conduct, and the nearest bar. Pollito will squawk.
details_url: https://debconfx.debconf.org/events/1/
room: plenary
start: 2038-01-18 03:00:00
end: 2038-01-18 03:30:00
......
......@@ -7,6 +7,7 @@ import argparse
import re
from datetime import datetime
from pathlib import Path
from urllib.parse import urljoin
from xml.etree import ElementTree
import dateutil.parser
......@@ -101,12 +102,20 @@ def scrape_videos(tree, conference, args):
section for section in description if section)
description = description.replace('\r\n', '\n')
details_url = penta_event.findtext('conf_url')
if details_url:
details_url = urljoin(conference.schedule, details_url)
else:
details_url = urljoin(
conference.schedule, 'events/{}.en.html'.format(id_))
start = datetime.combine(
date, parse_time(penta_event.findtext('start')))
end = start + parse_timedelta(penta_event.findtext('duration'))
event = Event(
title=title,
description=description,
details_url=details_url,
speakers=[
person.text for person in penta_event.iter('person')],
room=penta_event.findtext('room'),
......
......@@ -61,6 +61,7 @@ def scrape_videos(feed, conference, penta_events=None):
event = Event(
title=title,
description=entry['description'],
details_url=entry['link'],
video=video,
alt_formats={
'lq': 'lq/{}'.format(video),
......
......@@ -122,6 +122,7 @@ class Event(MappingObject):
'title',
'speakers',
'description',
'details_url',
'room',
'start',
'end',
......@@ -137,6 +138,7 @@ class Event(MappingObject):
'title': str,
'speakers': List(str),
'description': str,
'details_url': str,
'room': str,
'start': (date, datetime),
'end': (date, datetime),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment