diff --git a/guessfilename/__init__.py b/guessfilename/__init__.py index 63cb704..f277837 100755 --- a/guessfilename/__init__.py +++ b/guessfilename/__init__.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -PROG_VERSION = u"Time-stamp: <2022-08-11 17:26:57 vk>" +PROG_VERSION = u"Time-stamp: <2023-01-02 12:45:43 vk>" # TODO: @@ -935,6 +935,7 @@ class GuessFilename(object): "extractor" in data.keys() and \ "display_id" in data.keys() and \ "ext" in data.keys() and \ + "duration_string" in data.keys() and \ "fulltitle" in data.keys(): if data['upload_date'] and len(data['upload_date']) == 8 and \ @@ -942,7 +943,7 @@ class GuessFilename(object): logging.debug('derive_new_filename_from_json_metadata: found all ' + 'required meta data for YouTube download file style') # example from unit tests: "2007-09-13 youtube - The Star7 PDA Prototype - Ahg8OBYixL0.mp4" - return data['upload_date'][:4] + '-' + data['upload_date'][4:6] + '-' + data['upload_date'][6:] + ' ' + data["extractor"] + ' - ' + data["fulltitle"] + ' - ' + data["display_id"] + '.' + data["ext"] + return data['upload_date'][:4] + '-' + data['upload_date'][4:6] + '-' + data['upload_date'][6:] + ' ' + data["extractor"] + ' - ' + data["fulltitle"] + ' - ' + data["display_id"] + ' ' + data["duration_string"] + '.' + data["ext"] else: logging.debug('derive_new_filename_from_json_metadata: found all required meta data ' + 'for YouTube download file style but upload_date or extractor_key do ' + diff --git a/guessfilename_test.py b/guessfilename_test.py old mode 100755 new mode 100644