1.0-dev1 (First commit)
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
custom: ['https://paypal.me/mateuszskoczek']
|
||||||
389
.gitignore
vendored
Normal file
@@ -0,0 +1,389 @@
|
|||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
##
|
||||||
|
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.rsuser
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
|
*.userprefs
|
||||||
|
|
||||||
|
# Mono auto generated files
|
||||||
|
mono_crash.*
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
[Dd]ebug/
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
[Pp]roperties/
|
||||||
|
|
||||||
|
# Visual Studio 2015/2017 cache/options directory
|
||||||
|
.vs/
|
||||||
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
#wwwroot/
|
||||||
|
|
||||||
|
# Visual Studio 2017 auto generated files
|
||||||
|
Generated\ Files/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUnit
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
|
|
||||||
|
# Build Results of an ATL Project
|
||||||
|
[Dd]ebugPS/
|
||||||
|
[Rr]eleasePS/
|
||||||
|
dlldata.c
|
||||||
|
|
||||||
|
# Benchmark Results
|
||||||
|
BenchmarkDotNet.Artifacts/
|
||||||
|
|
||||||
|
# .NET Core
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
# ASP.NET Scaffolding
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
|
||||||
|
# StyleCop
|
||||||
|
StyleCopReport.xml
|
||||||
|
|
||||||
|
# Files built by Visual Studio
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*_h.h
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.iobj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.ipdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*_wpftmp.csproj
|
||||||
|
*.log
|
||||||
|
*.tlog
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.svclog
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Chutzpah Test files
|
||||||
|
_Chutzpah*
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opendb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
*.VC.db
|
||||||
|
*.VC.VC.opendb
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
*.sap
|
||||||
|
|
||||||
|
# Visual Studio Trace Files
|
||||||
|
*.e2e
|
||||||
|
|
||||||
|
# TFS 2012 Local Workspace
|
||||||
|
$tf/
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
*.DotSettings.user
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# AxoCover is a Code Coverage Tool
|
||||||
|
.axoCover/*
|
||||||
|
!.axoCover/settings.json
|
||||||
|
|
||||||
|
# Coverlet is a free, cross platform Code Coverage Tool
|
||||||
|
coverage*.json
|
||||||
|
coverage*.xml
|
||||||
|
coverage*.info
|
||||||
|
|
||||||
|
# Visual Studio code coverage results
|
||||||
|
*.coverage
|
||||||
|
*.coveragexml
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
_NCrunch_*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
nCrunchTemp_*
|
||||||
|
|
||||||
|
# MightyMoose
|
||||||
|
*.mm.*
|
||||||
|
AutoTest.Net/
|
||||||
|
|
||||||
|
# Web workbench (sass)
|
||||||
|
.sass-cache/
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.azurePubxml
|
||||||
|
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||||
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
|
*.pubxml
|
||||||
|
*.publishproj
|
||||||
|
|
||||||
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||||
|
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||||
|
# in these scripts will be unencrypted
|
||||||
|
PublishScripts/
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# NuGet Symbol Packages
|
||||||
|
*.snupkg
|
||||||
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/[Pp]ackages/*
|
||||||
|
# except build/, which is used as an MSBuild target.
|
||||||
|
!**/[Pp]ackages/build/
|
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
|
#!**/[Pp]ackages/repositories.config
|
||||||
|
# NuGet v3's project.json files produces more ignorable files
|
||||||
|
*.nuget.props
|
||||||
|
*.nuget.targets
|
||||||
|
|
||||||
|
# Nuget personal access tokens and Credentials
|
||||||
|
nuget.config
|
||||||
|
|
||||||
|
# Microsoft Azure Build Output
|
||||||
|
csx/
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Microsoft Azure Emulator
|
||||||
|
ecf/
|
||||||
|
rcf/
|
||||||
|
|
||||||
|
# Windows Store app package directories and files
|
||||||
|
AppPackages/
|
||||||
|
BundleArtifacts/
|
||||||
|
Package.StoreAssociation.xml
|
||||||
|
_pkginfo.txt
|
||||||
|
*.appx
|
||||||
|
*.appxbundle
|
||||||
|
*.appxupload
|
||||||
|
|
||||||
|
# Visual Studio cache files
|
||||||
|
# files ending in .cache can be ignored
|
||||||
|
*.[Cc]ache
|
||||||
|
# but keep track of directories ending in .cache
|
||||||
|
!?*.[Cc]ache/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
ClientBin/
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.dbproj.schemaview
|
||||||
|
*.jfm
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
orleans.codegen.cs
|
||||||
|
|
||||||
|
# Including strong name files can present a security risk
|
||||||
|
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||||
|
#*.snk
|
||||||
|
|
||||||
|
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||||
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||||
|
#bower_components/
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file
|
||||||
|
# to a newer Visual Studio version. Backup files are not needed,
|
||||||
|
# because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
ServiceFabricBackup/
|
||||||
|
*.rptproj.bak
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
*.mdf
|
||||||
|
*.ldf
|
||||||
|
*.ndf
|
||||||
|
|
||||||
|
# Business Intelligence projects
|
||||||
|
*.rdl.data
|
||||||
|
*.bim.layout
|
||||||
|
*.bim_*.settings
|
||||||
|
*.rptproj.rsuser
|
||||||
|
*- [Bb]ackup.rdl
|
||||||
|
*- [Bb]ackup ([0-9]).rdl
|
||||||
|
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||||
|
|
||||||
|
# Microsoft Fakes
|
||||||
|
FakesAssemblies/
|
||||||
|
|
||||||
|
# GhostDoc plugin setting file
|
||||||
|
*.GhostDoc.xml
|
||||||
|
|
||||||
|
# Node.js Tools for Visual Studio
|
||||||
|
.ntvs_analysis.dat
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Visual Studio 6 build log
|
||||||
|
*.plg
|
||||||
|
|
||||||
|
# Visual Studio 6 workspace options file
|
||||||
|
*.opt
|
||||||
|
|
||||||
|
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||||
|
*.vbw
|
||||||
|
|
||||||
|
# Visual Studio LightSwitch build output
|
||||||
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
|
**/*.Server/GeneratedArtifacts
|
||||||
|
**/*.Server/ModelManifest.xml
|
||||||
|
_Pvt_Extensions
|
||||||
|
|
||||||
|
# Paket dependency manager
|
||||||
|
.paket/paket.exe
|
||||||
|
paket-files/
|
||||||
|
|
||||||
|
# FAKE - F# Make
|
||||||
|
.fake/
|
||||||
|
|
||||||
|
# CodeRush personal settings
|
||||||
|
.cr/personal
|
||||||
|
|
||||||
|
# Python Tools for Visual Studio (PTVS)
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Cake - Uncomment if you are using it
|
||||||
|
# tools/**
|
||||||
|
# !tools/packages.config
|
||||||
|
|
||||||
|
# Tabs Studio
|
||||||
|
*.tss
|
||||||
|
|
||||||
|
# Telerik's JustMock configuration file
|
||||||
|
*.jmconfig
|
||||||
|
|
||||||
|
# BizTalk build output
|
||||||
|
*.btp.cs
|
||||||
|
*.btm.cs
|
||||||
|
*.odx.cs
|
||||||
|
*.xsd.cs
|
||||||
|
|
||||||
|
# OpenCover UI analysis results
|
||||||
|
OpenCover/
|
||||||
|
|
||||||
|
# Azure Stream Analytics local run output
|
||||||
|
ASALocalRun/
|
||||||
|
|
||||||
|
# MSBuild Binary and Structured Log
|
||||||
|
*.binlog
|
||||||
|
|
||||||
|
# NVidia Nsight GPU debugger configuration file
|
||||||
|
*.nvuser
|
||||||
|
|
||||||
|
# MFractors (Xamarin productivity tool) working folder
|
||||||
|
.mfractor/
|
||||||
|
|
||||||
|
# Local History for Visual Studio
|
||||||
|
.localhistory/
|
||||||
|
|
||||||
|
# BeatPulse healthcheck temp database
|
||||||
|
healthchecksdb
|
||||||
|
|
||||||
|
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||||
|
MigrationBackup/
|
||||||
|
|
||||||
|
# Ionide (cross platform F# VS Code tools) working folder
|
||||||
|
.ionide/
|
||||||
|
|
||||||
|
# Fody - auto-generated XML schema
|
||||||
|
FodyWeavers.xsd
|
||||||
|
|
||||||
|
# VS Code files for those working on multiple tools
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
*.code-workspace
|
||||||
|
|
||||||
|
# Local History for Visual Studio Code
|
||||||
|
.history/
|
||||||
|
|
||||||
|
# Windows Installer files from build outputs
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msix
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# JetBrains Rider
|
||||||
|
.idea/
|
||||||
|
*.sln.iml
|
||||||
56
VDownload.sln
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.0.31903.59
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VDownload", "VDownload\VDownload.csproj", "{324AB81A-F68D-424D-B90E-5402F5E44240}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A087406C-5459-423E-BB0B-84BC93E5B38F}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
.editorconfig = .editorconfig
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|ARM = Debug|ARM
|
||||||
|
Debug|ARM64 = Debug|ARM64
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|ARM = Release|ARM
|
||||||
|
Release|ARM64 = Release|ARM64
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|ARM64.Deploy.0 = Debug|ARM64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x64.Deploy.0 = Debug|x64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Debug|x86.Deploy.0 = Debug|x86
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM.Deploy.0 = Release|ARM
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM64.Build.0 = Release|ARM64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|ARM64.Deploy.0 = Release|ARM64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x64.Build.0 = Release|x64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x64.Deploy.0 = Release|x64
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x86.Build.0 = Release|x86
|
||||||
|
{324AB81A-F68D-424D-B90E-5402F5E44240}.Release|x86.Deploy.0 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {878070E9-B074-4931-94AC-8BACD6906448}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
9
VDownload/App.xaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<Application
|
||||||
|
x:Class="VDownload.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="using:VDownload">
|
||||||
|
<Application.Resources>
|
||||||
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
||||||
78
VDownload/App.xaml.cs
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
// Internal
|
||||||
|
using VDownload.Services;
|
||||||
|
|
||||||
|
// System
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Windows.ApplicationModel;
|
||||||
|
using Windows.ApplicationModel.Activation;
|
||||||
|
using Windows.Storage;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
using Windows.UI.Xaml.Navigation;
|
||||||
|
|
||||||
|
namespace VDownload
|
||||||
|
{
|
||||||
|
sealed partial class App : Application
|
||||||
|
{
|
||||||
|
public App()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
Suspending += OnSuspending;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async void OnLaunched(LaunchActivatedEventArgs e)
|
||||||
|
{
|
||||||
|
// Rebuild configuration file
|
||||||
|
Config.Rebuild();
|
||||||
|
|
||||||
|
// Delete temp on start
|
||||||
|
if (Config.GetValue("delete_temp_on_start") == "1")
|
||||||
|
{
|
||||||
|
IReadOnlyList<IStorageItem> tempItems = await ApplicationData.Current.TemporaryFolder.GetItemsAsync();
|
||||||
|
List<Task> tasks = new List<Task>();
|
||||||
|
foreach (IStorageItem item in tempItems) tasks.Add(item.DeleteAsync().AsTask());
|
||||||
|
await Task.WhenAll(tasks);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do not repeat app initialization when the Window already has content,
|
||||||
|
// just ensure that the window is active
|
||||||
|
if (!(Window.Current.Content is Frame rootFrame))
|
||||||
|
{
|
||||||
|
// Create a Frame to act as the navigation context and navigate to the first page
|
||||||
|
rootFrame = new Frame();
|
||||||
|
rootFrame.NavigationFailed += OnNavigationFailed;
|
||||||
|
|
||||||
|
// Place the frame in the current Window
|
||||||
|
Window.Current.Content = rootFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.PrelaunchActivated == false)
|
||||||
|
{
|
||||||
|
if (rootFrame.Content == null)
|
||||||
|
{
|
||||||
|
// When the navigation stack isn't restored navigate to the first page,
|
||||||
|
// configuring the new page by passing required information as a navigation
|
||||||
|
// parameter
|
||||||
|
rootFrame.Navigate(typeof(MainPage), e.Arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure the current window is active
|
||||||
|
Window.Current.Activate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
|
||||||
|
{
|
||||||
|
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSuspending(object sender, SuspendingEventArgs e)
|
||||||
|
{
|
||||||
|
var deferral = e.SuspendingOperation.GetDeferral();
|
||||||
|
//TODO: Save application state and stop any background activity
|
||||||
|
deferral.Complete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
VDownload/Assets/Icons/AddVideo/NotFound.png
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
VDownload/Assets/Icons/AddVideo/Start.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
VDownload/Assets/Icons/Sources/Twitch.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
VDownload/Assets/Icons/Sources/Unknown.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
VDownload/Assets/Icons/Sources/Youtube.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Author.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Cancelled.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Date.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Done.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Downloading.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Duration.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Error.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Finalizing.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Idle.png
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/MediaType.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Path.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Quality.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Transcoding.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Trim.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Views.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
VDownload/Assets/Icons/Universal/Dark/Waiting.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Author.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Cancelled.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Date.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Done.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Downloading.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Duration.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Error.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Finalizing.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Idle.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/MediaType.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Path.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Quality.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Transcoding.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Trim.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Views.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
VDownload/Assets/Icons/Universal/Light/Waiting.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
VDownload/Assets/Logo/LargeTile.scale-100.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
VDownload/Assets/Logo/LargeTile.scale-125.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
VDownload/Assets/Logo/LargeTile.scale-150.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
VDownload/Assets/Logo/LargeTile.scale-200.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
VDownload/Assets/Logo/LargeTile.scale-400.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
VDownload/Assets/Logo/Logo.png
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
VDownload/Assets/Logo/SmallTile.scale-100.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
VDownload/Assets/Logo/SmallTile.scale-125.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
VDownload/Assets/Logo/SmallTile.scale-150.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
VDownload/Assets/Logo/SmallTile.scale-200.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
VDownload/Assets/Logo/SmallTile.scale-400.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
VDownload/Assets/Logo/SplashScreen.scale-100.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
VDownload/Assets/Logo/SplashScreen.scale-125.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
VDownload/Assets/Logo/SplashScreen.scale-150.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
VDownload/Assets/Logo/SplashScreen.scale-200.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
VDownload/Assets/Logo/SplashScreen.scale-400.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
VDownload/Assets/Logo/Square150x150Logo.scale-100.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
VDownload/Assets/Logo/Square150x150Logo.scale-125.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
VDownload/Assets/Logo/Square150x150Logo.scale-150.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
VDownload/Assets/Logo/Square150x150Logo.scale-200.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
VDownload/Assets/Logo/Square150x150Logo.scale-400.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 703 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 703 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
BIN
VDownload/Assets/Logo/Square44x44Logo.scale-100.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
VDownload/Assets/Logo/Square44x44Logo.scale-125.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
VDownload/Assets/Logo/Square44x44Logo.scale-150.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
VDownload/Assets/Logo/Square44x44Logo.scale-200.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
VDownload/Assets/Logo/Square44x44Logo.scale-400.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
VDownload/Assets/Logo/Square44x44Logo.targetsize-16.png
Normal file
|
After Width: | Height: | Size: 571 B |
BIN
VDownload/Assets/Logo/Square44x44Logo.targetsize-24.png
Normal file
|
After Width: | Height: | Size: 854 B |
BIN
VDownload/Assets/Logo/Square44x44Logo.targetsize-256.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
VDownload/Assets/Logo/Square44x44Logo.targetsize-32.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
VDownload/Assets/Logo/Square44x44Logo.targetsize-48.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
VDownload/Assets/Logo/StoreLogo.scale-100.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
VDownload/Assets/Logo/StoreLogo.scale-125.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
VDownload/Assets/Logo/StoreLogo.scale-150.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
VDownload/Assets/Logo/StoreLogo.scale-200.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
VDownload/Assets/Logo/StoreLogo.scale-400.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
VDownload/Assets/Logo/Wide310x150Logo.scale-100.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
VDownload/Assets/Logo/Wide310x150Logo.scale-125.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
VDownload/Assets/Logo/Wide310x150Logo.scale-150.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
VDownload/Assets/Logo/Wide310x150Logo.scale-200.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
VDownload/Assets/Logo/Wide310x150Logo.scale-400.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
VDownload/Assets/Other/UnknownThumbnail.png
Normal file
|
After Width: | Height: | Size: 154 KiB |
10
VDownload/Objects/Enums/VideoSource.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace VDownload.Objects.Enums
|
||||||
|
{
|
||||||
|
public enum VideoSource
|
||||||
|
{
|
||||||
|
TwitchVod,
|
||||||
|
TwitchClip,
|
||||||
|
YoutubeVideo,
|
||||||
|
Null
|
||||||
|
}
|
||||||
|
}
|
||||||
10
VDownload/Objects/Enums/VideoStatus.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace VDownload.Objects.Enums
|
||||||
|
{
|
||||||
|
public enum VideoStatus
|
||||||
|
{
|
||||||
|
Idle,
|
||||||
|
Waiting,
|
||||||
|
InProgress,
|
||||||
|
Removed
|
||||||
|
}
|
||||||
|
}
|
||||||
49
VDownload/Package.appxmanifest
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<Package
|
||||||
|
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||||
|
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||||
|
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||||
|
IgnorableNamespaces="uap mp">
|
||||||
|
|
||||||
|
<Identity
|
||||||
|
Name="VDownload"
|
||||||
|
Publisher="CN=Mateusz"
|
||||||
|
Version="0.3.0.0" />
|
||||||
|
|
||||||
|
<mp:PhoneIdentity PhoneProductId="b0f59998-a2e2-4edb-a764-b0cf8c657336" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||||
|
|
||||||
|
<Properties>
|
||||||
|
<DisplayName>VDownload</DisplayName>
|
||||||
|
<PublisherDisplayName>Mateusz Skoczek</PublisherDisplayName>
|
||||||
|
<Logo>Assets\Logo\StoreLogo.png</Logo>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Dependencies>
|
||||||
|
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||||
|
</Dependencies>
|
||||||
|
|
||||||
|
<Resources>
|
||||||
|
<Resource Language="x-generate"/>
|
||||||
|
</Resources>
|
||||||
|
|
||||||
|
<Applications>
|
||||||
|
<Application Id="App"
|
||||||
|
Executable="$targetnametoken$.exe"
|
||||||
|
EntryPoint="VDownload.App">
|
||||||
|
<uap:VisualElements
|
||||||
|
DisplayName="VDownload"
|
||||||
|
Square150x150Logo="Assets\Logo\Square150x150Logo.png"
|
||||||
|
Square44x44Logo="Assets\Logo\Square44x44Logo.png"
|
||||||
|
Description="VDownload"
|
||||||
|
BackgroundColor="transparent">
|
||||||
|
<uap:DefaultTile Wide310x150Logo="Assets\Logo\Wide310x150Logo.png" Square71x71Logo="Assets\Logo\SmallTile.png" Square310x310Logo="Assets\Logo\LargeTile.png"/>
|
||||||
|
<uap:SplashScreen Image="Assets\Logo\SplashScreen.png" />
|
||||||
|
</uap:VisualElements>
|
||||||
|
</Application>
|
||||||
|
</Applications>
|
||||||
|
|
||||||
|
<Capabilities>
|
||||||
|
<Capability Name="internetClient" />
|
||||||
|
</Capabilities>
|
||||||
|
</Package>
|
||||||
101
VDownload/Services/Config.cs
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
// System
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Windows.Storage;
|
||||||
|
|
||||||
|
namespace VDownload.Services
|
||||||
|
{
|
||||||
|
internal class Config
|
||||||
|
{
|
||||||
|
#region CONSTANTS
|
||||||
|
|
||||||
|
// DATA VALUES LISTS
|
||||||
|
public static readonly string[] DateFormatList = new string[]
|
||||||
|
{
|
||||||
|
"yyyy.MM.dd",
|
||||||
|
"yyyy.dd.MM",
|
||||||
|
"dd.MM.yyyy",
|
||||||
|
"MM.dd.yyyy",
|
||||||
|
};
|
||||||
|
public static readonly string[] DefaultMediaTypeList = new string[]
|
||||||
|
{
|
||||||
|
"AV",
|
||||||
|
"A",
|
||||||
|
"V"
|
||||||
|
};
|
||||||
|
public static readonly string[] DefaultVideoExtensionList = new string[]
|
||||||
|
{
|
||||||
|
"MP4",
|
||||||
|
"WMV",
|
||||||
|
"HEVC"
|
||||||
|
};
|
||||||
|
public static readonly string[] DefaultAudioExtensionList = new string[]
|
||||||
|
{
|
||||||
|
"MP3",
|
||||||
|
"FLAC",
|
||||||
|
"WAV",
|
||||||
|
"M4A",
|
||||||
|
"ALAC",
|
||||||
|
"WMA"
|
||||||
|
};
|
||||||
|
|
||||||
|
// DEFAULT SETTINGS
|
||||||
|
private static readonly Dictionary<string, string> DefaultSettings = new Dictionary<string, string>()
|
||||||
|
{
|
||||||
|
{ "max_video_tasks" , "5" },
|
||||||
|
{ "default_video_extension", DefaultVideoExtensionList[0] },
|
||||||
|
{ "default_audio_extension", DefaultAudioExtensionList[0] },
|
||||||
|
{ "date_format", DateFormatList[0] },
|
||||||
|
{ "default_media_type", DefaultMediaTypeList[0] },
|
||||||
|
{ "default_output_filename", "[%date_pub%] %title%" },
|
||||||
|
{ "use_mrfcrf444", "1" },
|
||||||
|
{ "use_hardware_acceleration", "1" },
|
||||||
|
{ "delete_temp_on_start", "1" },
|
||||||
|
{ "delete_video_temp_after_error", "1" }
|
||||||
|
};
|
||||||
|
|
||||||
|
// SETTINGS CONTAINER
|
||||||
|
private static readonly ApplicationDataContainer SettingsContainer = ApplicationData.Current.LocalSettings;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region MAIN
|
||||||
|
|
||||||
|
// GET VALUE
|
||||||
|
public static string GetValue(string key)
|
||||||
|
{
|
||||||
|
return SettingsContainer.Values[key].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// SET VALUE
|
||||||
|
public static void SetValue(string key, string value)
|
||||||
|
{
|
||||||
|
SettingsContainer.Values[key] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// SET DEFAULT
|
||||||
|
public static void SetDefault()
|
||||||
|
{
|
||||||
|
foreach (KeyValuePair<string, string> s in DefaultSettings)
|
||||||
|
{
|
||||||
|
SettingsContainer.Values[s.Key] = s.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// REBUILD
|
||||||
|
public static void Rebuild()
|
||||||
|
{
|
||||||
|
foreach (KeyValuePair<string, string> s in DefaultSettings)
|
||||||
|
{
|
||||||
|
if (!SettingsContainer.Values.ContainsKey(s.Key))
|
||||||
|
{
|
||||||
|
SettingsContainer.Values[s.Key] = s.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
119
VDownload/Services/Media.cs
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
// System
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Windows.ApplicationModel.Resources;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Media.MediaProperties;
|
||||||
|
using Windows.Media.Transcoding;
|
||||||
|
using Windows.Storage;
|
||||||
|
using Windows.Storage.Streams;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace VDownload.Services
|
||||||
|
{
|
||||||
|
internal class Media
|
||||||
|
{
|
||||||
|
#region VARIABLES
|
||||||
|
|
||||||
|
// PROGRESS UI ELEMENTS
|
||||||
|
private TextBlock ProgressLabelTextblock;
|
||||||
|
private ProgressBar ProgressBar;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region MAIN
|
||||||
|
|
||||||
|
// TRANSCODE MEDIA FILE
|
||||||
|
public async Task Transcode(StorageFile inputFile, StorageFile outputFile, string extension, string mediaType, TimeSpan duration, TimeSpan trimStart, TimeSpan trimEnd, CancellationToken token, TextBlock progressLabelTextblock, ProgressBar progressBar)
|
||||||
|
{
|
||||||
|
// Set progress UI elements
|
||||||
|
ProgressLabelTextblock = progressLabelTextblock;
|
||||||
|
ProgressBar = progressBar;
|
||||||
|
|
||||||
|
// Init transcoder
|
||||||
|
MediaTranscoder transcoder = new MediaTranscoder
|
||||||
|
{
|
||||||
|
HardwareAccelerationEnabled = Config.GetValue("use_hardware_acceleration") == "1" ? true : false,
|
||||||
|
VideoProcessingAlgorithm = Config.GetValue("use_mrfcrf444") == "1" ? MediaVideoProcessingAlgorithm.MrfCrf444 : MediaVideoProcessingAlgorithm.Default
|
||||||
|
};
|
||||||
|
if (0 < trimStart.TotalMilliseconds && trimStart.TotalMilliseconds < duration.TotalMilliseconds) // Set trimming at start
|
||||||
|
{
|
||||||
|
transcoder.TrimStartTime = trimStart;
|
||||||
|
}
|
||||||
|
if (0 < trimEnd.TotalMilliseconds && trimEnd.TotalMilliseconds < duration.TotalMilliseconds) // Set trimming at end
|
||||||
|
{
|
||||||
|
transcoder.TrimStopTime = trimEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set video encoding profile
|
||||||
|
MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.HD1080p);
|
||||||
|
switch (extension)
|
||||||
|
{
|
||||||
|
case "MP4": profile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.HD1080p); break;
|
||||||
|
case "WMV": profile = MediaEncodingProfile.CreateWmv(VideoEncodingQuality.HD1080p); break;
|
||||||
|
case "HEVC": profile = MediaEncodingProfile.CreateHevc(VideoEncodingQuality.HD1080p); break;
|
||||||
|
case "MP3": profile = MediaEncodingProfile.CreateMp3(AudioEncodingQuality.High); break;
|
||||||
|
case "FLAC": profile = MediaEncodingProfile.CreateFlac(AudioEncodingQuality.High); break;
|
||||||
|
case "WAV": profile = MediaEncodingProfile.CreateWav(AudioEncodingQuality.High); break;
|
||||||
|
case "M4A": profile = MediaEncodingProfile.CreateM4a(AudioEncodingQuality.High); break;
|
||||||
|
case "ALAC": profile = MediaEncodingProfile.CreateAlac(AudioEncodingQuality.High); break;
|
||||||
|
case "WMA": profile = MediaEncodingProfile.CreateWma(AudioEncodingQuality.High); break;
|
||||||
|
}
|
||||||
|
var videoData = await inputFile.Properties.GetVideoPropertiesAsync();
|
||||||
|
var audioData = await inputFile.Properties.GetMusicPropertiesAsync();
|
||||||
|
if (mediaType != "A")
|
||||||
|
{
|
||||||
|
profile.Video.Height = videoData.Height;
|
||||||
|
profile.Video.Width = videoData.Width;
|
||||||
|
profile.Video.Bitrate = videoData.Bitrate - audioData.Bitrate;
|
||||||
|
}
|
||||||
|
if (mediaType != "V")
|
||||||
|
{
|
||||||
|
profile.Audio.Bitrate = audioData.Bitrate;
|
||||||
|
}
|
||||||
|
if (mediaType == "V")
|
||||||
|
{
|
||||||
|
var audioTracks = profile.GetAudioTracks();
|
||||||
|
audioTracks.Clear();
|
||||||
|
profile.SetAudioTracks(audioTracks.AsEnumerable());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start transcoding operation
|
||||||
|
using (IRandomAccessStream outputFileOpened = await outputFile.OpenAsync(FileAccessMode.ReadWrite))
|
||||||
|
{
|
||||||
|
PrepareTranscodeResult transcodingPreparated = await transcoder.PrepareStreamTranscodeAsync(await inputFile.OpenAsync(FileAccessMode.Read), outputFileOpened, profile);
|
||||||
|
IAsyncActionWithProgress<double> transcodingTask = transcodingPreparated.TranscodeAsync();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await transcodingTask.AsTask(token, new Progress<double>(OnProgress));
|
||||||
|
await outputFileOpened.FlushAsync();
|
||||||
|
}
|
||||||
|
catch (TaskCanceledException) { }
|
||||||
|
transcodingTask.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region EVENTS
|
||||||
|
|
||||||
|
// ON PROGRESS
|
||||||
|
private void OnProgress(double percent)
|
||||||
|
{
|
||||||
|
// Set progress
|
||||||
|
ProgressLabelTextblock.Text = $"{ResourceLoader.GetForCurrentView().GetString("VideoPanelProgressLabelTranscoding")} ({Math.Floor(percent)}%)";
|
||||||
|
ProgressBar.IsIndeterminate = false;
|
||||||
|
ProgressBar.Visibility = Visibility.Visible;
|
||||||
|
ProgressBar.Value = percent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
43
VDownload/Services/Source.cs
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
// Internal
|
||||||
|
using VDownload.Objects.Enums;
|
||||||
|
|
||||||
|
// System
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace VDownload.Services
|
||||||
|
{
|
||||||
|
internal class Source
|
||||||
|
{
|
||||||
|
public static (VideoSource, string) GetVideoSourceData(Uri url)
|
||||||
|
{
|
||||||
|
// Twitch VOD
|
||||||
|
if (url.Host == "www.twitch.tv" && url.Segments.Contains("videos/"))
|
||||||
|
{
|
||||||
|
return (VideoSource.TwitchVod, url.Segments[url.Segments.Length - 1].Replace("/", ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Twitch Clip
|
||||||
|
else if ((url.Host == "www.twitch.tv" && url.Segments.Contains("clip/")) || url.Host == "clips.twitch.tv")
|
||||||
|
{
|
||||||
|
return (VideoSource.TwitchClip, url.Segments[url.Segments.Length - 1].Replace("/", ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Youtube Video
|
||||||
|
else if (url.Host == "www.youtube.com" && url.Segments.Contains("watch"))
|
||||||
|
{
|
||||||
|
return (VideoSource.YoutubeVideo, url.Query.Replace("?", "").Split('&')[0].Replace("v=", ""));
|
||||||
|
}
|
||||||
|
else if (url.Host == "youtu.be")
|
||||||
|
{
|
||||||
|
return (VideoSource.YoutubeVideo, url.Segments[url.Segments.Length - 1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unknown
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (VideoSource.Null, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||