twitch vod downloading done

ffmpeg essentials

fix

Project reorganized

git lfs

ffmpeg removed

ffmpeg added
This commit is contained in:
2024-02-14 02:07:22 +01:00
Unverified
parent 91f9b645bd
commit e3ec5c3a48
264 changed files with 6239 additions and 4014 deletions

View 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
}
}

View 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,
}
}

View 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
{
}
}

View 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
}
}

View 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
}
}

View 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
View 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
}
}

View 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
}
}

View 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,
}
}

View 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
}
}

View 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
}
}