From f08271689504ab6b752146fcf47a95130e309d17 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Mon, 10 Feb 2020 04:21:41 +0100 Subject: [PATCH] The name of an author is the second word (if no ,) --- media/scraper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/scraper.py b/media/scraper.py index 931f2c6..7861a0a 100644 --- a/media/scraper.py +++ b/media/scraper.py @@ -99,7 +99,10 @@ class BedetequeScraper: if illustrator: data['author'].append(illustrator.group(1)) - side_identifier = "{:.3} {:.3}".format(data['author'][0].upper(), data['title'].upper(),) + author_name = data['author'][0] + if ',' not in author_name: + author_name = author_name.split(' ')[1] + side_identifier = "{:.3} {:.3}".format(author_name.upper(), data['title'].upper(),) if data['subtitle']: start = data['subtitle'].split(' ')[0].replace('.', '') print("start:", start)