This code change involves a restructure related to how FFprobe parses metadata into tags. This is related to issue 658, where given a video that does not comply fully with the parser it fails to add values to an empty key '' in the dictionary. This also condenses duplicate code previously in _parse_input_meta and _parse_meta.
Expected behavior
Return a FFprobe object when instantiated
from pyffmpeg import FFprobe
fp = FFprobe('video.mp4')
Actual behavior
178 # this might be a continuation
179 if key == '':
--> 180 tags[prev_key] += "\\r\\n" + data[1].strip()
181 else:
182 tags[key] = value
KeyError: ''
Reproducing Issue
Steps to reproduce original issue is an extension of #658 where if you add print statements inside of the for loop of _parse_meta there exist keys that are empty strings due to an attempt of formatting/decoration of the YouTube short link. With the usage of a base dictionary this causes a KeyError in the attempt to merge the list with a nonexistent one.
Overview
This code change involves a restructure related to how
FFprobe
parses metadata into tags. This is related to issue 658, where given a video that does not comply fully with the parser it fails to add values to an empty key''
in the dictionary. This also condenses duplicate code previously in_parse_input_meta
and_parse_meta
.Expected behavior
Return a
FFprobe
object when instantiatedActual behavior
Reproducing Issue
Steps to reproduce original issue is an extension of #658 where if you add print statements inside of the for loop of
_parse_meta
there exist keys that are empty strings due to an attempt of formatting/decoration of the YouTube short link. With the usage of a base dictionary this causes aKeyError
in the attempt to merge the list with a nonexistent one.Tests