File size: 5,992 Bytes
9d312e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
  "openapi": "3.1.0",
  "info": {
    "title": "ReClip Hosted API",
    "version": "0.1.0",
    "description": "A resource-limited API for ReClip's interactive public website. YouTube is unavailable from the current Hugging Face datacenter. Prefer the local ReClip CLI or MCP server for agent workflows. Users are responsible for authorization and source-platform terms.",
    "license": {"name": "MIT", "identifier": "MIT"}
  },
  "servers": [{"url": "https://daddy23-reclip.hf.space"}],
  "paths": {
    "/api/info": {
      "post": {
        "operationId": "inspectHostedMedia",
        "summary": "Inspect a public media URL",
        "description": "Returns normalized metadata and available formats. Limited to 20 requests per five minutes per client.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["url"],
                "properties": {"url": {"type": "string", "format": "uri", "pattern": "^https?://"}}
              }
            }
          }
        },
        "responses": {
          "200": {"description": "Media metadata", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MediaInfo"}}}},
          "400": {"$ref": "#/components/responses/BadRequest"},
          "429": {"$ref": "#/components/responses/RateLimited"}
        }
      }
    },
    "/api/download": {
      "post": {
        "operationId": "startHostedDownload",
        "summary": "Start an interactive download job",
        "description": "Starts a temporary download. Limited to six starts per hour, two active jobs per client, four active jobs globally, and the configured maximum file size. Do not use this endpoint for unattended bulk automation.",
        "requestBody": {
          "required": true,
          "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DownloadRequest"}}}
        },
        "responses": {
          "200": {"description": "Job accepted", "content": {"application/json": {"schema": {"type": "object", "required": ["job_id"], "properties": {"job_id": {"type": "string"}}}}}},
          "400": {"$ref": "#/components/responses/BadRequest"},
          "429": {"$ref": "#/components/responses/RateLimited"},
          "503": {"description": "Public service is at its concurrency limit"}
        }
      }
    },
    "/api/status/{job_id}": {
      "get": {
        "operationId": "getHostedDownloadStatus",
        "summary": "Check an owned temporary job",
        "parameters": [{"name": "job_id", "in": "path", "required": true, "schema": {"type": "string"}}],
        "responses": {
          "200": {"description": "Current job state", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JobStatus"}}}},
          "404": {"description": "Job not found, expired, or owned by another client"},
          "429": {"$ref": "#/components/responses/RateLimited"}
        }
      }
    },
    "/api/file/{job_id}": {
      "get": {
        "operationId": "getHostedDownloadFile",
        "summary": "Retrieve a completed owned job file",
        "parameters": [{"name": "job_id", "in": "path", "required": true, "schema": {"type": "string"}}],
        "responses": {
          "200": {"description": "Downloaded media file", "content": {"application/octet-stream": {"schema": {"type": "string", "contentEncoding": "binary"}}}},
          "404": {"description": "File is unavailable, expired, or owned by another client"}
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MediaInfo": {
        "type": "object",
        "properties": {
          "title": {"type": "string"},
          "thumbnail": {"type": "string"},
          "duration": {"type": ["number", "null"]},
          "uploader": {"type": "string"},
          "artist": {"type": "string"},
          "track": {"type": "string"},
          "formats": {"type": "array", "items": {"$ref": "#/components/schemas/Format"}},
          "audioFormats": {"type": "array", "items": {"$ref": "#/components/schemas/Format"}}
        }
      },
      "Format": {
        "type": "object",
        "required": ["id", "label"],
        "properties": {"id": {"type": "string"}, "label": {"type": "string"}}
      },
      "DownloadRequest": {
        "type": "object",
        "required": ["url"],
        "properties": {
          "url": {"type": "string", "format": "uri", "pattern": "^https?://"},
          "format": {"type": "string", "enum": ["video", "audio"], "default": "video"},
          "format_id": {"type": ["string", "null"]},
          "video_codec": {"type": "string", "enum": ["mp4", "mkv", "webm"], "default": "mp4"},
          "audio_codec": {"type": "string", "enum": ["mp3", "m4a", "flac", "wav", "best"], "default": "mp3"},
          "clip_start": {"type": ["string", "null"], "description": "SS, MM:SS, or HH:MM:SS.000"},
          "clip_end": {"type": ["string", "null"], "description": "SS, MM:SS, or HH:MM:SS.000"},
          "duration": {"type": ["number", "null"]}
        }
      },
      "JobStatus": {
        "type": "object",
        "required": ["status"],
        "properties": {
          "status": {"type": "string", "enum": ["downloading", "done", "error"]},
          "error": {"type": ["string", "null"]},
          "filename": {"type": ["string", "null"]}
        }
      },
      "Error": {
        "type": "object",
        "required": ["error"],
        "properties": {"error": {"type": "string"}, "retry_after": {"type": "integer"}}
      }
    },
    "responses": {
      "BadRequest": {"description": "Invalid request or extractor error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}},
      "RateLimited": {"description": "Request rate exceeded", "headers": {"Retry-After": {"schema": {"type": "integer"}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}
    }
  }
}