-
Notifications
You must be signed in to change notification settings - Fork 73
YouTube
Julian Hangstörfer edited this page Jul 13, 2019
·
3 revisions
-
'video'
: Regular videos which can also be livestreams. -
'playlist'
: YouTube playlist. -
'share'
: Shared YouTube videos that link to a special website and are not actual videos themselves. -
'channel'
: YouTube channels, which are the same as users.
-
'short'
: Shortened urls. -
'long'
(default): Regular urls. -
'embed'
: Embedded urls. -
'shortImage'
: Shortened thumbnail urls. -
'longImage'
: Regular thumbnail urls.
mediaType/formats | short | long | embed | shortImage | longImage |
---|---|---|---|---|---|
video | ✓ | ✓ | ✓ | ✓ | ✓ |
playlist | X | ✓ | ✓ | X | X |
share | X | ✓ | X | X | X |
channel | X | ✓ | X | X | X |
-
'name'
: Sometimes you get the name of a channel instead of the'id'
. -
'list'
: Playlist id. -
'params.start'
: The number where the video should begin in seconds. -
'params.imageQuality'
: Custom parameter for generating different qualities of thumbnail urls.'0', '1', '2', '3', 'default', 'hqdefault'(default), 'mqdefault', 'sddefault', 'maxresdefault'
> urlParser.parse('http://www.youtube.com/watch?v=HRb7B9fPhfA');
> urlParser.parse('http://youtu.be/HRb7B9fPhfA');
> urlParser.parse('https://m.youtube.com/details?v=HRb7B9fPhfA');
> urlParser.parse('https://gdata.youtube.com/feeds/api/videos/HRb7B9fPhfA/related');
> urlParser.parse('https://i.ytimg.com/vi/HRb7B9fPhfA/hqdefault.jpg');
> urlParser.parse('https://img.youtube.com/vi/HRb7B9fPhfA/hqdefault.jpg');
{
mediaType: 'video',
id: 'HRb7B9fPhfA',
provider: 'youtube'
}
> urlParser.parse('http://www.youtube.com/embed/videoseries?list=PL46F0A159EC02DF82');
> urlParser.parse('http://www.youtube.com/playlist?list=PL46F0A159EC02DF82');
{
mediaType: 'playlist',
list: 'PL46F0A159EC02DF82',
provider: 'youtube'
}
> urlParser.parse('http://www.youtube.com/watch?v=yQaAGmHNn9s&list=PL46F0A159EC02DF82');
{
mediaType: 'video',
id: 'yQaAGmHNn9s',
list: 'PL46F0A159EC02DF82',
provider: 'youtube'
}
> urlParser.parse('http://www.youtube.com/watch?v=yQaAGmHNn9s&list=PL46F0A159EC02DF82#t=1m40');
{
mediaType: 'video',
id: 'yQaAGmHNn9s',
list: 'PL46F0A159EC02DF82',
provider: 'youtube'
params: {
start: 100
}
}
> urlParser.parse('https://www.youtube.com/channel/UCzQUP1qoWDoEbmsQxvdjxgQ');
{
mediaType: 'channel',
id: 'UCzQUP1qoWDoEbmsQxvdjxgQ',
provider: 'youtube'
}
> urlParser.parse('https://www.youtube.com/user/PowerfulJRE');
> urlParser.parse('https://www.youtube.com/c/PowerfulJRE');
{
mediaType: 'channel',
name: 'PowerfulJRE',
provider: 'youtube'
}
> urlParser.create({
videoInfo: {
provider: 'youtube',
id: 'HRb7B9fPhfA',
mediaType: 'video'
},
format: <format>
})
'long': 'https://www.youtube.com/watch?v=HRb7B9fPhfA'
'short': 'https://youtu.be/HRb7B9fPhfA'
'embed': 'https://www.youtube.com/embed/HRb7B9fPhfA'
'shortImage': 'https://i.ytimg.com/vi/HRb7B9fPhfA/hqdefault.jpg'
'longImage': 'https://img.youtube.com/vi/HRb7B9fPhfA/hqdefault.jpg'
> urlParser.create({
videoInfo: {
provider: 'youtube',
id: 'HRb7B9fPhfA',
mediaType: 'video'
},
params: {
start: 90
},
format: <format>
})
'long': 'https://www.youtube.com/watch?v=HRb7B9fPhfA#t=90'
'short': 'https://youtu.be/HRb7B9fPhfA#t=90'
'embed': 'https://www.youtube.com/embed/HRb7B9fPhfA?start=90'
> urlParser.create({
videoInfo: {
provider: 'youtube',
id: 'HRb7B9fPhfA',
list: 'PL46F0A159EC02DF82',
mediaType: 'video'
},
format: <format>
})
'long': 'https://www.youtube.com/watch?list=PL46F0A159EC02DF82&v=HRb7B9fPhfA'
'embed': 'https://www.youtube.com/embed/HRb7B9fPhfA?list=PL46F0A159EC02DF82'
> urlParser.create({
videoInfo: {
provider: 'youtube',
list: 'PL46F0A159EC02DF82',
mediaType: 'playlist'
},
format: <format>
})
'long': 'https://www.youtube.com/playlist?feature=share&list=PL46F0A159EC02DF82'
'embed': 'https://www.youtube.com/embed?list=PL46F0A159EC02DF82&listType=playlist'
> urlParser.create({
videoInfo: {
provider: 'youtube',
id: 'UCzQUP1qoWDoEbmsQxvdjxgQ',
mediaType: 'channel'
},
format: 'long'
})
'long': 'https://www.youtube.com/channel/UCzQUP1qoWDoEbmsQxvdjxgQ'
> urlParser.create({
videoInfo: {
provider: 'youtube',
name: 'PowerfulJRE',
mediaType: 'channel'
},
format: 'long'
})
'long': 'https://www.youtube.com/c/PowerfulJRE'
> urlParser.create({
videoInfo: {
provider: 'youtube',
id: 'HRb7B9fPhfA',
mediaType: 'video'
},
params:{
imageQuality: <quality>
},
format: 'shortImage'
})
'0': 'https://i.ytimg.com/vi/HRb7B9fPhfA/0.jpg'
'1': 'https://i.ytimg.com/vi/HRb7B9fPhfA/1.jpg'
'2': 'https://i.ytimg.com/vi/HRb7B9fPhfA/2.jpg'
'3': 'https://i.ytimg.com/vi/HRb7B9fPhfA/3.jpg'
'hqdefault': 'https://i.ytimg.com/vi/HRb7B9fPhfA/hqdefault.jpg'
'sddefault': 'https://i.ytimg.com/vi/HRb7B9fPhfA/sddefault.jpg'
'mqdefault': 'https://i.ytimg.com/vi/HRb7B9fPhfA/mqdefault.jpg'
'maxresdefault': 'https://i.ytimg.com/vi/HRb7B9fPhfA/maxresdefault.jpg'
> urlParser.create({
videoInfo: {
provider: 'youtube',
id: 'HRb7B9fPhfA',
mediaType: 'video'
},
params:{
imageQuality: <quality>
},
format: 'longImage'
})
'0': 'https://img.youtube.com/vi/HRb7B9fPhfA/0.jpg'
'1': 'https://img.youtube.com/vi/HRb7B9fPhfA/1.jpg'
'2': 'https://img.youtube.com/vi/HRb7B9fPhfA/2.jpg'
'3': 'https://img.youtube.com/vi/HRb7B9fPhfA/3.jpg'
'hqdefault': 'https://img.youtube.com/vi/HRb7B9fPhfA/hqdefault.jpg'
'sddefault': 'https://img.youtube.com/vi/HRb7B9fPhfA/sddefault.jpg'
'mqdefault': 'https://img.youtube.com/vi/HRb7B9fPhfA/mqdefault.jpg'
'maxresdefault': 'https://img.youtube.com/vi/HRb7B9fPhfA/maxresdefault.jpg'