dccon.NET 0.6.0

dotnet add package dccon.NET --version 0.6.0
                    
NuGet\Install-Package dccon.NET -Version 0.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="dccon.NET" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="dccon.NET" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="dccon.NET" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add dccon.NET --version 0.6.0
                    
#r "nuget: dccon.NET, 0.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package dccon.NET@0.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=dccon.NET&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=dccon.NET&version=0.6.0
                    
Install as a Cake Tool

dccon.NET

비공식 디시인사이드 디시콘(DCcon) .NET 라이브러리

NuGet .NET Standard 2.0

소개

dccon.NET은 디시인사이드의 디시콘(DCcon) 스티커를 프로그래밍적으로 검색, 조회, 다운로드할 수 있는 .NET 라이브러리입니다.

⚠️ 주의: 이 라이브러리는 비공식이며, 디시인사이드의 사이트 구조 변경 시 동작하지 않을 수 있습니다. 과도한 자동 요청은 IP 차단의 원인이 될 수 있으니 주의하세요.

기능

  • 🔍 디시콘 검색 — 디시콘명, 닉네임, 태그로 검색 (인기순/최신순 정렬)
  • 📋 목록 조회 — 최신 디시콘 목록
  • 🔥 인기 디시콘 — 일간/주간/월간 인기 디시콘 Top 100 조회
  • 📦 패키지 상세 — 패키지 정보, 스티커 목록, 태그 조회
  • ⬇️ 이미지 다운로드 — 개별 스티커 또는 패키지 전체 일괄 다운로드
  • 병렬 다운로드 — 패키지 전체 다운로드 시 병렬 처리 + 진행 상태 콜백
  • 🚀 NativeAOT 호환 — System.Text.Json 소스 제너레이션 기반, NativeAOT 배포 지원

설치

dotnet add package dccon.NET

또는 NuGet Package Manager에서 dccon.NET을 검색하세요.

사용법

기본 사용

using dccon.NET;
using dccon.NET.Models;

using var client = new DcconClient();

// 디시콘 검색
var result = await client.SearchAsync("페페");
foreach (var package in result.Packages)
    Console.WriteLine($"[{package.PackageIndex}] {package.Title} - {package.SellerName}");

최신 목록 조회

// 최신 디시콘
var newList = await client.GetNewListAsync(page: 1);

일간/주간/월간 인기 디시콘

// 일간 인기 디시콘 Top 100
var dailyPopular = await client.GetDailyPopularAsync();
foreach (var package in dailyPopular)
    Console.WriteLine($"[{package.PackageIndex}] {package.Title} - {package.SellerName}");

// 주간 인기 디시콘 Top 100
var weeklyPopular = await client.GetWeeklyPopularAsync();

// 월간 인기 디시콘 Top 100
var monthlyPopular = await client.GetMonthlyPopularAsync();

검색 옵션

// 태그로 검색, 최신순 정렬, 2페이지
var result = await client.SearchAsync(
    query: "고양이",
    searchType: DcconSearchType.Tags,
    sort: DcconSearchSort.New,
    page: 2);

패키지 상세 조회

var detail = await client.GetPackageDetailAsync(packageIndex: 42885);

Console.WriteLine($"제목: {detail.Title}");
Console.WriteLine($"제작자: {detail.SellerName}");
Console.WriteLine($"스티커 수: {detail.Stickers.Count}개");
Console.WriteLine($"태그: {string.Join(", ", detail.Tags)}");

스티커 다운로드

// 개별 스티커 다운로드 (byte[])
var sticker = detail.Stickers[0];
byte[] imageData = await client.DownloadStickerAsync(sticker);

// 스트림으로 다운로드
using var stream = await client.DownloadStickerStreamAsync(sticker);

패키지 전체 다운로드

var progress = new Progress<(int Completed, int Total)>(report =>
    Console.WriteLine($"다운로드 중... {report.Completed}/{report.Total}"));

await client.DownloadPackageAsync(
    packageIndex: 42885,
    outputDirectory: @"C:\Downloads",
    progress: progress);

다운로드 파일명 예측

DcconFileNameHelper를 사용하면 다운로드 시 사용되는 파일명을 사전에 알 수 있습니다:

var detail = await client.GetPackageDetailAsync(packageIndex: 42885);

foreach (var sticker in detail.Stickers)
{
    // DownloadPackageAsync에서 저장되는 파일명과 동일
    string fileName = DcconFileNameHelper.GetStickerFileName(sticker);
    Console.WriteLine(fileName); // 예: "페페웃음.png"
}

// 파일명 안전 변환만 필요한 경우
string safeName = DcconFileNameHelper.SanitizeFileName("잘못된/파일:명");

HttpClient 주입 (DI 패턴)

// IHttpClientFactory 패턴과 호환
var httpClient = httpClientFactory.CreateClient();
using var client = new DcconClient(httpClient);

CancellationToken 지원

모든 비동기 메서드에서 CancellationToken을 지원합니다:

using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));
var result = await client.SearchAsync("페페", cancellationToken: cancellationTokenSource.Token);

API 참조

IDcconClient 인터페이스

메서드 설명
SearchAsync 디시콘 검색 (디시콘명/닉네임/태그, 인기순/최신순)
GetNewListAsync 최신 디시콘 목록 조회
GetDailyPopularAsync 일간 인기 디시콘 Top 100 조회
GetWeeklyPopularAsync 주간 인기 디시콘 Top 100 조회
GetMonthlyPopularAsync 월간 인기 디시콘 Top 100 조회
GetPackageDetailAsync 패키지 상세 정보 조회
DownloadStickerAsync 스티커 이미지 byte[] 다운로드
DownloadStickerStreamAsync 스티커 이미지 Stream 다운로드
DownloadPackageAsync 패키지 전체 일괄 다운로드

유틸리티

클래스 메서드 설명
DcconFileNameHelper SanitizeFileName 파일명에 사용할 수 없는 문자를 제거
DcconFileNameHelper GetStickerFileName 스티커 다운로드 시 사용되는 파일명 반환

모델

클래스 설명
DcconSearchResult 검색 결과 (패키지 목록 + 페이지네이션)
DcconPackageSummary 패키지 요약 (검색 결과 항목)
DcconPackageDetail 패키지 상세 (스티커 목록 + 태그 포함)
DcconSticker 개별 스티커 정보
DcconSearchSort 정렬 방식 (Hot, New)
DcconSearchType 검색 유형 (Title, NickName, Tags)

요구 사항

  • .NET Standard 2.0 호환 런타임 (.NET Framework 4.6.1+, .NET Core 2.0+, .NET 5+)

의존성

라이선스

MIT License

작성자

이호원

감사의 말

이 프로젝트는 GitHub Copilot의 도움을 받아 작성되었습니다.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 94 5/7/2026
0.5.0 94 4/17/2026
0.4.2 101 4/14/2026
0.4.1 99 4/14/2026
0.4.0 101 4/13/2026
0.3.3 95 4/13/2026
0.3.2 101 4/11/2026
0.3.1 90 4/11/2026
0.3.0 90 4/11/2026
0.2.0 98 4/10/2026
0.1.1 99 4/10/2026
0.1.0 105 4/10/2026