|
@@ -19,26 +19,26 @@ import urllib
|
|
|
|
|
|
###########
|
|
|
host = "oss-cn-shenzhen.aliyuncs.com" # just for example
|
|
|
-accessid = "LTAI5pJxXXklo2ve"
|
|
|
-accesskey = "ngFu11aTJmA0BoYmt8WT7JyyQ2Wmx1"
|
|
|
+accessid = "LTAIXSozepSx81xe"
|
|
|
+accesskey = "19BlxRiAHDPLx4mhz6vQZRuhK0eKed"
|
|
|
bucket_name = "testrtmp"
|
|
|
channel_name = "test-channel"
|
|
|
auth = Auth(accessid, accesskey)
|
|
|
bucket = Bucket(auth, host, bucket_name)
|
|
|
######################
|
|
|
# 生成oss签名url
|
|
|
-url = bucket.sign_url('GET', 'test-channel/test.m3u8', 60 * 60, params={'x-oss-process': 'hls/sign'})
|
|
|
-url = urllib.parse.unquote(url, encoding='utf-8', errors='replace')
|
|
|
-print(url)
|
|
|
-
|
|
|
-exit()
|
|
|
+# url = bucket.sign_url('GET', 'test-channel/test.m3u8', 60 * 60, params={'x-oss-process': 'hls/sign'})
|
|
|
+# url = urllib.parse.unquote(url, encoding='utf-8', errors='replace')
|
|
|
+# print(url)
|
|
|
+#
|
|
|
+# exit()
|
|
|
# 播放m3u8
|
|
|
-m3list = bucket.post_vod_playlist(channel_name=channel_name, playlist_name='test.m3u8', start_time=1537336020119,
|
|
|
- end_time=1537336029318)
|
|
|
+# m3list = bucket.post_vod_playlist(channel_name=channel_name, playlist_name='test.m3u8', start_time=1537336020119,
|
|
|
+# end_time=1537336029318)
|
|
|
|
|
|
-exit()
|
|
|
+# exit()
|
|
|
# 获取推流地址
|
|
|
-channel_cfg = LiveChannelInfo(target=LiveChannelInfoTarget())
|
|
|
+channel_cfg = LiveChannelInfo(target=LiveChannelInfoTarget(frag_count=10))
|
|
|
channel = bucket.create_live_channel(channel_name, channel_cfg)
|
|
|
publish_url = channel.publish_url
|
|
|
signed_publish_url = bucket.sign_rtmp_url("test-channel", "playlist.m3u8", 3600)
|