This project aims to develop a YouTube API V3 client for C# applications, making it easier to interact with YouTube data. The official Google.Apis.YouTube.v3
library provides extensive features but is complex and not well-suited for Dependency Injection (DI). This project will implement the YouTube API using a DI-friendly approach to create a more flexible and testable structure.
- Implement YouTube API functionality based on the official YouTube API Reference to overcome the limitations of
Google.Apis.YouTube.v3
. - Utilize C# Dependency Injection to create a highly flexible and testable structure.
- Provide an extensible and maintainable API for developers to interact with YouTube data.
- Integrate Google login for account access using ASP.NET Core Google login functionality.
- Support API key access for simpler use cases.
- Implement all functionalities provided in the YouTube API V3 Reference:
- Video Search: Search for videos based on keywords.
- Channel Info: Retrieve basic information and statistics for a channel.
- Playlist Management: Create playlists, add videos, and remove videos.
- Video Upload & Management: Upload, edit, and delete videos.
- Comment Management: View, post, and delete comments on videos.
- Subscription Management: Subscribe to and unsubscribe from channels.
- Live Streaming Management: Set up, start, and end live streams.
- Separate service interfaces and implementations to facilitate DI container registration.
- Enable easy mocking for unit tests by supporting DI.
- API Client Layer: Handles HTTP communication for YouTube API requests.
- Business Logic Layer: Manages user requests and interacts with the client layer to fetch necessary data.
- Dependency Injection Configuration: Register
IYouTubeService
and its implementation inStartup.cs
for DI usage throughout the application.
- Language & Framework: C#, .NET Core 6.0+
- Dependency Injection: Built-in DI framework
- HTTP Communication:
HttpClient
This project will follow a Test-Driven Development (TDD) approach, developing each feature in the following order:
- Interface Design: Define service interfaces to establish clear contracts.
- Testing: Write unit tests for the interfaces using TDD principles.
- Implementation: Develop the classes that fulfill the interface requirements and ensure all tests pass.
-
Setup & Initial Structure Design
- Initialize the project and set up the directory structure.
- Design service interfaces that support DI.
-
Full YouTube API Implementation with TDD
- Implement video search, channel info, playlist management, video upload, comment management, subscription management, and live streaming features using TDD.
-
Testing & DI Integration
- Write unit tests using mocking.
- Verify DI integration and set up the test environment.
-
Final Review & Documentation
- Code review and refactoring.
- Write developer and user guide documentation.
- Overcome the limitations of the existing library and efficiently interact with YouTube data.
- Achieve a flexible and testable structure through DI, making future maintenance and development easier.
- Provide optimized YouTube integration tailored to project requirements.
- Ensure high code quality and reliability by using TDD throughout the development process.
Clone the repository and follow the setup guide in the documentation to integrate this YouTube API client into your C# project.
Feel free to contribute by submitting issues or pull requests to enhance this project further.
This project is licensed under the MIT License. See the LICENSE file for details.