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

Commit

Permalink
Fix - Incorrect youtube video URL
Browse files Browse the repository at this point in the history
ensure id recheck only for youtube videos
  • Loading branch information
przemyslawpluta committed Feb 12, 2014
1 parent c161fa6 commit 408e2b1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ exports.download = function(urladdr, dest, args) {
var isYouTube = urladdr.match(/(youtube|youtu.be)/),
details = url.parse(urladdr, true),
query = details.query,
id = query.v;
id = query.v || ''; // Get possible IDs

if (isYouTube) {
var pathname = details.pathname.slice(1);
// Get possible IDs from urladdr.
if (!id) { id = pathname; }
if (isYouTube && !id) {
// Get possible IDs for youtube from urladdr.
id = details.pathname.slice(1);
}

if (!id) {
Expand Down

0 comments on commit 408e2b1

Please sign in to comment.