Files
allstarr/octo-fiesta/Program.cs
V1ck3s 8aa9c2d437 feat: implement DeezerDownloadService with Blowfish decryption
- Port JavaScript DeezerDownloader to C#
- Add Deezer API authentication with ARL token
- Implement track download via media.deezer.com API
- Add Blowfish CBC decryption for encrypted chunks (uses OpenSSL)
- Add rate limiting and retry with exponential backoff
- Update config for Deezer ARL tokens
- Configure Subsonic URL to 192.168.1.12:4533
2025-12-13 18:06:37 +01:00

50 lines
1.2 KiB
C#

using octo_fiesta.Models;
using octo_fiesta.Services;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddHttpClient();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
// Configuration
builder.Services.Configure<SubsonicSettings>(
builder.Configuration.GetSection("Subsonic"));
// Services métier
builder.Services.AddSingleton<ILocalLibraryService, LocalLibraryService>();
builder.Services.AddScoped<IMusicMetadataService, DeezerMetadataService>();
builder.Services.AddScoped<IDownloadService, DeezerDownloadService>();
builder.Services.AddCors(options =>
{
options.AddDefaultPolicy(policy =>
{
policy.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
.WithExposedHeaders("X-Content-Duration", "X-Total-Count", "X-Nd-Authorization");
});
});
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.UseCors();
app.MapControllers();
app.Run();