@@ -70,7 +70,7 @@ def mark_record_processed(table, record_id):
7070def process_person (record ):
7171 fields = record ['fields' ]
7272
73- email = fields ['email' ]
73+ email = fields ['email' ]. strip ()
7474
7575 name = fields ['name' ]
7676 name = utils .clean_name (name )
@@ -93,9 +93,9 @@ def process_person(record):
9393
9494 if 'picture' in fields :
9595 picture_record = fields ['picture' ][0 ]
96- image_location = picture_record ['url' ]
96+ image_location = picture_record ['url' ]. strip ()
9797 elif 'picture_url' in fields :
98- image_location = fields ['picture_url' ]
98+ image_location = fields ['picture_url' ]. strip ()
9999 else :
100100 raise Exception ('no image' )
101101
@@ -213,9 +213,9 @@ def process_book(record):
213213
214214 if 'book_cover' in fields :
215215 picture_record = fields ['book_cover' ][0 ]
216- image_location = picture_record ['url' ]
216+ image_location = picture_record ['url' ]. strip ()
217217 elif 'book_cover_url' in fields :
218- image_location = fields ['book_cover_url' ]
218+ image_location = fields ['book_cover_url' ]. strip ()
219219 else :
220220 raise Exception ('no image' )
221221
@@ -282,12 +282,13 @@ def find_matching_podcasts_youtube(youtube_id):
282282 if 'youtube' not in event :
283283 continue
284284
285- event_youtube_url = event ['youtube' ]
285+ event_youtube_url = event ['youtube' ]. strip ()
286286 if '?v=' not in event_youtube_url :
287287 print (f'wrong url: { event_youtube_url } , skipping it...' )
288288 continue
289289
290290 event_youtube_id = event_youtube_url .split ('?v=' )[1 ]
291+ event_youtube_id = event_youtube_id .strip ()
291292
292293 if event_youtube_id == youtube_id :
293294 matches .append (event )
@@ -304,16 +305,17 @@ def process_podcast(record):
304305 season = int (fields ['season' ])
305306 episode = int (fields ['episode' ])
306307
307- youtube_url = fields ['youtube_url' ]
308+ youtube_url = fields ['youtube_url' ]. strip ()
308309 youtube_id = youtube_url .split ('?v=' )[1 ]
310+ youtube_id = youtube_id .strip ()
309311
310312 matching_event = find_matching_podcasts_youtube (youtube_id )
311313
312- title = matching_event ['title' ]
314+ title = matching_event ['title' ]. strip ()
313315 short = matching_event .get ('short' , title )
314316
315317 if 'slug' in matching_event :
316- slug = matching_event ['slug' ]
318+ slug = matching_event ['slug' ]. strip ()
317319 else :
318320 slug = utils .slugify_title (short )
319321
@@ -322,10 +324,10 @@ def process_podcast(record):
322324 podcast_id = f's{ season :02d} e{ episode :02d} -{ slug } '
323325 image_path = f'images/podcast/{ podcast_id } .jpg'
324326
325- apple_url = fields ['apple_url' ]
326- spotify_url = fields ['spotify_url' ]
327+ apple_url = fields ['apple_url' ]. strip ()
328+ spotify_url = fields ['spotify_url' ]. strip ()
327329
328- anchor_url = fields ['anchor_url' ]
330+ anchor_url = fields ['anchor_url' ]. strip ()
329331 anchor_url = anchor_url .replace ('/pod/pod/' , '/pod/' )
330332
331333 anchor_id = anchor_url [len ('https://anchor.fm/datatalksclub/episodes/' ):]
@@ -425,15 +427,15 @@ def pull_events():
425427def process_event (record ):
426428 fields = record ['fields' ]
427429
428- email = fields ['email' ]
430+ email = fields ['email' ]. strip ()
429431 speaker = utils .lookup_author_id (email )
430432
431- title = fields ['event_title' ]
433+ title = fields ['event_title' ]. strip ()
432434
433435 date_raw = fields ['date' ]
434436 date = utils .parse_date (date_raw )
435437
436- url = fields ['url' ]
438+ url = fields ['url' ]. strip ()
437439 event_type = fields ['event_type' ]
438440
439441 params = {
0 commit comments