video-parser
Extract video information by parsing the url.
Important
- If you find compatibility issues, check the bug reporting page.
- Change facebook video data stucture at v1.8.0 (see also #15)
Support provider
Dependencies
ffmpeg
$ brew install ffmpeg --with-openssl
Usage
var VideoParser = require('video-parser')
var parser = new VideoParser({
name: 'video-parser-cache',
redis: {
host: '127.0.0.1',
port: 6379,
auth_pass: 'passwd'
},
youtube: {
key: ''
},
vimeo: {
access_token: ''
},
youku: {
key: ''
},
tudou: {
key: ''
}
ttl: 3600 * 12
})
parser.on('error', function(err) {
console.error(err)
})
var url = [
'https://www.youtube.com/watch?v=-RWl24TUW6g',
'https://vimeo.com/60788712',
'https://www.facebook.com/snackk100/videos/vb.713427005470569/765726663573936/?type=2&theater',
'http://v.youku.com/v_show/id_XMTMwMDYxMjQxMg==_ev_1.html?from=y1.3-idx-uhome-1519-20887.205805-205902.1-1',
'http://www.dailymotion.com/video/x2jvvep',
'http://tvcast.naver.com/v/1205110',
'http://rutube.ru/video/2a39043b2108428a150fa27376adbea2/',
'http://tvpot.daum.net/mypot/View.do?clipid=72583600&ownerid=mRlSExWR4-Q0',
'http://www.tudou.com/programs/view/uKg4c5O0YyQ/'
]
for (var i = 0; i < url.length; i++) {
parser.parse(function(err, video) {
console.log(video)
}, url[i])
}
Format
{
"id":"-RWl24TUW6g",
"url":"https://www.youtube.com/watch?v=-RWl24TUW6g",
"name":"Earned It - The Weeknd - Kina Grannis & MAX & KHS Cover",
"desc":"Grab this on iTunes here: https://itunes.apple.com/us/album/earned-it-single/id994064741\nCheck out our epic song with Coke Bottles!! https://www.youtube.com/watch?v=ZzuRvzsNpTU\nAnd... I'm coming to Singapore, Thailand, and Japan! Stay tuned for Meet and Greet info :)\n_______________\n\nGET IN TOUCH!\n\nKURT:\nFacebook: http://www.facebook.com/kurthugoschneider\nTwitter: http://www.twitter.com/kurthschneider\n\nMAX:\nFacebook: http://on.fb.me/wZYjB3\nTwitter: http://www.twitter.com/maxgschneider\nYouTube: http://www.youtube.com/user/MaxSchneider1\n\nKINA:\nFacebook: https://www.facebook.com/kinagrannis\nTwitter: https://twitter.com/kinagrannis\nYoutube: https://www.youtube.com/user/kinagrannis\n\n_______________\n\"Earned It (Fifty Shades of Grey)” – originally by The Weeknd\nWritten by: Abel Tesfaye, Stephan Moccio, Jason Quenneville & Ahmad Balshe\nPublished by: Universal Music Corp, WB Music Corp & Songs of SMP",
"thumb_url":"https://i.ytimg.com/vi/-RWl24TUW6g/mqdefault.jpg",
"duration":186,
"ratings":{
},
"details":{
"definition":"hd",
"author":{
"id":"UCplkk3J5wrEl0TNrthHjq4Q",
"title":"Kurt Hugo Schneider"
}
},
"provider":"youtube"
}
{
"id":"60788712",
"url":"https://vimeo.com/60788712",
"name":"Mi niña mi vida",
"desc":"A man moves amidst the noisy crowds at an amusement park, accompanied only by a large pink stuffed toy. Encircled by the sounds and incessant movements of the rides, this strange duo anchors long sequence shots that navigate the mechanical rhythms and decor of the park.\n\nUn homme seul et son gros ours en peluche rose forment un étrange duo parmi la foule d’un parc d’amusement. Isolés par les bruits et le mouvement incessant des manèges qui les entourent, ils sont le point d'ancrage de longs plans séquences rythmés par ce décor mécanique.",
"thumb_url":"https://i.vimeocdn.com/video/462264450_295x166.jpg",
"duration":1150,
"ratings":[
"safe"
],
"details":{
"definition":"",
"author":{
"id":"3896730",
"title":"Yan Giroux"
}
},
"provider":"vimeo"
}
{
"id": "765726663573936",
"url": "https://www.facebook.com/713427005470569/videos/765726663573936",
"name": "스낵 - Snackk.tv",
"desc": "애 엄마가 보면 기겁할 듯 ㅇ0ㅇ\n\n #첫눈 온 날 라이딩 영상보며 대리만족\n+귀여운 아기는 덤",
"thumb_url": "https://scontent.xx.fbcdn.net/hvthumb-xap1/v/t15.0-10/s480x480/12105363_765755180237751_1022961937_n.jpg?oh=e7e102c2dce9fa6463b3ffc9cedff592&oe=56E72E65",
"duration": 233,
"ctime": "2015-11-26T14:58:17+09:00",
"ratings": null,
"details": {
"definition": "",
"author": {
"id": "713427005470569",
"title": "스낵 - Snackk.tv"
},
"source": "https://video.xx.fbcdn.net/hvideo-xpa1/v/t43.1792-2/12251290_1016430301743231_1083820292_n.mp4?efg=eyJybHIiOjI5OTQsInJsYSI6NDA5NiwidmVuY29kZV90YWciOiJzdmVfaGQifQ%3D%3D&rl=2994&vabr=1996&oh=31a605409c8bd8fd3f427793a7377b7b&oe=5659E9A0"
},
"provider": "facebook"
}
{
"id": "XMTI5NTcwMDA3Mg==",
"url": "http://v.youku.com/v_show/id_XMTI5NTcwMDA3Mg==.html",
"name": "李湘隔空合唱邓丽君 花千骨东方彧卿深情献唱",
"desc": "",
"thumb_url": "http://g2.ykimg.com/1100641F4655B76A9B6A612E697BDCD5D108B3-6D55-8549-378A-C357FE00D212",
"duration": "111.41",
"ctime": "2015-07-28T19:15:32+09:00",
"details": {
"definition": "",
"author": {
"id": "778664924",
"title": "歌手是谁"
}
},
"provider": "youku"
}
{
"id": "x2jvvep",
"url": "http://www.dailymotion.com/video/x2jvvep_coup-incroyable-pendant-un-match-de-ping-pong_tv",
"name": "Coup incroyable pendant un match de ping-pong",
"desc": "",
"thumb_url": "http://s2.dmcdn.net/JdVUk/x720-jcH.jpg",
"duration": 12,
"ctime": "2015-03-19T04:15:48+09:00",
"ratings": {},
"details": {
"definition": "",
"author": {
"id": "x1gyl14",
"title": "BuzzVid"
}
},
"provider": "dailymotion"
}
{
"id":"1205110",
"url":"http://tvcast.naver.com/v/1205110",
"name":"[긍정이 체질] 2화",
"desc":"웹드라마 긍정이 체질 | 섭외 문제로 혜정(채서진)에게 오랜만에 \r\n연락하게 된 환동(도경수)은 과거를 회상한다.\r\n\r\n과거 선후배에서 연인으로 발전했다가\r\n이제는 남남이 된 환동과 혜정\r\n\r\n환동의 첫 영화 제작을 핑계로 둘은 3년만에 재회하지만\r\n자존심 싸움으로 상황은 힘들어 지기만 하는데...\r\n\r\n어려운 현실 속에서도 자신의 꿈에 도전하는\r\n이 시대 청춘들의 이야기를 유쾌하게 그려낸\r\n삼성 웹드라마<긍정이 체질>\r\n많은 시청 부탁드립니다~\r\n \r\n긍정이 체질 본편 모두 보기 ☞ http://blog.samsung.co.kr/bepositive",
"thumb_url":"https://phinf.pstatic.net/tvcast/20161031_226/hSxsZ_14778885683893Df1N_JPEG/1477888568351.jpg?type=f640",
"duration":694,
"ctime":"2016-11-01T00:00:00+09:00",
"ratings":{
},
"tags":[
"채서진",
"남기애",
"김의성",
"김종수",
"이다윗",
"디오",
"웹드라마",
"DO",
"모",
"부",
"도경수",
"황인국",
"김환동",
"방혜정",
"마교수",
"환동",
"환동부",
"환동모",
"D.O."
],
"details":{
"definition":"",
"author":{
"id":"bepositive",
"url":"bepositive",
"title":"웹드라마 긍정이 체질"
},
"naver":{
"type":"rmc",
"id":"8D5A6AABD32834944CAC6E3863F4F7171F37",
"key":"V123c626743473d2bb53f4f3d181e67d1bf1e15438228ef78ab3a4f3d181e67d1bf1e"
}
},
"provider":"navertvcast"
}
{
"id": "2a39043b2108428a150fa27376adbea2",
"url": "http://rutube.ru/video/2a39043b2108428a150fa27376adbea2/",
"name": "- группа ' Моя Мишель' 13.02.2015",
"desc": "https://vk.com/public53281593 #НовоеВидео: #",
"thumb_url": "http://pic.rutube.ru/video/01/c4/01c4023404f364a32a015924154e23a3.jpg",
"duration": 242,
"ctime": "2015-02-14T05:33:33+09:00",
"ratings": {},
"details": {
"definition": "",
"author": {
"id": 245325,
"title": "музыка"
},
"embed": {
"url": "http://rutube.ru/play/embed/7508261"
}
},
"provider": "rutube"
}
{
"id": "72583600",
"url": "http://tvpot.daum.net/v/s6ad9xjxXVTXTazTzGTTaon",
"name": "[Daum tv팟][17회 예고] '길태미' 박혁권, '이방지' 변요한과 최후의 대결? [육룡이 나르샤] 16회 20151124",
"desc": "드라마 | 육룡이 나르샤 17회 \r\n본방송 | 11월 30일 월요일 밤 10시",
"thumb_url": "http://i1.daumcdn.net/thumb/C480x270/?fname=http://i1.daumcdn.net/svc/image/U03/tvpot_thumb/s6ad9xjxXVTXTazTzGTTaon/thumb.png?t=1448411362833",
"duration": 37,
"ctime": "2015-11-24T23:54:43+09:00",
"ratings": {},
"details": {
"definition": "",
"author": {
"id": "mRlSExWR4-Q0",
"title": "SBS"
},
"embed": {
"id": "s6ad9xjxXVTXTazTzGTTaon",
"url": "http://videofarm.daum.net/controller/video/viewer/Video.html?vid=s6ad9xjxXVTXTazTzGTTaon&play_loc=undefined"
}
},
"provider": "daumtvpot"
}
{
"id": "uKg4c5O0YyQ",
"url": "http://www.tudou.com/programs/view/uKg4c5O0YyQ/",
"name": "CHARIS首尔美妆之旅(9.21-25)预告片",
"desc": "韩国潮流美妆平台CHARIS首尔美妆之旅(9.21-25)预告片",
"thumb_url": "http://g4.tdimg.com/260146303/diy_w_1.jpg",
"duration": 12000,
"ctime": "2016-09-06T00:00:00+09:00",
"ratings": {},
"details": {
"definition": "",
"author": {
"id": 993028656,
"title": "CHARIS官方"
}
},
"provider": "tudou"
}
Release History
See the changelog
LICENSE
video-parser is licensed under the MIT license.