12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- aws_access_key_id = 'AKIA2E67UIMD45Y3HL53'
- aws_secret_access_key = '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'
- REGION_NAME = 'us-east-1' # e.g
- from datetime import datetime
- startTime =datetime(2019, 11, 15,2,0)
- endTime =datetime(2019, 11, 15,4,0)
- print(startTime)
- print(endTime)
- def lmm():
- import boto3
- print('1234')
- STREAM_NAME = "oxoxo"
- kvs = boto3.client("kinesisvideo")
- # Grab the endpoint from GetDataEndpoint
- endpoint = kvs.get_data_endpoint(
- APIName="GET_HLS_STREAMING_SESSION_URL",
- StreamName=STREAM_NAME
- )['DataEndpoint']
- print(endpoint)
- print('----------')
- # Grab the HLS Stream URL from the endpoint
- kvam = boto3.client("kinesis-video-archived-media", endpoint_url=endpoint)
- url = kvam.get_hls_streaming_session_url(
- StreamName=STREAM_NAME,
- PlaybackMode="LIVE_REPLAY",
- HLSFragmentSelector={
- 'FragmentSelectorType': 'PRODUCER_TIMESTAMP',
- 'TimestampRange': {
- 'StartTimestamp': startTime,
- 'EndTimestamp': endTime
- }
- },
- )['HLSStreamingSessionURL']
- print(url)
- exit()
- lmm()
- exit()
- import boto3
- boto3_session = boto3.Session(aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_access_key_id)
- kv_client = boto3_session.client('kinesisvideo',region_name='us-east-1')
- STREAM_NAME = "oxoxo"
- print(STREAM_NAME)
- endpoint = kv_client.get_data_endpoint(
- APIName="GET_HLS_STREAMING_SESSION_URL",
- # APIName="ListStreams",
- StreamName=STREAM_NAME
- )['DataEndpoint']
- print(endpoint)
- exit()
- res = kv_client.describe_stream(StreamName='test_stream')
- print(res)
|