python - 在 MediaLive 中更改输入 URL

标签 python amazon-web-services boto3 aws-media-live

我正在尝试使用 python 中的 boto3 更新 Input MediaLive URL。

输入是 URL_PULL 类型 (HLS) 并附加到 channel ,我认为这是我的问题的根源。

account = { all credentials and stuff }
url = 'https://mynew/supercool/hls/playlist.m3u8'
client = boto3.client("medialive",
                      aws_access_key_id=account['access_key'],
                      aws_secret_access_key=account['key_secret'],
                      region_name=account['region_name'])

input_id = 1234567
client.update_input(InputId=input_id, Sources=[{'Url': url}])

代码运行良好,但出现此错误,我不知道如何处理:

An error occurred (BadRequestException) when calling the UpdateInput operation: You cannot change the input class of an input while it's attached to a channel. Please detach the input from the channel in order to switch its class.

问题:我应该使用哪个工作流程来更新已附加到 channel 的输入?

最佳答案

AWS API 在更新输入、主要和备份时需要 2 个 url。

client.update_input(InputId=input_id, Sources=[{'Url': url},{'Url': url}])

关于python - 在 MediaLive 中更改输入 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60263002/

相关文章:

python - 如何从/usr/lib/python2.7/dist-packages/中的 dir 获取源包

amazon-web-services - Cloudfront 访问被拒绝

python - 解析 boto3 输出 JSON

python - boto3 DynamoDB - 查询操作 : ExpressionAttributeNames contains invalid key

python - OpenCV 可以解码 H264 - MPEG-4 AVC(第 10 部分)

python - 内置属性错误: 'module' object has no attribute 'one_tile'

amazon-web-services - 如何配置 VPC 端点以使用 Terraform 访问 DynamoDB?

amazon-web-services - 从 SNS/SQS Auto Scaling 消息中提取 EC2InstanceId

python - 具有默认值但没有类型注释的函数参数的推断类型是什么?初始化为 'None' 的变量怎么样?

redirect - Amazon S3 重定向规则 - 缺少 GET 数据