55Extract video information by parsing the url.
66Important: If you find compatibility issues, check the bug reporting page.
77
8+ [ ![ js-standard-style] ( https://cdn.rawgit.com/feross/standard/master/badge.svg )] ( https://github.com/feross/standard )
9+
810### Support provider
911
1012* [ youtube] ( https://www.youtube.com/ )
@@ -13,6 +15,7 @@ Important: If you find compatibility issues, check the bug reporting page.
1315* [ youku] ( http://www.youku.com/ )
1416* [ dailymotion] ( http://www.dailymotion.com/kr )
1517* [ naver tvcast] ( http://tvcast.naver.com ) - It can be stopped unexpectedly due to parse the data from the site.
18+ * [ rutube] ( http://rutube.ru/ )
1619
1720## Dependencies
1821
@@ -28,7 +31,7 @@ $ brew install ffmpeg --with-openssl
2831## Usage
2932
3033``` javascript
31- var VideoParser = require (' video-parser' );
34+ var VideoParser = require (' video-parser' )
3235
3336var parser = new VideoParser ({
3437 name: ' video-parser-cache' ,
@@ -46,12 +49,12 @@ var parser = new VideoParser({
4649 key: ' '
4750 }
4851 ttl: 3600 * 12 // 1 day
49- });
52+ })
5053
5154
5255parser .on (' error' , function (err ) {
53- console .error (err);
54- });
56+ console .error (err)
57+ })
5558
5659var url = [
5760 ' https://www.youtube.com/watch?v=-RWl24TUW6g' ,
@@ -62,13 +65,14 @@ var url = [
6265 ' http://v.youku.com/v_show/id_XMTMwMDYxMjQxMg==_ev_1.html?from=y1.3-idx-uhome-1519-20887.205805-205902.1-1' ,
6366 ' http://dai.ly/x2jvvep' ,
6467 ' http://www.dailymotion.com/video/x2jvvep' ,
65- ' http://tvcast.naver.com/v/584455'
66- ];
68+ ' http://tvcast.naver.com/v/584455' ,
69+ ' http://rutube.ru/video/2a39043b2108428a150fa27376adbea2/'
70+ ]
6771
6872for (var i = 0 ; i < url .length ; i++ ) {
6973 parser .parse (function (err , video ) {
70- console .log (video);
71- }, url[i]);
74+ console .log (video)
75+ }, url[i])
7276}
7377
7478```
@@ -194,6 +198,28 @@ for (var i = 0; i < url.length; i++) {
194198 },
195199 "provider" : " navertvcast"
196200}
201+
202+ {
203+ "id" : " 2a39043b2108428a150fa27376adbea2" ,
204+ "url" : " http://rutube.ru/video/2a39043b2108428a150fa27376adbea2/" ,
205+ "name" : " - группа ' Моя Мишель' 13.02.2015" ,
206+ "desc" : " https://vk.com/public53281593 #НовоеВидео: #" ,
207+ "thumb_url" : " http://pic.rutube.ru/video/01/c4/01c4023404f364a32a015924154e23a3.jpg" ,
208+ "duration" : 242 ,
209+ "ctime" : " 2015-02-14T05:33:33+09:00" ,
210+ "ratings" : {},
211+ "details" : {
212+ "definition" : " " ,
213+ "author" : {
214+ "id" : 245325 ,
215+ "title" : " музыка"
216+ },
217+ "embed" : {
218+ "url" : " http://rutube.ru/play/embed/7508261"
219+ }
220+ },
221+ "provider" : " rutube"
222+ }
197223```
198224
199225
@@ -204,4 +230,4 @@ See the [changelog](CHANGELOG.md)
204230
205231## LICENSE
206232
207- video-parser is licensed under the MIT license.
233+ video-parser is licensed under the MIT license.
0 commit comments