Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/update-zim-offliner-definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Update ZIMFarm Definitions

on:
push:
branches: [main]
paths:
- "offliner-definition.json"
release:
types: [published]

jobs:
prepare-json:
runs-on: ubuntu-24.04
outputs:
offliner_definition: ${{ steps.read-json.outputs.offliner_definition }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- id: read-json
run: |
if [ ! -f "offliner-definition.json" ]; then
echo "File not found!" >&2
exit 1
fi
json=$(jq -c . offliner-definition.json)
echo "offliner_definition=$json" >> $GITHUB_OUTPUT
call-workflow:
needs: prepare-json
uses: openzim/overview/.github/workflows/update-zimfarm-offliner-definition.yaml@main
with:
version: ${{ github.event_name == 'release' && github.event.release.tag_name || 'dev' }}
offliner: ted
offliner_definition: ${{ needs.prepare-json.outputs.offliner_definition }}
secrets:
zimfarm_ci_secret: ${{ secrets.ZIMFARM_CI_SECRET }}
184 changes: 184 additions & 0 deletions offliner-definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
{
"offliner_id": "ted",
"stdOutput": true,
"stdStats": false,
"flags": {
"topics": {
"type": "string",
"required": false,
"title": "Topics",
"description": "Comma-separated list of topics to scrape; as given on ted.com/talks. Pass all for all topics. Exclusive with playlists and links, only one must be set."
},
"playlists": {
"type": "string",
"required": false,
"title": "TED Playlists",
"description": "Comma-separated list of TED playlist IDs to scrape. Pass all for all playlists. Exclusive with topics and links, only one must set."
},
"links": {
"type": "string",
"required": false,
"title": "Links",
"description": "Comma-separated TED talk URLs to scrape, each in the format: https://www.ted.com/talks/<talk_slug>. Exclusive with topics and playlists, only one must set.",
"customValidator": "validate_ted_links"
},
"languages": {
"type": "string",
"required": false,
"title": "Languages",
"description": "Comma-separated list of ISO-639-3 language codes to filter videos. Do not pass this parameter for all languages",
"pattern": "^[a-z]{3}(,[a-z]{3})*$",
"customValidator": "language_code"
},
"subtitles_enough": {
"type": "boolean",
"required": false,
"title": "Subtitles enough?",
"description": "Whether to include videos that have a subtitle in requested language(s) if audio is in another language"
},
"subtitles": {
"type": "string",
"required": false,
"title": "Subtitles Setting",
"description": "Language setting for subtitles. all: include all available subtitles, matching (default): only subtitles matching language(s), none: include no subtitle. Also accepts comma-separated list of language(s)"
},
"video_format": {
"type": "string-enum",
"required": false,
"title": "Video format",
"description": "Format to download/transcode video to. webm is smaller",
"choices": [
{ "title": "WEBM", "value": "webm" },
{ "title": "MP4", "value": "mp4" }
]
},
"low_quality": {
"type": "boolean",
"required": false,
"title": "Low Quality",
"description": "Re-encode video using stronger compression"
},
"autoplay": {
"type": "boolean",
"required": false,
"title": "Autoplay videos",
"description": "Enable autoplay on videos. Behavior differs on platforms/browsers"
},
"name": {
"type": "string",
"required": true,
"title": "Name",
"description": "ZIM name. Used as identifier and filename (date will be appended)",
"pattern": "^([a-z0-9\\-\\.]+_)([a-z\\-]+_)([a-z0-9\\-\\.]+)$"
},
"title": {
"type": "string",
"required": false,
"title": "Title",
"description": "Custom title for your ZIM. Based on selection otherwise",
"minLength": 1,
"maxLength": 30
},
"description": {
"type": "string",
"required": false,
"title": "Description",
"description": "Custom description for your ZIM. Based on selection otherwise",
"minLength": 1,
"maxLength": 80
},
"long_description": {
"type": "string",
"required": false,
"title": "Long description",
"description": "Custom long description for your ZIM. Based on selection otherwise",
"minLength": 1,
"maxLength": 4000
},
"creator": {
"type": "string",
"required": false,
"title": "Content Creator",
"description": "Name of content creator. Defaults to TED"
},
"publisher": {
"type": "string",
"required": false,
"title": "Publisher",
"isPublisher": true,
"description": "Custom publisher name (ZIM metadata). \"openZIM\" otherwise"
},
"tags": {
"type": "string",
"required": false,
"title": "ZIM Tags",
"description": "List of comma-separated Tags for the ZIM file. category:ted, ted, and _videos:yes added automatically"
},
"optimization_cache": {
"type": "url",
"required": false,
"title": "Optimization Cache URL",
"description": "URL with credentials and bucket name to S3 Optimization Cache",
"secret": true
},
"use_any_optimized_version": {
"type": "boolean",
"required": false,
"title": "Use any optimized version",
"description": "Use the cached files if present, whatever the version"
},
"output": {
"type": "string",
"required": false,
"title": "Output folder",
"description": "Output folder for ZIM file(s). Leave it as `/output`",
"pattern": "^/output$"
},
"tmp_dir": {
"type": "string",
"required": false,
"title": "Temp folder",
"description": "Where to create temporay build folder. Leave it as `/output`",
"pattern": "^/output$"
},
"zim_file": {
"type": "string",
"required": false,
"title": "ZIM filename",
"description": "ZIM file name (based on ZIM name if not provided)",
"pattern": "^([a-z0-9\\-\\.]+_)([a-z\\-]+_)([a-z0-9\\-\\.]+_)([a-z0-9\\-\\.]+_|)([\\d]{4}-[\\d]{2}|\\{period\\}).zim$"
},
"debug": {
"type": "boolean",
"required": false,
"title": "Debug",
"description": "Enable verbose output"
},
"threads": {
"type": "integer",
"required": false,
"title": "Threads",
"description": "Number of parallel threads to use while downloading"
},
"locale": {
"type": "string",
"required": false,
"title": "Locale",
"description": "The locale to use for the translations in ZIM"
},
"language_threshold": {
"type": "integer",
"required": false,
"title": "Language Threshold",
"description": "Add language in ZIM metadata only if present in at least this percentage of videos. Number between 0 and 1. Defaults to 0.5: language must be used in 50% of videos to be considered as ZIM language.",
"min": 0,
"max": 1
}
},
"modelValidators": [
{
"name": "check_exclusive_fields",
"fields": ["links", "topics", "playlists"]
}
]
}