feat(api): generate models for patched products, refunds, site configurations, payments, and user registration
- Added PatchedProduct, PatchedProductImage, PatchedRefund, and related models. - Introduced Payment, PaymentBody, PaymentCreate, and PaymentRead models. - Created enums for payment methods, reasons for refunds, roles, and shipping methods. - Implemented models for site configurations and their opening hours. - Added ZasilkovnaPacket and ZasilkovnaShipment models for handling shipping data. - Generated user registration model with validation rules. - Updated public API functions to support new models and queries.
This commit is contained in:
37
backend/thirdparty/downloader/views.py
vendored
37
backend/thirdparty/downloader/views.py
vendored
@@ -50,11 +50,28 @@ class Downloader(APIView):
|
||||
@extend_schema(
|
||||
tags=["downloader", "public"],
|
||||
summary="Get video info from URL",
|
||||
description="""
|
||||
Fetch detailed information about a video from supported platforms.
|
||||
|
||||
**Supported platforms:** YouTube, TikTok, Vimeo, Twitter, Instagram, Facebook, Reddit, and many more.
|
||||
|
||||
**Returns:**
|
||||
- Video title, duration, and thumbnail
|
||||
- Available video qualities/resolutions
|
||||
- Available audio formats
|
||||
|
||||
**Usage:**
|
||||
```
|
||||
GET /api/downloader/download/?url=https://youtube.com/watch?v=VIDEO_ID
|
||||
```
|
||||
""",
|
||||
parameters=[
|
||||
inline_serializer(
|
||||
name="VideoInfoParams",
|
||||
fields={
|
||||
"url": serializers.URLField(help_text="Video URL to analyze"),
|
||||
"url": serializers.URLField(
|
||||
help_text="Video URL from YouTube, TikTok, Vimeo, etc. Must be a valid URL from a supported platform."
|
||||
),
|
||||
},
|
||||
)
|
||||
],
|
||||
@@ -62,16 +79,22 @@ class Downloader(APIView):
|
||||
200: inline_serializer(
|
||||
name="VideoInfoResponse",
|
||||
fields={
|
||||
"title": serializers.CharField(),
|
||||
"duration": serializers.IntegerField(allow_null=True),
|
||||
"thumbnail": serializers.URLField(allow_null=True),
|
||||
"video_resolutions": serializers.ListField(child=serializers.CharField()),
|
||||
"audio_resolutions": serializers.ListField(child=serializers.CharField()),
|
||||
"title": serializers.CharField(help_text="Video title"),
|
||||
"duration": serializers.IntegerField(allow_null=True, help_text="Video duration in seconds (null if unavailable)"),
|
||||
"thumbnail": serializers.URLField(allow_null=True, help_text="URL to video thumbnail image"),
|
||||
"video_resolutions": serializers.ListField(
|
||||
child=serializers.CharField(),
|
||||
help_text="List of available video quality options (e.g., '1080p', '720p', '480p')"
|
||||
),
|
||||
"audio_resolutions": serializers.ListField(
|
||||
child=serializers.CharField(),
|
||||
help_text="List of available audio format options"
|
||||
),
|
||||
},
|
||||
),
|
||||
400: inline_serializer(
|
||||
name="ErrorResponse",
|
||||
fields={"error": serializers.CharField()},
|
||||
fields={"error": serializers.CharField(help_text="Error message describing what went wrong")},
|
||||
),
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user