擅长:python、mysql、java
<p>让它像这样工作:</p>
<pre><code>for i in clean_result['streams']:
if 'index' in i:
index_value = i['index']
if 'bit_rate' in i:
streambitrate_value = i['bit_rate']
if 'codec_name' in i:
codec_name_value = i['codec_name']
if 'codec_type' in i:
codec_type_value = i['codec_type']
if 'width' in i:
width_value = i['width']
if 'height' in i:
height_value = i['height']
if 'channel_layout' in i:
channel_layout_value = i['channel_layout']
if 'tags' in i and 'language' in i['tags']:
language_value = i['tags']['language']
new_stream = MediaStreams.objects.create(index=index_value, stream_bitrate=streambitrate_value,
codec_name=codec_name_value, codec_type=codec_type_value,
width=width_value, height=height_value,
channel_layout=channel_layout_value, language=language_value,
media=new_object)
new_stream.save()
</code></pre>