MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / get_media

Method get_media

src/services/flow_client.py:1310–1339  ·  view source on GitHub ↗

获取媒体内容 (视频返回base64编码数据) Google 的 batchCheckAsyncVideoGenerationStatus 接口在视频生成成功后 不返回下载 URL。需要通过 GET /v1/media/{name} 获取视频内容。 Args: at: Access Token media_name: 媒体名称 (UUID格式) Returns: { "name": "uuid",

(self, at: str, media_name: str)

Source from the content-addressed store, hash-verified

1308 # ========== 媒体获取 (使用AT) ==========
1309
1310 async def get_media(self, at: str, media_name: str) -> dict:
1311 """获取媒体内容 (视频返回base64编码数据)
1312
1313 Google 的 batchCheckAsyncVideoGenerationStatus 接口在视频生成成功后
1314 不返回下载 URL。需要通过 GET /v1/media/{name} 获取视频内容。
1315
1316 Args:
1317 at: Access Token
1318 media_name: 媒体名称 (UUID格式)
1319
1320 Returns:
1321 {
1322 "name": "uuid",
1323 "video": {
1324 "encodedVideo": "base64...",
1325 "seed": 74602,
1326 "prompt": "...",
1327 "model": "veo_3_1_t2v_fast",
1328 "aspectRatio": "VIDEO_ASPECT_RATIO_LANDSCAPE"
1329 }
1330 }
1331 """
1332 url = f"{self.api_base_url}/media/{media_name}"
1333 return await self._make_request(
1334 method="GET",
1335 url=url,
1336 use_at=True,
1337 at_token=at,
1338 timeout=max(60, int(self.timeout or 120)),
1339 )
1340
1341 # ========== 余额查询 (使用AT) ==========
1342

Callers 1

_poll_video_resultMethod · 0.80

Calls 1

_make_requestMethod · 0.95

Tested by

no test coverage detected