class_docstr: Youtube Video info  by video id Table implementation
class_docstr_tok: ["Youtube","Video","info","by","video","id","Table","implementation"]
code: def parse_duration(self, video_id, duration):
      try:
          parsed_duration = re.search(
              f"PT(\d+H)?(\d+M)?(\d+S)", duration
          ).groups()
          duration_str = ""
          for d in parsed_duration:
              if d:
                  duration_str += f"{d[:-1]}:"
  
          return duration_str.strip(":")
      except Exception as e:
          logger.error(
              f"Encountered an error while parsing duration for video ${video_id}: ${e}"
          ),
          return "Duration not available for this video"
  
imports: from typing import List
  from mindsdb.integrations.libs.api_handler import APITable
  from mindsdb.integrations.utilities.sql_utils import extract_comparison_conditions
  from mindsdb.utilities import log
  from mindsdb_sql.parser import ast
  from mindsdb.integrations.handlers.utilities.query_utilities import SELECTQueryParser, SELECTQueryExecutor, INSERTQueryParser
  import pandas
  import re
  from youtube_transcript_api import YouTubeTranscriptApi
  from youtube_transcript_api.formatters import JSONFormatter
label_desc: Use image node_id 5 for calling the YoutubeVideosTable obj's underlying member method code with example usage: obj.parse_duration(video_id, duration) and returns: duration_str, str