diff options
-rwxr-xr-x | jamos | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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(): |