From a93bf72318c96c4fee369744f06283211e898c17 Mon Sep 17 00:00:00 2001 From: Jackson Taylor Date: Mon, 15 Nov 2021 15:01:00 -0500 Subject: Prevent empty dates from not tagging years --- jamos | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'jamos') diff --git a/jamos b/jamos index 2e6350e..30b2d32 100755 --- a/jamos +++ b/jamos @@ -61,9 +61,15 @@ def write_metadata_to_song_file(file, metadata): def format_youtube_date(date): - fmt = "%Y%m%d" - d = datetime.datetime.strptime(date, fmt) - return d.year + default = "Unknown Year" + try: + fmt = "%Y%m%d" + d = datetime.datetime.strptime(date, fmt) + return d.year + except Exception as ex: + print(ex) + + return default def sort_stuff(): -- cgit v1.2.3