Skip to content
dreamina-query-result logo

结果查询工具

dreamina-query-result

查询 Dreamina 生成任务结果,获取图片/视频下载链接

NeverSight/skills_feed0installs215starsOther

SKILL.md

Full skill instructions

结果查询工具

API 端点

POST https://jimeng.jianying.com/​mweb/​v1/​get_history_by_ids

Python 示例

import requests
import hashlib
import time

def generate_sign(uri_path):
    device_time = int(time.time())
    sign_str = f"9e2c|{uri_path[-7:]}|7|5.8.0|{device_time}||11ac"
    sign = hashlib.md5(sign_str.encode()).hexdigest()
    return sign, device_time

def query_result(sessionid, history_ids):
    uri = "/​mweb/​v1/​get_history_by_ids"
    sign, device_time = generate_sign(uri)
    
    headers = {
        "Content-Type": "application/​json",
        "Appid": "513695",
        "Appvr": "5.8.0",
        "Pf": "7",
        "Origin": "https://jimeng.jianying.com",
        "Referer": "https://jimeng.jianying.com",
        "Cookie": f"sessionid={sessionid}",
        "Device-Time": str(device_time),
        "Sign": sign,
        "Sign-Ver": "1"
    }
    
    resp = requests.post(
        f"https://jimeng.jianying.com{uri}",
        params={"aid": 513695, "device_platform": "web", "region": "CN"},
        headers=headers,
        json={"history_ids": history_ids, "http_common_info": {"aid": 513695}}
    )
    return resp.json()

响应结构 - 图片

{
  "ret": "0",
  "data": {
    "<history_id>": {
      "status": 50,
      "item_list": [{
        "image": {
          "large_images": [{
            "image_uri": "tos-cn-i-tb4s082cfz/<hash>",
            "image_url": "https://p26-dreamina-sign.byteimg.com/​...",
            "width": 2048,
            "height": 2048,
            "format": "png"
          }]
        }
      }]
    }
  }
}

响应结构 - 视频

{
  "ret": "0",
  "data": {
    "<history_id>": {
      "status": 50,
      "item_list": [{
        "video": {
          "video_resource": {
            "video_url": "https://...",
            "video_uri": "tos-cn-v-xxx/​...",
            "duration": 5000,
            "width": 1280,
            "height": 720
          }
        }
      }]
    }
  }
}

任务状态

status说明
20队列中
42处理中
45处理中(中间状态)
50已完成
30失败

轮询示例

import time

def wait_for_result(sessionid, history_id, max_attempts=30, interval=3):
    for i in range(max_attempts):
        result = query_result(sessionid, [history_id])
        data = result.get('data', {}).get(history_id, {})
        status = data.get('status')
        
        if status == 50:
            item = data['item_list'][0]
            if 'image' in item:
                return item['image']['large_images'][0]['image_url']
            elif 'video' in item:
                return item['video']['video_resource']['video_url']
        elif status == 30:
            raise Exception(f"Generation failed: {data.get('fail_msg')}")
        
        time.sleep(interval)
    
    raise Exception("Timeout waiting for result")

下载资源

def download_file(url, output_path):
    resp = requests.get(url, timeout=60)
    with open(output_path, 'wb') as f:
        f.write(resp.content)
    return len(resp.content)

注意事项

  • 图片/视频 URL 带签名,约 1-2 小时过期
  • 建议生成后立即下载
  • 支持批量查询多个 history_id
  • 图片轮询间隔 3 秒,视频 5-10 秒

More Other skills

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

179.7K 76.1K
View

Fundamental design principles for writing maintainable, testable Python code.

40.2K 21.9K
View

Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.

40.2K 20K
View

Generate Playwright tests from scenarios using interactive browser exploration and validation.

39.7K 18.2K
View

Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.

40.2K 14.7K
View

GDPR-compliant data handling with consent management, data subject rights, and privacy controls.

40.2K 14.3K
View

Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.

40.2K 13.5K
View

Detailed multi-file refactor planning with safety checks and rollback guidance.

39.7K 13K
View