回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>当我运行下面的代码时,我会得到一个大的JSON响应,我如何才能只提取视频的URL</p>
<pre><code>from youtubesearchpython import VideosSearch
title = 'Video Name'
videosSearch = VideosSearch(title, limit = 0)
print(videosSearch.result())
</code></pre>
<p><a href="https://docs.google.com/document/d/181g-h6Mltw_L6mNrLDEHCaJvWQDqwngbUUFYc4Xnp8k/edit?usp=sharing" rel="nofollow noreferrer">Resul:</a></p>
<pre><code>{
"result":[
{
"type":"video",
"id":"JJTqk8P9VO0",
"title":"Kinemaster | how to create name intro || video editing tutorial",
"publishedTime":"2 years ago",
"duration":"9:02",
"viewCount":{
"text":"3,133,469 views",
"short":"3.1M views"
},
"thumbnails":[
{
"url":"https://i.ytimg.com/vi/JJTqk8P9VO0/hq720.jpg?sqp=-oaymwEjCOgCEMoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLAbhbrfMi-lkezgeIPVf--18BmW4A",
"width":360,
"height":202
},
{
"url":"https://i.ytimg.com/vi/JJTqk8P9VO0/hq720.jpg?sqp=-oaymwEXCNAFEJQDSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLCwJanhvro5scsjaWV8fRjfv81rvg",
"width":720,
"height":404
}
],
"descriptionSnippet":[
{
"text":"Kinemaster "
},
{
"text":"video",
"bold":true
},
{
"text":" editing tutorial how to create "
},
{
"text":"name",
"bold":true
},
{
"text":" intro android\\xa0..."
}
],
"channel":{
"name":"Samir creation,s",
"id":"UCE_4iIKu3jzS0ylJcZyhPJQ",
"thumbnails":[
{
"url":"https://yt3.ggpht.com/ytc/AAUvwniOMvDEaCNKl_vAuSjEyixNPCOdu20DR-EUSSQHKw=s68-c-k-c0x00ffffff-no-rj",
"width":68,
"height":68
}
],
"link":"https://www.youtube.com/channel/UCE_4iIKu3jzS0ylJcZyhPJQ"
},
"accessibility":{
"title":"Kinemaster | how to create name intro || video editing tutorial by Samir creation,s 2 years ago 9 minutes, 2 seconds 3,133,469 views",
"duration":"9 minutes, 2 seconds"
},
"link":"https://www.youtube.com/watch?v=JJTqk8P9VO0",
"shelfTitle":"None"
}
]
}
</code></pre>
<p><strong>我是Python新手,需要任何帮助。</strong></p>