Normalize episode tags.

This commit is contained in:
Roel van Uden 2015-01-23 19:33:05 +01:00
parent 7c6535b41a
commit e1f1eb052e

View File

@ -25,6 +25,7 @@ module.exports = function (config, address, done) {
/** /**
* Downloads the subtitle and video. * Downloads the subtitle and video.
* @private
* @param {Object} config * @param {Object} config
* @param {Object} page * @param {Object} page
* @param {Object} player * @param {Object} player
@ -85,6 +86,7 @@ function _player(address, id, done) {
explicitRoot: false explicitRoot: false
}, function(err, player) { }, function(err, player) {
if (err) return done(err); if (err) return done(err);
try {
done(undefined, { done(undefined, {
subtitle: { subtitle: {
id: player['default:preload'].subtitle.$.id, id: player['default:preload'].subtitle.$.id,
@ -96,12 +98,16 @@ function _player(address, id, done) {
host: player['default:preload'].stream_info.host host: player['default:preload'].stream_info.host
} }
}); });
} catch(err) {
done(err);
}
}); });
}); });
} }
/** /**
* Saves the subtitles to disk. * Saves the subtitles to disk.
* @private
* @param {Object} config * @param {Object} config
* @param {Object} player * @param {Object} player
* @param {string} filePath * @param {string} filePath
@ -121,6 +127,7 @@ function _subtitle(config, player, filePath, done) {
/** /**
* Streams the video to disk. * Streams the video to disk.
* @private
* @param {Object} config * @param {Object} config
* @param {Object} page * @param {Object} page
* @param {Object} player * @param {Object} player
@ -132,6 +139,6 @@ function _video(config, page, player, filePath, done) {
player.video.host, player.video.host,
player.video.file, player.video.file,
page.swf, page.swf,
filePath + '.' + path.extname(player.video.file), filePath + path.extname(player.video.file),
done); done);
} }