Skip to content

egg-/video-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

81 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

video-parser

version download

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)

js-standard-style

Support provider

Dependencies

ffmpeg

$ brew install ffmpeg --with-openssl

Usage

var VideoParser = require('video-parser')

var parser = new VideoParser({
    name: 'video-parser-cache',
    // Save as in memory if redis is not specified
    redis: {
        host: '127.0.0.1',
        port: 6379,
        auth_pass: 'passwd' // (optional)
    },
    youtube: {
        key: ''
    },
    vimeo: {
        access_token: ''
    },
    youku: {
        key: ''
    },
    tudou: {
        key: ''
    },
    facebook: {
      appId: '',
      appSecret: '',
      access_token: ''
    },
    ttl: 3600 * 12  // 1 day
})


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://tv.naver.com/v/1341505',
    'http://rutube.ru/video/2a39043b2108428a150fa27376adbea2/',
    'http://tvpot.daum.net/mypot/View.do?clipid=72583600&ownerid=mRlSExWR4-Q0',
    'http://www.tudou.com/programs/view/uKg4c5O0YyQ/',
    'http://www.gomtv.com/14692214',
    'http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_5mb.mp4'
]

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": "1341505",
	"url": "http://tv.naver.com/v/1341505",
	"name": "[๋ฉ”์ดํ‚น] ๊ณต๋™์žฌ, ๊น€๊ณ ์€ ๋ณธ์‹ฌ ๋“คํ†ต๋‚œ ์—ญ์‚ฌ์˜ ํ˜„์žฅ์—์„œ '๋ฝฑ' ํ„ฐ์ง",
	"desc": "tvN 10์ฃผ๋…„ ํŠน๋ณ„๊ธฐํš ๏ผœ๋„๊นจ๋น„๏ผž | [๋ฉ”์ดํ‚น] ๊นจ๋น„ ์ง‘ ์‹๊ตฌ๋“ค์˜ ์ž”๋ง็พŽ ๋Œ€ํญ๋ฐœ! ๊นจ๋น„๋‰ด์ด์–ด~โ™ก\r\n------------------\r\n------------------\r\ntvN 10์ฃผ๋…„ ํŠน๋ณ„๊ธฐํš  ๏ผœ๋„๊นจ๋น„๏ผž\r\n๋งค์ฃผ ๊ธˆํ†  ์ €๋… 8์‹œ\r\n------------------\r\n------------------\r\n์ถœ์—ฐ: ๊ณต์œ , ์ด๋™์šฑ, ๊น€๊ณ ์€, ์œ ์ธ๋‚˜, ์œก์„ฑ์žฌ ๋“ฑ \r\n์ œ์ž‘์ง„: ๊ทน๋ณธ ๊น€์€์ˆ™ ์ž‘๊ฐ€/์—ฐ์ถœ ์ด์‘๋ณต ๊ฐ๋…\r\n์ค„๊ฑฐ๋ฆฌ: ๋ถˆ๋ฉธ์˜ ์‚ถ์„ ๋๋‚ด๊ธฐ ์œ„ํ•ด ์ธ๊ฐ„ ์‹ ๋ถ€๊ฐ€ ํ•„์š”ํ•œ ๋„๊นจ๋น„, ๊ทธ์™€ ๊ธฐ๋ฌ˜ํ•œ ๋™๊ฑฐ๋ฅผ ์‹œ์ž‘ํ•œ ๊ธฐ์–ต์ƒ์‹ค์ฆ ์ €์Šน์‚ฌ์ž. ๊ทธ๋Ÿฐ ๊ทธ๋“ค ์•ž์— '๋„๊นจ๋น„ ์‹ ๋ถ€'๋ผ ์ฃผ์žฅํ•˜๋Š” '์ฃฝ์—ˆ์–ด์•ผ ํ•  ์šด๋ช…'์˜ ์†Œ๋…€๊ฐ€ ๋‚˜ํƒ€๋‚˜๋ฉฐ ๋ฒŒ์–ด์ง€๋Š” ์‹ ๋น„๋กœ์šด ๋‚ญ๋งŒ ์„คํ™”\r\n\r\n๊ณต์‹ ํ™ˆํŽ˜์ด์ง€: www.chtvn.com/dokebi\r\n๊ณต์‹ ํŽ˜์ด์Šค๋ถ: www.facebook.com/tvNdokebi",
	"thumb_url": "http://tvcast2.phinf.naver.net/20161230_9/fVsAB_14830605352061sDe3_JPEG/B120161931_EPI0009_05_B.jpg?type=f640",
	"duration": 146,
	"ctime": "2016-12-30T00:00:00+09:00",
	"ratings": {},
	"tags": [
		"๊น€์‹ ",
		"์ €์Šน์‚ฌ์ž",
		"์œ ๋•ํ™”",
		"์ง€์€ํƒ",
		"๋ฉ”์ดํ‚น",
		"๊ณต์œ ",
		"์ด๋™์šฑ",
		"์œก์„ฑ์žฌ",
		"๊น€๊ณ ์€"
	],
	"details": {
		"definition": "",
		"author": {
			"id": "wrappinguser23",
			"url": "cjenm.tvndokebi",
			"title": "tvN 10์ฃผ๋…„ ํŠน๋ณ„๊ธฐํš ๏ผœ๋„๊นจ๋น„๏ผž"
		},
		"naver": {
			"type": "rmc",
			"id": "C6989E0E8014F615AD4E0A6DD4AD13278429",
			"key": "V1245a32a721e8557bd90f85f5da177373136be34e0fdd065be49f85f5da177373136"
		}
	},
	"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ํšŒ ์˜ˆ๊ณ ] &#39;๊ธธํƒœ๋ฏธ&#39; ๋ฐ•ํ˜๊ถŒ, &#39;์ด๋ฐฉ์ง€&#39; ๋ณ€์š”ํ•œ๊ณผ ์ตœํ›„์˜ ๋Œ€๊ฒฐ? [์œก๋ฃก์ด ๋‚˜๋ฅด์ƒค] 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"
}

{
	"id": "14692214",
	"url": "http://www.gomtv.com/14692214",
	"name": "๋‹ด์žฅ ๋„˜์–ด๊ฐ„ ํƒ€๊ตฌ๋ฅผ ์žก์•„ ๋‚ธ ์•„๋‹ด ์กด์Šค์˜ ์™„๋ฒฝํ•œ ์Šˆํผ ์บ์น˜ [๋ฏธ๊ตญ vs ๋„๋ฏธ๋‹ˆ์นด]",
	"desc": "2017 ์›”๋“œ๋ฒ ์ด์Šค๋ณผ ํด๋ž˜์‹\r\n๋ฏธ๊ตญ vs ๋„๋ฏธ๋‹ˆ์นด [WBC 2017]\r\n\t\t\t\t\t\t\t\r\nํƒœ๊ทธ : WBC, ์›”๋“œ ๋ฒ ์ด์Šค๋ณผ ํด๋ž˜์‹",
	"thumb_url": "http://chi.gomtv.com/cgi-bin/imgview.cgi?nid=11433506&type=11",
	"duration": 0,
	"ctime": "2017-03-19T00:00:00+09:00",
	"ratings": {},
	"tags": [
		"WBC",
		"์›”๋“œ ๋ฒ ์ด์Šค๋ณผ ํด๋ž˜์‹"
	],
	"details": {
		"definition": "",
		"author": {},
		"embed": {
			"id": "2542eec85811250e10097d289b9e3248275af384060d38475176045dffe2",
			"url": "https://cubec.gomtv.com/player/VideoStart_v2.swf?sharemode=true&disablePopup=true&autoplay=false&h=2542eec85811250e10097d289b9e3248275af384060d38475176045dffe2"
		}
	},
	"provider": "gomtv"
}

{
	"id": "http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_5mb.mp4",
	"url": "http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_5mb.mp4",
	"name": "big_buck_bunny_720p_5mb",
	"duration": 29.568,
	"ctime": "1970-01-01T09:00:00+09:00",
	"provider": "html5"
}

Release History

See the changelog

LICENSE

video-parser is licensed under the MIT license.