fix add video
This commit is contained in:
parent
64ed154f03
commit
a6537ca17d
Binary file not shown.
|
@ -402,11 +402,17 @@ namespace youtube_downloader.Server.Functions
|
|||
}
|
||||
public static void Download(string id,Resolution res)
|
||||
{
|
||||
bool hasForwardSlash = false;
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
hasForwardSlash = id.Contains("/");
|
||||
}
|
||||
|
||||
VideoId? vid= VideoId.TryParse(id);
|
||||
ChannelId? cid = ChannelId.Parse(id);
|
||||
UserName? uid = UserName.TryParse(id);
|
||||
PlaylistId? pid = PlaylistId.Parse(id);
|
||||
if (pid.HasValue)
|
||||
if (pid.HasValue && hasForwardSlash) // check for forward slash so we dont get confused
|
||||
{
|
||||
//Is Playlist
|
||||
var v = pid.Value;
|
||||
|
@ -416,16 +422,8 @@ namespace youtube_downloader.Server.Functions
|
|||
DL.infoQueue.Insert(0, item);
|
||||
}
|
||||
}
|
||||
else if (cid.HasValue)
|
||||
{
|
||||
var v = cid.Value;
|
||||
InfomationQueueItem item = new InfomationQueueItem(v, res, true);
|
||||
lock (DL.infoQueue)
|
||||
{
|
||||
DL.infoQueue.Insert(0, item);
|
||||
}
|
||||
}
|
||||
else if (vid.HasValue)
|
||||
|
||||
else if (vid.HasValue) //support 11 char id alone so dont check here
|
||||
{
|
||||
var v = vid.Value;
|
||||
InfomationQueueItem item = new InfomationQueueItem(v, res, true);
|
||||
|
@ -434,7 +432,16 @@ namespace youtube_downloader.Server.Functions
|
|||
DL.infoQueue.Insert(0, item);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (cid.HasValue && hasForwardSlash)
|
||||
{
|
||||
var v = cid.Value;
|
||||
InfomationQueueItem item = new InfomationQueueItem(v, res, true);
|
||||
lock (DL.infoQueue)
|
||||
{
|
||||
DL.infoQueue.Insert(0, item);
|
||||
}
|
||||
}
|
||||
else if(uid.HasValue && hasForwardSlash)
|
||||
{
|
||||
var v = uid.Value;
|
||||
InfomationQueueItem item = new InfomationQueueItem(v, res, true);
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue