सीधे सामग्री पर जाएँ
HI
API कुंजी प्राप्त करें
दस्तावेज़ देखें

गाइड

मीडिया वितरण पाइपलाइन का निर्माण

निजी S3 संग्रहण के लिए एक MP4 डाउनलोड करें, एक पुनरारंभ के बाद फिर से शुरू करें और सत्यापित फ़ाइल पर अपना आवेदन एक्सेस दें।

इस पेज पर

क्या आप निर्माण करेंगे?

एक टिकाऊ आइटम एक वीडियो ID से एक आवेदन तैयार फ़ाइल में चला जाता है। प्रत्येक चरण को डिस्क पर रखें ताकि एक नई प्रक्रिया अंतिम पुष्टि परिणाम से जारी रह सके।

पाइपलाइन और बचाया रिकॉर्ड
item.json
  → एक बार सबमिट करें → सेव्ड रन + जॉब ID
  → नौकरी ठीक हो जाओ → delivery.json
  → सत्यापित करें S3 bytes → media.mp4 + ready.json
  → अनुप्रयोग उपयोगकर्ता को अधिकृत करें → शॉर्ट-लाइव्ड डाउनलोड URL

शुरू करने से पहले

सभी छह चरणों के लिए एक उदाहरण पथ चुनें। दोनों एक स्थापित FlashData CLI का उपयोग एक बचाया मालिक प्रोफ़ाइल और youtube_download अनुमति, निजी S3 storage.json अपलोड के लिए, और एक AWS पहचान जो वितरित वस्तु को पढ़ सकती है।

अपने Python वातावरण में Python 3.10+ का प्रयोग करें। स्क्रिप्ट अपने रन जर्नल को संरक्षित करने के लिए CLI को कॉल करते हैं, और Boto3 को S3 और साइन लिंक पढ़ने के लिए कहते हैं। Bash, jq, Node.js और AWS CLI की आवश्यकता नहीं है। python, या python3 के साथ नीचे दिए गए आदेशों को चलाएं यदि यह आपका अनुवादक नाम है।

Python निर्भरता स्थापित करें
python --version
flashdata --version
python -m pip install boto3

रनटाइम सेटिंग सहेजें

स्रोत नियंत्रण के बाहर एक निजी आइटम फ़ोल्डर बनाएं। अपने चुने हुए पथ के लिए सेटिंग्स को सहेजें और पूर्ण पथ और प्रोफ़ाइल नाम संपादित करें। प्रत्येक प्रक्रिया उस सहेजे गए खाते का उपयोग करती है और जर्नल चलाती है। भंडारण क्रेडेंशियल निजी storage.json में रहते हैं। एक समय में प्रति आइटम एक प्रक्रिया चलाएं।

बचाओ pipeline.json. Windows पर, आगे-स्लैश पथ जैसे कि C:/private/flashdata-state JSON में काम करते हैं।

pipeline.json
{
  "stateDir": "/absolute/path/to/flashdata-state",
  "storageConfig": "/absolute/path/to/private/storage.json",
  "profile": "default"
}

1. एक टिकाऊ आइटम सहेजें

उस फ़ोल्डर में item.json सेव करें। वीडियो और S3 गंतव्य को बदलें; यह उदाहरण एक MP4 को 720p तक अनुरोध करता है। अपने runId को रिट्री के लिए रखें। एक अलग योजनाबद्ध आउटपुट को एक नया runId और ऑब्जेक्ट प्रिफिक्स की आवश्यकता होती है।

item.json
{
  "runId": "media:clip-001:720p:v1",
  "request": {
    "source": "youtube_download",
    "video_id": "jNQXAC9IVRw",
    "params": {
      "download_type": "audio_video",
      "video_quality": "<=720",
      "output_format": "mp4"
    }
  },
  "destination": {
    "bucket": "your-media-bucket",
    "region": "us-east-1",
    "prefix": "media/clip-001-v1"
  }
}

2. स्क्रिप्ट को सेव करें और एक्सेस की जांच करें

चेक चलाने से पहले नीचे की फ़ाइल बनाएं। यह S3 गंतव्य को मान्य करता है और प्रत्येक जमा करने के प्रयास के लिए एक रसीद रखता है।

पाइप लाइन स्क्रिप्ट बनाएँ

pipeline.py को उसी फ़ोल्डर में pipeline.json और item.json के रूप में बनाया गया है। उस फ़ाइल में नीचे दिए गए पूर्ण कोड को कॉपी करें और इसे बचायें। आप इसे चरणों में चेक, सबमिशन और रिकवरी के लिए फिर से उपयोग करेंगे 2–4.

pipeline.py
# pipeline.py — Python 3.10+ and the FlashData CLI on PATH.
import argparse
import json
import os
import subprocess
import sys
import tempfile
from pathlib import Path

ROOT = Path(__file__).resolve().parent


def read_json(path):
    return json.loads(Path(path).read_text(encoding='utf-8-sig'))


def delivery_directory():
    # Recovery updates this pointer only after the delivery is saved successfully.
    return ROOT / (ROOT / 'delivery-dir.txt').read_text(encoding='utf-8').strip()


def main(action):
    os.umask(0o077)
    settings = read_json(ROOT / 'pipeline.json')
    for name in ['stateDir', 'storageConfig']:
        if not Path(settings[name]).is_absolute():
            raise ValueError('Set an absolute path for ' + name)
    item = read_json(ROOT / 'item.json')
    run_id = item['runId']
    env = dict(os.environ)
    env.pop('FLASHDATA_API_KEY', None)  # Reuse the saved owner profile.
    flags = ['--profile', settings['profile'], '--state-dir', settings['stateDir'],
             '--json', '--non-interactive']

    def cli(*args, payload=None, attempt=None):
        result = subprocess.run(['flashdata', *args, *flags], cwd=ROOT, env=env,
                                input=json.dumps(payload) if payload is not None else None,
                                capture_output=True, text=True, encoding='utf-8')
        if attempt:
            (attempt / 'receipt.json').write_text(result.stdout, encoding='utf-8')
            (attempt / 'error.json').write_text(result.stderr, encoding='utf-8')
        if result.returncode:
            if attempt:
                raise RuntimeError('Keep ' + str(attempt) + '; inspect its error and saved run.')
            raise RuntimeError(result.stderr.strip() or 'FlashData command failed.')
        response = json.loads(result.stdout)
        if not response.get('ok'):
            raise RuntimeError('Inspect the CLI response before continuing.')
        return response

    def new_attempt(stage):
        attempts = ROOT / 'attempts'
        attempts.mkdir(exist_ok=True)
        return Path(tempfile.mkdtemp(prefix=stage + '.', dir=attempts))

    if action == 'check':
        access = cli('auth', 'status')['data']
        identity = access['identity']
        if (not access.get('accessVerified')
                or identity['identity'].get('recurringAllowed') is not True
                or 'youtube_download' not in identity.get('permittedSources', [])):
            raise ValueError('Owner access with youtube_download is required.')
        print(json.dumps({'accountId': identity['identity']['accountId'],
                          'permittedSources': identity['permittedSources']}, indent=2))
        for args in [('account', 'balance'),
                     ('account', 'pricing', '--source', 'youtube_download', '--request-count', '1'),
                     ('account', 'limits')]:
            print(json.dumps(cli(*args)['data'], indent=2))
    elif action in ['dry-run', 'submit']:
        storage = read_json(settings['storageConfig'])
        destination = item['destination']
        if (item['request']['source'] != 'youtube_download'
                or storage.get('storage_type') != 's3'
                or storage.get('storage_url') != destination['bucket']
                or storage.get('region') != destination['region']):
            raise ValueError('Check item.json and the S3 destination in storage.json.')
        request = item['request']
        request['params']['storage'] = {**storage, 'object_prefix': destination['prefix']}
        args = ['query', '--input', '-', '--mode', 'async', '--run-id', run_id]
        if action == 'dry-run':
            response = cli(*args, '--dry-run', payload=request)
            if response['data'].get('dryRun') is not True:
                raise ValueError('Expected a dry-run result.')
            print(json.dumps({'ok': True, 'dryRun': True}))
        else:
            attempt = new_attempt('submit')
            response = cli(*args, '--output', str(attempt / 'submission.json'),
                           payload=request, attempt=attempt)
            print(json.dumps({'runId': run_id, 'cached': response.get('cached'),
                              'receipt': str(attempt / 'submission.json')}, indent=2))
    elif action == 'inspect':
        run = cli('runs', 'show', run_id)['data']
        print(json.dumps({'runId': run_id, 'status': run['status'], 'jobId': run.get('remoteId'),
                          'errorCode': run.get('errorCode'),
                          'candidateJobIds': run.get('candidateRemoteIds')}, indent=2))
    elif action == 'recover':
        attempt = new_attempt('recover')
        cli('runs', 'recover', run_id, '--timeout', '10m',
            '--output', str(attempt / 'delivery.json'), attempt=attempt)
        run = cli('runs', 'show', run_id)
        (attempt / 'run.json').write_text(json.dumps(run, indent=2), encoding='utf-8')
        delivery = read_json(attempt / 'delivery.json')
        if delivery.get('source') != 'youtube_download' or delivery.get('status') != 'done':
            raise ValueError('Inspect the saved delivery before verifying.')
        pointer = ROOT / 'delivery-dir.next'
        pointer.write_text(attempt.relative_to(ROOT).as_posix(), encoding='utf-8')
        pointer.replace(ROOT / 'delivery-dir.txt')
        print('Delivery files:', attempt)
    elif action == 'delivery':
        delivery = read_json(delivery_directory() / 'delivery.json')
        print(json.dumps({'status': delivery['status'], 'file': delivery['results'][0],
                          'usage': delivery.get('usage')}, indent=2))


if __name__ == '__main__':
    sys.stdout.reconfigure(encoding='utf-8')
    sys.stderr.reconfigure(encoding='utf-8')
    parser = argparse.ArgumentParser()
    parser.add_argument('action', choices=['check', 'dry-run', 'submit', 'inspect', 'recover', 'delivery'])
    try:
        main(parser.parse_args().action)
    except (OSError, ValueError, KeyError, RuntimeError) as error:
        print(str(error), file=sys.stderr)
        sys.exit(1)

अपने सहेजे गए खाते की जाँच करें

स्क्रिप्ट को सहेजने के बाद इस फ्री चेक को आइटम फ़ोल्डर से चलाएं। मिसिंग मालिक एक्सेस या youtube_download अनुमति चेक बंद हो जाती है। खाते की पुष्टि करें ID, शेष, प्रति-टीबी दर और सीमा। अंतिम शुल्क अपलोड बाइट्स पर निर्भर करता है।

पर्यावरण और लेखा की जाँच करें
python pipeline.py check

डाउनलोड के बिना मान्य

सहायक को बचाने के बाद, अपने सूखे रन को चलाएं। Python प्रिंट ok: true और dryRun: true; Bash प्रिंट true. यह मीडिया कार्य या क्रेडिट को आरक्षित किए बिना इनपुट और एक्सेस को मान्य करता है।

फ्री ड्राई रन
python pipeline.py dry-run

3. नौकरी जमा करें और बनाए रखें ID

यह एक भुगतान पृष्ठभूमि डाउनलोड जमा करता है। स्थानीय रन में status: accepted और एक jobId का अन्वेषण करें। वसूली के लिए प्रोफ़ाइल, राज्य निर्देशिका और item.json रखें। मीडिया केवल चरण 5 के बाद तैयार है।

एक बार जमा करें
python pipeline.py submit
स्थानीय स्थिति का निरीक्षण · कोई नया क्वेरी नहीं
python pipeline.py inspect

अगर यह रन पहले से ही बचा है या अनिश्चित है

CLI राज्यकार्रवाई
accepted + jobIdइस रन को चरण 4 में पुनर्प्राप्त करें। यदि प्रक्रिया बंद हो जाती है तो नौकरी ID रखें।
succeededRecover/export इसकी सहेजी गई प्रतिक्रिया, फिर भंडारण की पुष्टि करें। एक नया आइटम प्रस्तुत न करें।
अज्ञात परिणाम / कोई पुष्टि की नौकरी IDरन, रसीद और त्रुटि रखें। किसी अन्य जमा करने की निर्णय लेने से पहले History या उम्मीदवार IDs का निरीक्षण करें।

4. डिलीवरी रिकॉर्ड को पुनर्प्राप्त करें

किसी भी नए टर्मिनल में आइटम फ़ोल्डर से भागो। रिकवरी मूल नौकरी के लिए इंतजार करती है और एक डायरेक्टरी को प्रिंट करती है जिसमें delivery.json, run.json और रसीदें शामिल हैं। एक 10-मिनट टाइमआउट स्थानीय प्रतीक्षा बंद हो जाता है; उसी काम को फिर से शुरू करने के लिए रिकवरी दोहराएं।

बचाया नौकरी फिर से शुरू करें

Reuse pipeline.py कदम 2 में बचाया। कोई अतिरिक्त स्क्रिप्ट की आवश्यकता नहीं है।

मौजूदा नौकरी को पुनर्प्राप्त करें · कोई नया जमा
python pipeline.py recover

वितरित वस्तु का निरीक्षण करना

एक S3 ऑब्जेक्ट URL, एक सकारात्मक फ़ाइल आकार और एक MD5 का Expect करें। निजी वस्तुओं को आपकी एडब्ल्यूएस की पहचान पढ़ने की आवश्यकता होती है। Python ने बाद में स्क्रिप्ट के लिए delivery-dir.txt में सफल निर्देशिका को बचा लिया। Bash DELIVERY_DIR रखता है; एक नए टर्मिनल में इसे मुद्रित निर्देशिका में सेट किया गया।

डिलिवरी रिकॉर्ड
python pipeline.py delivery

5. तैयार करने से पहले बाइट्स को सत्यापित करें

सत्यापनकर्ता मूल इनपुट की जाँच करता है, S3 बाल्टी और उपसर्ग करता है, निजी ऑब्जेक्ट को डिस्क में स्ट्रीम करता है, और इसकी बाइट गिनती और MD5 की तुलना करता है। केवल मेलिंग फाइलें verified/ready.json का उत्पादन करती हैं। Python ने delivery-dir.txt को पढ़ा; नोड DELIVERY_DIR का उपयोग करता है। न तो एक FlashData क्वेरी प्रस्तुत करता है।

सत्यापन स्क्रिप्ट सहेजें

यह सत्यापन मानक Amazon S3 ऑब्जेक्ट URLs को संभालता है। कस्टम समापन बिंदुओं या किसी अन्य प्रदाता के लिए, अपनी प्रामाणिक वस्तु का उपयोग उसी गंतव्य, बाइट-काउंट और चेकसूम चेक को पढ़ने और बनाए रखने के लिए किया जाता है।

verify-media.py को pipeline.py के बगल में बनाया गया है और इसके नीचे पूरा कोड कॉपी किया गया है। दोनों फ़ाइलों को आइटम फ़ोल्डर में सहेजें।

verify-media.py
# verify-media.py — uses Boto3's configured AWS read identity.
import hashlib
import json
import os
import re
import sys
from contextlib import closing
from datetime import datetime, timezone
from urllib.parse import unquote, urlsplit

import boto3
from pipeline import ROOT, delivery_directory, read_json


def main():
    os.umask(0o077)
    directory = delivery_directory()
    item = read_json(ROOT / 'item.json')
    saved = read_json(directory / 'run.json')
    raw = (directory / 'delivery.json').read_bytes()
    delivery = json.loads(raw)
    run = saved.get('data', {})
    if (not saved.get('ok') or run.get('id') != item['runId']
            or run.get('status') != 'succeeded' or not run.get('remoteId')
            or delivery.get('source') != 'youtube_download' or delivery.get('status') != 'done'
            or not isinstance(delivery.get('results'), list) or len(delivery['results']) != 1):
        raise ValueError('Inspect the saved run and completed delivery before verifying.')
    file = delivery['results'][0]
    bucket, region, prefix = (item['destination'][key] for key in ['bucket', 'region', 'prefix'])
    original = run.get('input', {})
    storage = original.get('params', {}).get('storage', {})
    if (original.get('source') != 'youtube_download' or original.get('video_id') != item['request']['video_id']
            or any(original.get('params', {}).get(key) != item['request']['params'][key]
                   for key in ['download_type', 'video_quality', 'output_format'])
            or storage.get('storage_url') != bucket or storage.get('region') != region
            or storage.get('object_prefix') != prefix):
        raise ValueError('item.json changed after submission. Inspect the original run.')
    url = urlsplit(file['file_url'])
    hosts = [bucket + '.s3.' + region + '.amazonaws.com', bucket + '.s3.amazonaws.com']
    key = unquote(url.path[1:], errors='strict')
    if (url.scheme != 'https' or url.netloc not in hosts or url.query or url.fragment
            or not prefix or not key.startswith(prefix + '/')):
        raise ValueError('The delivery does not match the planned Amazon S3 destination.')
    if (type(file.get('file_size')) is not int or file['file_size'] <= 0
            or not re.fullmatch(r'[a-fA-F0-9]{32}', file.get('md5', ''))):
        raise ValueError('A positive file_size and MD5 are required. Keep the manifest.')
    verification = directory / 'verified'
    verification.mkdir(mode=0o700)  # Stop if an earlier verification already exists.
    local_file = verification / 'media.mp4'
    s3 = boto3.client('s3', region_name=region)
    response = s3.get_object(Bucket=bucket, Key=key)
    size, digest = 0, hashlib.md5(usedforsecurity=False)
    with closing(response['Body']) as stream, local_file.open('xb') as output:
        while chunk := stream.read(1024 * 1024):
            output.write(chunk)
            size += len(chunk)
            digest.update(chunk)
    md5 = digest.hexdigest()
    if size != file['file_size'] or md5 != file['md5'].lower():
        raise ValueError('Byte count or MD5 mismatch. Keep the file; do not mark it ready.')
    ready = {'runId': item['runId'], 'jobId': run['remoteId'], 'videoId': item['request']['video_id'],
             'bucket': bucket, 'region': region, 'objectKey': key,
             'storageVersionId': response.get('VersionId'), 'bytes': size, 'md5': md5,
             'verifiedAt': datetime.now(timezone.utc).isoformat(), 'localFile': str(local_file.resolve()),
             'deliverySha256': hashlib.sha256(raw).hexdigest(), 'usage': delivery.get('usage')}
    with (verification / 'ready.json').open('x', encoding='utf-8') as output:
        json.dump(ready, output, indent=2)
    print('Delivery verified:', verification / 'ready.json')
    print(json.dumps(ready, indent=2))


if __name__ == '__main__':
    sys.stdout.reconfigure(encoding='utf-8')
    sys.stderr.reconfigure(encoding='utf-8')
    try:
        main()
    except Exception as error:
        print(str(error), file=sys.stderr)
        sys.exit(1)

सत्यापन चलायें

स्क्रिप्ट को सहेजने के बाद, इसे आइटम फ़ोल्डर से चलाएं।

सत्यापित करें और हैंडऑफ़ रिकॉर्ड पढ़ा
python verify-media.py

अपने आवेदन के लिए ready.json को बंद करें

Expect डिलिवरी सत्यापित और एक रिकॉर्ड जिसमें run/job IDs, बाल्टी, क्षेत्र, ऑब्जेक्ट कुंजी, सत्यापित आकार और MD5 शामिल हैं। यह आपके अनुप्रयोग का रिकॉर्ड है, जिसे स्क्रिप्ट द्वारा बनाया गया है। इसे delivery.json और मूल आइटम के साथ संग्रहीत करें; यह API परिणाम की अवधारण खिड़की से बच जाता है।

ट्रांसक्रिप्शन, अनुक्रमण या अन्य प्रसंस्करण के लिए, अपने कार्यकर्ता को सत्यापित localFile पास करें। एक उपयोगकर्ता-facing डाउनलोड के लिए कदम 6 के साथ जारी है।

6. अपने एप्लिकेशन को नियंत्रित एक्सेस दें

अपने बैकएंड में, उपयोगकर्ता को अधिकृत करें और अपने स्टोर में उस उपयोगकर्ता के तैयार रिकॉर्ड को देखें। फिर एक अल्पकालिक S3 डाउनलोड URL का निर्माण करें। बचाया गंतव्य का उपयोग करें; ब्राउज़र द्वारा आपूर्ति की गई बाल्टी या ऑब्जेक्ट कुंजी को स्वीकार न करें।

SDK बैकएंड की AWS पढ़ने की पहचान का उपयोग करता है। No FlashData क्वेरी भेजा जाता है।

URL ने सत्यापित ऑब्जेक्ट संस्करण का नाम दिया जब S3 संस्करण एक प्रदान करता है। एक संस्करण के बिना ID, सत्यापन के बाद प्रत्येक आउटपुट कुंजी को अपरिवर्तनीय रखें। एक विशिष्ट संस्करण पढ़ने वाली पहचान को s3:GetObjectVersion की आवश्यकता होती है; एक उलटा पढ़ने की जरूरत s3:GetObject.

create-download-link.py को pipeline.py के बगल में बनाया गया है और इसके नीचे पूरा कोड कॉपी किया गया है। यह शुरू में स्थापित बोटो3 पैकेज का उपयोग करता है।

create-download-link.py
# create-download-link.py — run in your backend after authorizing the user.
import json
import os
import sys

import boto3
from botocore.config import Config
from pipeline import delivery_directory, read_json


def main():
    os.umask(0o077)
    # In an app, load this user's verified ready record from your own store.
    directory = delivery_directory() / 'verified'
    ready = read_json(directory / 'ready.json')
    if any(not isinstance(ready.get(key), str) or not ready[key]
           for key in ['bucket', 'region', 'objectKey', 'verifiedAt']):
        raise ValueError('Use the ready.json produced by the verification step.')
    destination = directory / 'access.json'
    if destination.exists():
        raise FileExistsError('Keep the existing access.json or choose a new output filename.')
    params = {'Bucket': ready['bucket'], 'Key': ready['objectKey']}
    version = ready.get('storageVersionId')
    if version and version != 'null':
        params['VersionId'] = version
    s3 = boto3.client('s3', region_name=ready['region'], config=Config(signature_version='s3v4'))
    url = s3.generate_presigned_url('get_object', Params=params, ExpiresIn=300, HttpMethod='GET')
    with destination.open('x', encoding='utf-8') as output:
        json.dump({'url': url, 'expiresInSeconds': 300}, output, indent=2)
    # Do not log the signed URL; return it only to the authorized user.
    print('Access record saved:', destination)


if __name__ == '__main__':
    sys.stdout.reconfigure(encoding='utf-8')
    sys.stderr.reconfigure(encoding='utf-8')
    try:
        main()
    except Exception as error:
        print(str(error), file=sys.stderr)
        sys.exit(1)

एक निजी access.json को url और expiresInSeconds: 300 युक्त एक्सपेक्ट करें। आपका बैकएंड केवल अधिकृत उपयोगकर्ता को URL लौटाता है। किसी भी व्यक्ति को यह पकड़े गए हैं कि यह पांच मिनट तक फाइल डाउनलोड कर सकता है; यह साइनिंग क्रेडेंशियल्स के साथ पहले समाप्त हो सकता है।

जब उपयोगकर्ता अगले अनुरोधों तक पहुंच जाता है तो सहेजे गए तैयार रिकॉर्ड से एक नया लिंक बनाएं। अपने डेटाबेस में ऑब्जेक्ट कुंजी और संस्करण को रखें, बल्कि एक्सपायरिंग URL को परिसंपत्ति पते के रूप में संग्रहीत करने के बजाय। यह स्थानीय उदाहरण बंद हो जाता है अगर access.json पहले से मौजूद है।

पांच मिनट का लिंक बनाएं
python create-download-link.py

पिछले पुष्टि चरण से शुरू

स्थितिअगली कार्रवाई
स्वीकृत नौकरी / स्थानीय प्रतीक्षा समय बाहरएक ही runId के साथ एक नया प्रयास निर्देशिका में runs recover दोहराएं।
S3 पहुँच इनकार या बाधित पढ़ाAWS ने पहचान या कनेक्शन को पढ़ा। एक नई निर्देशिका को पुनर्प्राप्त करें और फिर से सत्यापित करें; पिछले आंशिक फ़ाइल को बनाए रखें।
Byte count / MD5 / गंतव्य mismatchबंद करो। मीडिया का उपयोग करने से पहले प्रकटन, ऑब्जेक्ट संस्करण और योजनाबद्ध गंतव्य की तुलना करें।
पहले से ही सत्यापित / मौजूदअपने ready.json को पढ़ें, या इसके अधूरे सत्यापन का निरीक्षण करें। स्क्रिप्ट इसे ओवरराइट नहीं करेगा।
अनुप्रयोग डाउनलोड URL समाप्त हो गयाफिर से पहुंच को अधिकृत करें और बचाया object/version. पर हस्ताक्षर करें किसी अन्य FlashData डाउनलोड को प्रस्तुत न करें।
run_id_input_conflictअनुरोध बदल गया। मूल रन को पुनर्प्राप्त करें; केवल एक जानबूझकर नए आउटपुट के लिए एक नया runId का उपयोग करें।
401 / 403 / 402 / 429पहुँच, अनुमतियां या संतुलन को ठीक करें; Retry-After का पालन करें। प्रस्तुत करने से पहले काम को बचाने का निरीक्षण करें।

उसी चरण को एक कतार में लागू करें

  1. एक इन-फ्लाइट आइटम के साथ शुरू करें। आवेदन की सहमति बढ़ाने से पहले वर्तमान सीमा को पढ़ें।
  2. प्रत्येक video/output संस्करण के लिए एक टिकाऊ runId रखें, जिसमें एक विशिष्ट गंतव्य उपसर्ग है। अपने आवेदन डेटाबेस में खाता, नौकरी ID और अंतिम परिणाम स्टोर करें।
  3. प्रक्रिया पुनरारंभ में CLI राज्य निर्देशिका पर्सिस्ट करें। अलग-अलग मशीनों को साझा अनुप्रयोग समन्वय की आवश्यकता होती है; एक स्थानीय रन जर्नल स्वतंत्र राज्य निर्देशिकाओं को डुप्लिकेट नहीं करता है।
  4. ready.json का उपयोग हाथ के रूप में डाउनस्ट्रीम प्रोसेसिंग के लिए किया जाता है। व्यक्तिगत रूप से असफल वस्तुओं को बनाए रखने के लिए सफल प्रसव का पुन: उपयोग किया जाता है।
Markdown