希望从 YouTube URL 自动生成 bibliography-appropriate 元数据
Looking to automatically generate bibliography-appropriate metadata from YouTube URL
我需要以特定格式引用大约一百个 YouTube 视频,并且希望仅使用视频 URL 自动生成这些引用。
我知道现有网站可以执行此操作(例如,Scribbr),但为了提高效率,我需要输出格式与所提供格式不同的格式。
我有一些初级的HTML和Javascript能力,如果我有办法获取视频的标题、上传者的姓名和出版日期(月 DD,YYYY)作为字符串。但是,我不知道该怎么做。
我研究过从 https://www.youtube.com/oembed?url=urlgoeshere&format=json 获取数据,但似乎不包括日期,而且我不确定如何从中获取标题。
这个问题可能太模糊了,但是对于从哪里开始这个问题,您有什么建议吗?谢谢你的时间。
if I had a method of obtaining the title of a video, the name of the
uploader, and the date of publication (Month DD, YYYY) as strings.
要获取这些值,您可以按照以下步骤操作:
- 根据您的第一个请求(即:https://www.youtube.com/oembed?url=urlgoeshere&format=json),提取频道名称:
示例:
URL:
https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=6EHSlhnE6Ck&format=json
结果 - 为清楚起见格式化:
{
"title": "Understanding Digital Tracking",
"author_name": "GCFLearnFree.org",
"author_url": "https://www.youtube.com/user/gcflearnfree",
"type": "video",
"height": 113,
"width": 200,
"version": "1.0",
"provider_name": "YouTube",
"provider_url": "https://www.youtube.com/",
"thumbnail_height": 360,
"thumbnail_width": 480,
"thumbnail_url": "https://i.ytimg.com/vi/6EHSlhnE6Ck/hqdefault.jpg",
"html": "\u003ciframe width=\u0022200\u0022 height=\u0022113\u0022 src=\u0022https://www.youtube.com/embed/6EHSlhnE6Ck?feature=oembed\u0022 frameborder=\u00220\u0022 allow=\u0022accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\u0022 allowfullscreen\u003e\u003c/iframe\u003e"
}
- 提取用户名 - 通过读取“
author_url
”值:
"author_url":"https://www.youtube.com/user/gcflearnfree"
- 使用此请求获取视频的标题、上传者姓名和发布日期:
URL: https://www.youtube.com/feeds/videos.xml?user=<name_of_the_user>
- 将 <name_of_the_user>
替换为在步骤 2 中获得的名称。
示例:https://www.youtube.com/feeds/videos.xml?user=gcflearnfree
- 使用步骤 3 中显示的 URL 发出请求 - 您将获得这些结果:
示例:
<feed
xmlns:yt="http://www.youtube.com/xml/schemas/2015"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns="http://www.w3.org/2005/Atom">
<link rel="self" href="http://www.youtube.com/feeds/videos.xml?user=gcflearnfree"/>
<id>yt:channel:UCeYUHG6o0YguM-g23htdsSw</id>
<yt:channelId>UCeYUHG6o0YguM-g23htdsSw</yt:channelId> <-- Use channel_id instead.
<title>GCFLearnFree.org</title>
<link rel="alternate" href="https://www.youtube.com/channel/UCeYUHG6o0YguM-g23htdsSw"/>
<author>
<name>GCFLearnFree.org</name> <-- Name of the publisher
<uri>https://www.youtube.com/channel/UCeYUHG6o0YguM-g23htdsSw</uri>
</author>
<published>2007-02-27T15:22:42+00:00</published><-- Publication date
<entry>
<id>yt:video:xKuJrmlCdig</id>
<yt:videoId>xKuJrmlCdig</yt:videoId>
<yt:channelId>UCeYUHG6o0YguM-g23htdsSw</yt:channelId>
<title>What is HTML?</title><-- Title of the video
<link rel="alternate" href="https://www.youtube.com/watch?v=xKuJrmlCdig"/>
<author>
<name>GCFLearnFree.org</name>
<uri>https://www.youtube.com/channel/UCeYUHG6o0YguM-g23htdsSw</uri>
</author>
<published>2021-05-04T17:29:00+00:00</published>
<updated>2021-05-05T06:31:50+00:00</updated>
<media:group>
<media:title>What is HTML?</media:title>
<media:content url="https://www.youtube.com/v/xKuJrmlCdig?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
<media:thumbnail url="https://i1.ytimg.com/vi/xKuJrmlCdig/hqdefault.jpg" width="480" height="360"/>
<media:description>In this video, you’ll learn about HTML and how it is used to code webpages. We hope you enjoy! To learn more, check out our Basic HTML tutorial here: https://edu.gcfglobal.org/en/basic-html/ #whatishtml #htmlcode #learnhtml</media:description>
<media:community>
<media:starRating count="100" average="4.80" min="1" max="5"/>
<media:statistics views="1571"/>
</media:community>
</media:group>
</entry>
[More entries goes here...]
</feed>
根据之前的结果,您可以阅读视频的标题、上传者的姓名,以及出版日期(月 DD,YYYY).
我需要以特定格式引用大约一百个 YouTube 视频,并且希望仅使用视频 URL 自动生成这些引用。
我知道现有网站可以执行此操作(例如,Scribbr),但为了提高效率,我需要输出格式与所提供格式不同的格式。
我有一些初级的HTML和Javascript能力,如果我有办法获取视频的标题、上传者的姓名和出版日期(月 DD,YYYY)作为字符串。但是,我不知道该怎么做。
我研究过从 https://www.youtube.com/oembed?url=urlgoeshere&format=json 获取数据,但似乎不包括日期,而且我不确定如何从中获取标题。
这个问题可能太模糊了,但是对于从哪里开始这个问题,您有什么建议吗?谢谢你的时间。
if I had a method of obtaining the title of a video, the name of the uploader, and the date of publication (Month DD, YYYY) as strings.
要获取这些值,您可以按照以下步骤操作:
- 根据您的第一个请求(即:https://www.youtube.com/oembed?url=urlgoeshere&format=json),提取频道名称:
示例:
URL:
https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=6EHSlhnE6Ck&format=json
结果 - 为清楚起见格式化:
{
"title": "Understanding Digital Tracking",
"author_name": "GCFLearnFree.org",
"author_url": "https://www.youtube.com/user/gcflearnfree",
"type": "video",
"height": 113,
"width": 200,
"version": "1.0",
"provider_name": "YouTube",
"provider_url": "https://www.youtube.com/",
"thumbnail_height": 360,
"thumbnail_width": 480,
"thumbnail_url": "https://i.ytimg.com/vi/6EHSlhnE6Ck/hqdefault.jpg",
"html": "\u003ciframe width=\u0022200\u0022 height=\u0022113\u0022 src=\u0022https://www.youtube.com/embed/6EHSlhnE6Ck?feature=oembed\u0022 frameborder=\u00220\u0022 allow=\u0022accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\u0022 allowfullscreen\u003e\u003c/iframe\u003e"
}
- 提取用户名 - 通过读取“
author_url
”值:
"author_url":"https://www.youtube.com/user/gcflearnfree"
- 使用此请求获取视频的标题、上传者姓名和发布日期:
URL: https://www.youtube.com/feeds/videos.xml?user=<name_of_the_user>
- 将 <name_of_the_user>
替换为在步骤 2 中获得的名称。
示例:https://www.youtube.com/feeds/videos.xml?user=gcflearnfree
- 使用步骤 3 中显示的 URL 发出请求 - 您将获得这些结果:
示例:
<feed
xmlns:yt="http://www.youtube.com/xml/schemas/2015"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns="http://www.w3.org/2005/Atom">
<link rel="self" href="http://www.youtube.com/feeds/videos.xml?user=gcflearnfree"/>
<id>yt:channel:UCeYUHG6o0YguM-g23htdsSw</id>
<yt:channelId>UCeYUHG6o0YguM-g23htdsSw</yt:channelId> <-- Use channel_id instead.
<title>GCFLearnFree.org</title>
<link rel="alternate" href="https://www.youtube.com/channel/UCeYUHG6o0YguM-g23htdsSw"/>
<author>
<name>GCFLearnFree.org</name> <-- Name of the publisher
<uri>https://www.youtube.com/channel/UCeYUHG6o0YguM-g23htdsSw</uri>
</author>
<published>2007-02-27T15:22:42+00:00</published><-- Publication date
<entry>
<id>yt:video:xKuJrmlCdig</id>
<yt:videoId>xKuJrmlCdig</yt:videoId>
<yt:channelId>UCeYUHG6o0YguM-g23htdsSw</yt:channelId>
<title>What is HTML?</title><-- Title of the video
<link rel="alternate" href="https://www.youtube.com/watch?v=xKuJrmlCdig"/>
<author>
<name>GCFLearnFree.org</name>
<uri>https://www.youtube.com/channel/UCeYUHG6o0YguM-g23htdsSw</uri>
</author>
<published>2021-05-04T17:29:00+00:00</published>
<updated>2021-05-05T06:31:50+00:00</updated>
<media:group>
<media:title>What is HTML?</media:title>
<media:content url="https://www.youtube.com/v/xKuJrmlCdig?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
<media:thumbnail url="https://i1.ytimg.com/vi/xKuJrmlCdig/hqdefault.jpg" width="480" height="360"/>
<media:description>In this video, you’ll learn about HTML and how it is used to code webpages. We hope you enjoy! To learn more, check out our Basic HTML tutorial here: https://edu.gcfglobal.org/en/basic-html/ #whatishtml #htmlcode #learnhtml</media:description>
<media:community>
<media:starRating count="100" average="4.80" min="1" max="5"/>
<media:statistics views="1571"/>
</media:community>
</media:group>
</entry>
[More entries goes here...]
</feed>
根据之前的结果,您可以阅读视频的标题、上传者的姓名,以及出版日期(月 DD,YYYY).