Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
Update test about twitch (twitch id are not anymore the video title)
Browse files Browse the repository at this point in the history
  • Loading branch information
navispeed committed Jul 31, 2018
1 parent 3349cbb commit b9f0317
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/youtube-dl.js
Expand Up @@ -173,7 +173,8 @@ function call(urls, args1, args2, options, callback) {
}
}
} else {
args.push('--');
if (i === 0)
args.push('--');
args.push(video);
}
}
Expand Down
29 changes: 28 additions & 1 deletion test/getInfo.js
Expand Up @@ -119,6 +119,33 @@ vows.describe('getInfo').addBatch({
}
},

'from a twitch video': {
'topic': function() {
'use strict';
var video = 'https://clips.twitch.tv/RelentlessOptimisticPterodactylRitzMitz';
ytdl.getInfo(video, ['--no-warnings'], this.callback);
},

'info returned': function(err, info) {
'use strict';
assert.isNull(err);
assert.isObject(info);
assert.equal(info.id, '131170216');
assert.equal(info.format_id, '1080');
assert.equal(info.title, 'Riot Games Playing League of Legends - Twitch Clips');
assert.isString(info.url);
assert.isString(info.thumbnail);
assert.equal(info.fulltitle, 'Riot Games Playing League of Legends - Twitch Clips');
assert.equal(info._filename, 'Riot Games Playing League of Legends - Twitch Clips-RelentlessOptimisticPterodactylRitzMitz.mp4');
assert.equal(info.format, '1080 - 1080p');
assert.equal(info.height, 1080);
assert.equal(info._duration_raw, undefined);
assert.equal(info._duration_hms, undefined);
assert.equal(info.duration, undefined);
assert.isArray(info.formats);
}
},

'from multiple videos': {
'topic': function() {
'use strict';
Expand Down Expand Up @@ -164,7 +191,7 @@ vows.describe('getInfo').addBatch({
assert.equal(info[1].width, 640);
assert.equal(info[1].height, 360);
assert.isArray(info[1].formats);
assert.equal(info[2].id, 'RelentlessOptimisticPterodactylRitzMitz');
assert.equal(info[2].id, '131170216');
assert.equal(info[2].format_id, '1080');
assert.equal(info[2].title, 'Riot Games Playing League of Legends - Twitch Clips');
assert.isString(info[2].url);
Expand Down

0 comments on commit b9f0317

Please sign in to comment.