files moved
This commit is contained in:
parent
0443cc6527
commit
639a7dd0cf
@ -4,7 +4,6 @@ using DTLib.Dtsod;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using VkAudioDownloader;
|
using VkAudioDownloader;
|
||||||
using DTLib.Logging.New;
|
using DTLib.Logging.New;
|
||||||
using VkAudioDownloader.VkM3U8;
|
|
||||||
|
|
||||||
if(!File.Exists("config.dtsod"))
|
if(!File.Exists("config.dtsod"))
|
||||||
{
|
{
|
||||||
@ -18,6 +17,7 @@ var logger = new CompositeLogger(new DefaultLogFormat(true),
|
|||||||
new ConsoleLogger(),
|
new ConsoleLogger(),
|
||||||
new FileLogger("logs", "VkAudioDownloaer"));
|
new FileLogger("logs", "VkAudioDownloaer"));
|
||||||
var _logger = new LoggerContext(logger, "main");
|
var _logger = new LoggerContext(logger, "main");
|
||||||
|
_logger.LogDebug("DEBUG LOG ENABLED");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -25,8 +25,8 @@ try
|
|||||||
AudioAesDecryptor.TestAes();
|
AudioAesDecryptor.TestAes();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
_logger.LogInfo("initializing api...");
|
||||||
var client = new VkClient(config, logger);
|
var client = new VkClient(config, logger);
|
||||||
_logger.LogDebug("initializing api...");
|
|
||||||
await client.ConnectAsync();
|
await client.ConnectAsync();
|
||||||
|
|
||||||
// getting audio from vk
|
// getting audio from vk
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
using System;
|
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using DTLib.Filesystem;
|
|
||||||
using Stream = System.IO.Stream;
|
using Stream = System.IO.Stream;
|
||||||
|
|
||||||
namespace VkAudioDownloader.VkM3U8;
|
namespace VkAudioDownloader;
|
||||||
|
|
||||||
public class AudioAesDecryptor : IDisposable
|
public class AudioAesDecryptor : IDisposable
|
||||||
{
|
{
|
||||||
@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using VkNet.Model.Attachments;
|
using VkNet.Model.Attachments;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,4 @@
|
|||||||
using System;
|
|
||||||
using CliWrap;
|
using CliWrap;
|
||||||
using DTLib.Filesystem;
|
|
||||||
using DTLib.Extensions;
|
|
||||||
using DTLib.Logging.New;
|
|
||||||
|
|
||||||
namespace VkAudioDownloader;
|
namespace VkAudioDownloader;
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
global using System.Threading.Tasks;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using DTLib.Filesystem;
|
using VkAudioDownloader.VkM3U8;
|
||||||
using Stream = System.IO.Stream;
|
using Stream = System.IO.Stream;
|
||||||
|
|
||||||
|
|
||||||
namespace VkAudioDownloader.VkM3U8;
|
namespace VkAudioDownloader;
|
||||||
|
|
||||||
public class HttpHelper : HttpClient
|
public class HttpHelper : HttpClient
|
||||||
{
|
{
|
||||||
@ -1,4 +1,10 @@
|
|||||||
using System;
|
global using System;
|
||||||
|
global using System.Threading.Tasks;
|
||||||
|
global using System.Collections.Generic;
|
||||||
|
global using DTLib.Filesystem;
|
||||||
|
global using DTLib.Extensions;
|
||||||
|
global using DTLib.Logging.New;
|
||||||
|
using DTLib.Logging.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||||
using VkNet;
|
using VkNet;
|
||||||
@ -8,15 +14,10 @@ using VkNet.Model.RequestParams;
|
|||||||
using VkNet.Utils;
|
using VkNet.Utils;
|
||||||
using VkNet.Model.Attachments;
|
using VkNet.Model.Attachments;
|
||||||
using VkNet.AudioBypassService.Extensions;
|
using VkNet.AudioBypassService.Extensions;
|
||||||
using DTLib.Logging.DependencyInjection;
|
|
||||||
using DTLib.Logging.New;
|
|
||||||
using DTLib.Filesystem;
|
|
||||||
using VkAudioDownloader.VkM3U8;
|
using VkAudioDownloader.VkM3U8;
|
||||||
|
|
||||||
namespace VkAudioDownloader;
|
namespace VkAudioDownloader;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class VkClient : IDisposable
|
public class VkClient : IDisposable
|
||||||
{
|
{
|
||||||
public VkApi Api;
|
public VkApi Api;
|
||||||
@ -114,4 +115,4 @@ public class VkClient : IDisposable
|
|||||||
_http.Dispose();
|
_http.Dispose();
|
||||||
_disposed = true;
|
_disposed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,4 +59,4 @@ public class VkClientConfig
|
|||||||
{ "ffmpeg_dir", FFMPegDir}
|
{ "ffmpeg_dir", FFMPegDir}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using DTLib.Extensions;
|
|
||||||
|
|
||||||
namespace VkAudioDownloader.VkM3U8;
|
namespace VkAudioDownloader.VkM3U8;
|
||||||
|
|
||||||
public class M3U8Parser
|
public class M3U8Parser
|
||||||
@ -78,7 +73,7 @@ public class M3U8Parser
|
|||||||
if(line.StartsWith("#EXTINF:"))
|
if(line.StartsWith("#EXTINF:"))
|
||||||
{
|
{
|
||||||
var duration = line.After(':').Before(',');
|
var duration = line.After(':').Before(',');
|
||||||
_fragmentDuration = float.Parse(duration, NumberStyles.Any, CultureInfo.InvariantCulture.NumberFormat);
|
_fragmentDuration = duration.ToFloat();
|
||||||
}
|
}
|
||||||
else if (line.StartsWith("#EXT-X-KEY:METHOD="))
|
else if (line.StartsWith("#EXT-X-KEY:METHOD="))
|
||||||
{
|
{
|
||||||
@ -115,4 +110,4 @@ public class M3U8Parser
|
|||||||
_fragmentEncrypted = false;
|
_fragmentEncrypted = false;
|
||||||
_fragmentEncryptionKeyUrl = null;
|
_fragmentEncryptionKeyUrl = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user