parser

This page describes parser module which can be imported as vlivepy.parser

format_epoch()

vlivepy.parser.format_epoch(epoch: Union[int, float], fmt: str)[source]

This is the function for formatting epoch to string easily.

Parameters
  • epoch (int) – Epoch timestamp.

  • fmt (str) – Format-string to format Epoch.

Returns

str. Formatted epoch time.

max_res_from_play_info()

vlivepy.parser.max_res_from_play_info(play_info: dict)dict[source]

This is the parser for finding maximum resolution from play info (FVideo, VOD).

Parameters

play_info (dict) – Play info dict to find maximum resolution.

Returns

dict. Video data that has maximum resolution from play_info

next_page_checker()

vlivepy.parser.next_page_checker(page: dict)Optional[str][source]

This is the parser for checking “nextParams” from react page data for automatic paging in get*Iter function.

Parameters

page (dict) – Page data from get(Comments, Posts, etc..)

Returns

str. “after” parameter for paging. This returns None if response doesn’t have “nextParams”

response_json_stripper()

vlivepy.parser.response_json_stripper(parsed_json_dict: dict, silent: bool = False, raise_message=False)Optional[dict][source]

General parser for normalize response data format of json. This parses result and deletes response code. Also strip “data” field when dealing with membership response.

Parameters
  • parsed_json_dict (dict) – Loaded json data to normalize.

  • silent (bool, optional) – Return None instead of raising exception, defaults to False.

  • raise_message (bool, optional) – Raise exception instead of warning, defaults to False.

Returns

dict. Parsed json data

v_timestamp_parser()

vlivepy.parser.v_timestamp_parser(ts: Union[str, int])float[source]

This is the function for parsing VLIVE timeunit(microsecond epoch) to float second.

Parameters

ts (Union[str, int]) – VLIVE epoch time to parse.

Returns

float. parsed epoch.