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

Commit

Permalink
Make properties configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
skiptirengu authored Jan 16, 2017
1 parent 25ed267 commit dab402b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,21 @@ function parseInfo(data) {

// Add and process some entries to keep backwards compatibility
Object.defineProperty(info, 'filename', {
configurable: true,
get: function get() {
console.warn('`info.filename` is deprecated, use `info._filename`');
return info._filename;
}
});
Object.defineProperty(info, 'itag', {
configurable: true,
get: function get() {
console.warn('`info.itag` is deprecated, use `info.format_id`');
return info.format_id;
}
});
Object.defineProperty(info, 'resolution', {
configurable: true,
get: function get() {
console.warn('`info.resolution` is deprecated, use `info.format`');
return info.format.split(' - ')[1];
Expand Down

0 comments on commit dab402b

Please sign in to comment.