Translate Ideas and Comments
Choose language:
There was an error during translation

Settings and activity

  1. 49 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    5 comments  ·  Developers » API  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    Tenosis commented  · 

    With the announcement of the upcoming shutdown of the v5 API, I'm appalled that something this essential still hasn't been implemented. To give you an idea of how important it is, *Twitch itself* REQUIRES this information in order to have the "Watch Full Video" link on clip pages.

    Without this information, my service (StreamXRef) won't be able to use clips as a cross-reference point since there would be no way to know when in the video the clip occurred.

    Tenosis supported this idea  · 
  2. 5 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    3 comments  ·  Developers » API  ·  Flag idea as inappropriate…  ·  Admin →
    An error occurred while saving the comment
    Tenosis commented  · 

    With the older v5 API I can just do the following in Python:

    duration = timedelta(seconds=int(data["length"]))

    With the Helix API endpoint, I had to set up the following function instead (ignore the dashes since spacing at the start was removed):

    hms_pattern = re.compile(r"(?:(?P<hours>\d+)h)?(?:(?P<minutes>\d+)m)?(?P<seconds>\d+)s", re.I)

    def parse_hms(hms_string: str) -> timedelta:
    ----tdict = dict()
    ----tmatch = re.search(hms_pattern, hms_string)
    ----if tmatch is None:
    --------raise ValueError
    ----for k, v in tmatch.groupdict().items():
    --------tdict[k] = 0 if v is None else int(v)
    ----return timedelta(**tdict)

    Tenosis supported this idea  ·