def _parse_json(self, json_string, video_id, transform_source=None, fatal=True):
    if transform_source:
        json_string = transform_source(json_string)
    try:
        return json.loads(json_string)
    except ValueError as ve:
        errmsg = ('%s: Failed to parse JSON ' % video_id)
        if fatal:
            raise ExtractorError(errmsg, cause=ve)
        else:
            self.report_warning((errmsg + str(ve)))
def _parse_json(self, json_string, video_id, transform_source=None, fatal=True):
    if transform_source:
        json_string = transform_source(json_string)
    try:
        return json.loads(json_string)
    except ValueError as ve:
        errmsg = ('%s: Failed to parse JSON ' % video_id)
        if fatal:
            raise ExtractorError(errmsg, cause=ve)
        else:
            self.report_warning((errmsg + str(ve)))