This commit is contained in:
Demetria Lovato 2021-06-23 21:05:21 -07:00
parent 6bb10ef57e
commit 0ad44036cb
34 changed files with 29292 additions and 27 deletions

Binary file not shown.

View File

@ -238,7 +238,7 @@ namespace youtube_downloader
} catch (Exception ex)
{
_ = ex;
}
}
break;

View File

@ -171,7 +171,7 @@ namespace youtube_downloader.Server.Functions
}
}catch(Exception ex)
{
_ = ex;
}
}
return Environment.CurrentDirectory;
@ -326,10 +326,10 @@ namespace youtube_downloader.Server.Functions
SavedChannel c2 = SavedChannel.FromChannel(c, _DownloadThumbnail);
string infpath = GetPath(true, "Channel", id + ".json");
File.WriteAllText(infpath, JsonConvert.SerializeObject(c2));
var cvids = ytc.Channels.GetUploadsAsync(id).GetAsyncEnumerator();
while (await cvids.MoveNextAsync())
var cvids = await ytc.Channels.GetUploadsAsync(id).ToListAsync();
foreach(var v in cvids)
{
await _DownloadVideo(cvids.Current.Id, res);
await _DownloadVideo(v.Id, res);
}
}
@ -345,42 +345,58 @@ namespace youtube_downloader.Server.Functions
SavedChannel c2 = SavedChannel.FromChannel(c, _DownloadThumbnail);
string infpath = GetPath(true, "Channels", c.Id + ".json");
File.WriteAllText(infpath, JsonConvert.SerializeObject(c2));
var cvids = ytc.Channels.GetUploadsAsync(c.Id).GetAsyncEnumerator();
while (await cvids.MoveNextAsync())
var cvids = await ytc.Channels.GetUploadsAsync(c2.Id).ToListAsync();
foreach (var v in cvids)
{
await _DownloadVideo(cvids.Current.Id, res);
await _DownloadVideo(v.Id, res);
}
}
public static void DownloadVideo(VideoId v,Resolution res)
public static void DownloadVideo(string id,Resolution res)
{
DL._DownloadVideo(v, res).GetAwaiter().GetResult();
VideoId? v = VideoId.TryParse(id);
if (v.HasValue)
{
DL._DownloadVideo(v.Value, res).GetAwaiter().GetResult();
}
}
public static void DownloadVideo(VideoId v)
public static void DownloadVideo(string v)
{
DownloadVideo(v, Resolution.NoConvert);
}
public static void DownloadPlaylist(PlaylistId id,Resolution res)
public static void DownloadPlaylist(string id,Resolution res)
{
DL._DownloadPlaylist(id, res).GetAwaiter().GetResult();
PlaylistId? v = PlaylistId.TryParse(id);
if (v.HasValue)
{
DL._DownloadPlaylist(v.Value, res).GetAwaiter().GetResult();
}
}
public static void DownloadPlaylist(PlaylistId id)
public static void DownloadPlaylist(string id)
{
DownloadPlaylist(id, Resolution.NoConvert);
}
public static void DownloadChannel(ChannelId id,Resolution res)
public static void DownloadChannel(string id,Resolution res)
{
DL._DownloadChannel(id, res).GetAwaiter().GetResult();
ChannelId? v = ChannelId.TryParse(id);
if (v.HasValue)
{
DL._DownloadChannel(v.Value, res).GetAwaiter().GetResult();
}
}
public static void DownloadChannel(ChannelId id)
public static void DownloadChannel(string id)
{
DownloadChannel(id, Resolution.NoConvert);
}
public static void DownloadUser(UserName name, Resolution res)
public static void DownloadUser(string name, Resolution res)
{
DL._DownloadUser(name, res).GetAwaiter().GetResult();
UserName? v=UserName.TryParse(name);
if (v.HasValue)
{
DL._DownloadUser(v.Value, res).GetAwaiter().GetResult();
}
}
public static void DownloadUser(UserName name)
public static void DownloadUser(string name)
{
DownloadUser(name, Resolution.NoConvert);
}

View File

@ -8,7 +8,7 @@ namespace TessesYoutubeDownloader.Server.Models
{
class SavedPlaylist
{
public static async Task<SavedPlaylist> FromPlaylistId(Resolution res,YoutubeExplode.YoutubeClient ytc,YoutubeExplode.Playlists.PlaylistId id,Action<YoutubeExplode.Videos.VideoId,Resolution> addToQueue, Action<int, int, string,string> downloadThumbnail)
public static async Task<SavedPlaylist> FromPlaylistId(Resolution res,YoutubeExplode.YoutubeClient ytc,YoutubeExplode.Playlists.PlaylistId id,Action<string,Resolution> addToQueue, Action<int, int, string,string> downloadThumbnail)
{
SavedPlaylist pl2 = new SavedPlaylist();
pl2.Videos = new List<string>();
@ -25,12 +25,14 @@ namespace TessesYoutubeDownloader.Server.Models
{
downloadThumbnail(thumb.Resolution.Width, thumb.Resolution.Height,id, thumb.Url);
}
var plv = ytc.Playlists.GetVideosAsync(id).GetAsyncEnumerator();
while(await plv.MoveNextAsync())
{
addToQueue(plv.Current.Id,res);
pl2.Videos.Add(plv.Current.Id);
var cvids = await ytc.Playlists.GetVideosAsync(id).ToListAsync();
foreach (var v in cvids)
{
addToQueue(v.Id,res);
pl2.Videos.Add(v.Id);
}
return pl2;
}
public List<string> Videos { get; set; }

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
2a5e8789af6d18f40163043d238b63564245c869
b4ca8c584923940929f3de1b0f73baa4a23e2ad6

View File

@ -33,3 +33,5 @@ C:\Users\Demetria Lovato\youtube-downloader\obj\Debug\youtube-downloader.csproj.
C:\Users\Demetria Lovato\youtube-downloader\obj\Debug\youtube-downloader.csproj.CopyComplete
C:\Users\Demetria Lovato\youtube-downloader\obj\Debug\youtube-downloader.exe
C:\Users\Demetria Lovato\youtube-downloader\obj\Debug\youtube-downloader.pdb
C:\Users\Demetria Lovato\youtube-downloader\bin\Debug\System.Linq.Async.dll
C:\Users\Demetria Lovato\youtube-downloader\bin\Debug\System.Linq.Async.xml

Binary file not shown.

Binary file not shown.

View File

@ -5,6 +5,7 @@
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.1" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.Linq.Async" version="5.0.0" targetFramework="net48" />
<package id="System.Memory" version="4.5.4" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net48" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -50,6 +50,9 @@
<HintPath>packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Linq.Async, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>packages\System.Linq.Async.5.0.0\lib\net461\System.Linq.Async.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>