twitch vod downloading done
ffmpeg essentials fix Project reorganized git lfs ffmpeg removed ffmpeg added
This commit is contained in:
16
VDownload.Models/AudioExtension.cs
Normal file
16
VDownload.Models/AudioExtension.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Models
|
||||
{
|
||||
public enum AudioExtension
|
||||
{
|
||||
MP3,
|
||||
FLAC,
|
||||
WAV,
|
||||
OGG
|
||||
}
|
||||
}
|
||||
21
VDownload.Models/MediaType.cs
Normal file
21
VDownload.Models/MediaType.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Models
|
||||
{
|
||||
public enum MediaType
|
||||
{
|
||||
[Description("Original")]
|
||||
Original,
|
||||
|
||||
[Description("Only video")]
|
||||
OnlyVideo,
|
||||
|
||||
[Description("Only audio")]
|
||||
OnlyAudio,
|
||||
}
|
||||
}
|
||||
12
VDownload.Models/Playlist.cs
Normal file
12
VDownload.Models/Playlist.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Models
|
||||
{
|
||||
public abstract class Playlist
|
||||
{
|
||||
}
|
||||
}
|
||||
21
VDownload.Models/ProcessingSpeed.cs
Normal file
21
VDownload.Models/ProcessingSpeed.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Models
|
||||
{
|
||||
public enum ProcessingSpeed
|
||||
{
|
||||
VerySlow = 0,
|
||||
Slower = 1,
|
||||
Slow = 2,
|
||||
Medium = 3,
|
||||
Fast = 4,
|
||||
Faster = 5,
|
||||
VeryFast = 6,
|
||||
SuperFast = 7,
|
||||
UltraFast = 8
|
||||
}
|
||||
}
|
||||
13
VDownload.Models/Source.cs
Normal file
13
VDownload.Models/Source.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Models
|
||||
{
|
||||
public enum Source
|
||||
{
|
||||
Twitch
|
||||
}
|
||||
}
|
||||
9
VDownload.Models/VDownload.Models.csproj
Normal file
9
VDownload.Models/VDownload.Models.csproj
Normal file
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
37
VDownload.Models/Video.cs
Normal file
37
VDownload.Models/Video.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Models
|
||||
{
|
||||
public abstract class Video
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public string Title { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Author { get; set; }
|
||||
public DateTime PublishDate { get; set; }
|
||||
public TimeSpan Duration { get; set; }
|
||||
public long Views { get; set; }
|
||||
public Uri ThumbnailUrl { get; set; }
|
||||
public ICollection<VideoStream> Streams { get; set; }
|
||||
public Uri Url { get; set; }
|
||||
public Source Source { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region CONSTRUCTORS
|
||||
|
||||
protected Video()
|
||||
{
|
||||
Streams = new List<VideoStream>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
44
VDownload.Models/VideoDownloadOptions.cs
Normal file
44
VDownload.Models/VideoDownloadOptions.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Models
|
||||
{
|
||||
public class VideoDownloadOptions
|
||||
{
|
||||
#region FIELDS
|
||||
|
||||
private readonly TimeSpan _originalDuration;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PROPERTIES
|
||||
|
||||
public required VideoStream SelectedStream { get; set; }
|
||||
public required TimeSpan TrimStart { get; set; }
|
||||
public required TimeSpan TrimEnd { get; set; }
|
||||
public required MediaType MediaType { get; set; }
|
||||
public required string Directory { get; set; }
|
||||
public required string Filename { get; set; }
|
||||
public required string Extension { get; set; }
|
||||
public TimeSpan DurationAfterTrim => TrimEnd - TrimStart;
|
||||
public bool IsTrimmed => _originalDuration != DurationAfterTrim;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public VideoDownloadOptions(TimeSpan originalDuration)
|
||||
{
|
||||
_originalDuration = originalDuration;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
18
VDownload.Models/VideoExtension.cs
Normal file
18
VDownload.Models/VideoExtension.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Models
|
||||
{
|
||||
public enum VideoExtension
|
||||
{
|
||||
MP4,
|
||||
MKV,
|
||||
AVI,
|
||||
MOV,
|
||||
WEBM,
|
||||
WMV,
|
||||
}
|
||||
}
|
||||
27
VDownload.Models/VideoStream.cs
Normal file
27
VDownload.Models/VideoStream.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Models
|
||||
{
|
||||
public abstract class VideoStream
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public override string ToString() => Name;
|
||||
|
||||
public abstract Task<VideoStreamDownloadResult> Download(string taskTemporaryDirectory, IProgress<double> onProgress, CancellationToken token, TimeSpan trimStart, TimeSpan trimEnd);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
20
VDownload.Models/VideoStreamDownloadResult.cs
Normal file
20
VDownload.Models/VideoStreamDownloadResult.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VDownload.Models
|
||||
{
|
||||
public struct VideoStreamDownloadResult
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
public required string File { get; init; }
|
||||
public required TimeSpan NewTrimStart { get; init; }
|
||||
public required TimeSpan NewTrimEnd { get; init; }
|
||||
public required TimeSpan NewDuration { get; init; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user