Skip to content

Commit

Permalink
fix: properly download from dash-mpd formats without `availabilitySta…
Browse files Browse the repository at this point in the history
…rtTime`

fixes fent/node-ytdl-core#567
  • Loading branch information
fent committed Feb 10, 2020
1 parent 105ca0a commit 03da7a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dash-mpd-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default class DashMPDParser extends Writable implements Parser {
switch (node.name) {
case 'mpd':
currtime =
new Date(node.attributes.availabilitystarttime).getTime();
node.attributes.availabilitystarttime ?
new Date(node.attributes.availabilitystarttime).getTime() : 0;
isStatic = node.attributes.type !== 'dynamic';
break;
case 'period':
Expand Down Expand Up @@ -175,4 +176,4 @@ export default class DashMPDParser extends Writable implements Parser {
this._parser.write(chunk, encoding);
callback();
}
};
}

0 comments on commit 03da7a9

Please sign in to comment.