MCPcopy Create free account

hub / github.com/SamurAIGPT/AI-Youtube-Shorts-Generator / functions

Functions51 in github.com/SamurAIGPT/AI-Youtube-Shorts-Generator

↓ 2 callersFunction_coerce_float
(value: object, default: float = 0.0)
shorts_generator/highlights.py:113
↓ 2 callersFunction_coerce_verbose
The /openai-whisper result can land as a dict or a JSON string depending on how the worker stored it. Normalise to a dict with `duration` and `seg
shorts_generator/transcriber.py:13
↓ 2 callersFunction_extract_video_url
MuAPI result shapes vary by endpoint — try common keys.
shorts_generator/downloader.py:7
↓ 2 callersFunction_format_srt_timestamp
(seconds: float)
shorts_generator/local/transcriber.py:21
↓ 2 callersFunction_headers
()
shorts_generator/muapi.py:19
↓ 2 callersFunction_parse_json_loose
gpt-5-4 sometimes wraps JSON in markdown fences — strip and parse.
shorts_generator/highlights.py:98
↓ 2 callersFunction_parse_srt_timestamp
(value: str)
shorts_generator/local/transcriber.py:32
↓ 2 callersFunction_transcript_cache_path
Return the .srt cache path for a media file.
shorts_generator/local/transcriber.py:14
↓ 2 callersFunctionbuild_transcript_text
(transcript: Dict)
shorts_generator/highlights.py:174
↓ 2 callersFunctioncall_highlight_api
( transcript_text: str, content_info: Dict, duration: float, num_clips: int, is_chunk: boo
shorts_generator/highlights.py:200
↓ 2 callersFunctiondedupe_highlights
Drop a highlight if it overlaps >50% with a higher-scoring one already kept.
shorts_generator/highlights.py:251
↓ 2 callersFunctionget_highlights
Main entry point — returns {highlights: [...]} sorted by score. `llm_fn` swaps the underlying LLM. Defaults to MuAPI gpt-5-mini; local mode p
shorts_generator/highlights.py:272
↓ 1 callersFunction_coerce_int
(value: object, default: int = 0)
shorts_generator/highlights.py:120
↓ 1 callersFunction_cut_subclip
ffmpeg -ss start -to end → re-encoded mp4 with audio.
shorts_generator/local/clipper.py:25
↓ 1 callersFunction_existing_download
Return a cached download path if we already have this YouTube id.
shorts_generator/local/downloader.py:86
↓ 1 callersFunction_extract_verbose_payload
MuAPI wraps results inconsistently across endpoints. Hunt for the verbose_json blob (which has `segments` + `duration`).
shorts_generator/transcriber.py:26
↓ 1 callersFunction_extract_youtube_video_id
Best-effort extraction of a YouTube video id from a URL.
shorts_generator/local/downloader.py:38
↓ 1 callersFunction_format_for
Map our '720' / '1080' shorthand to a yt-dlp format selector.
shorts_generator/local/downloader.py:26
↓ 1 callersFunction_import_ytdlp
()
shorts_generator/local/downloader.py:15
↓ 1 callersFunction_load_srt_cache
(cache_path: Path)
shorts_generator/local/transcriber.py:56
↓ 1 callersFunction_ratio
Parse '9:16' → 9/16, '1:1' → 1.0.
shorts_generator/local/clipper.py:16
↓ 1 callersFunction_reframe_vertical
Crop the cut clip to the target aspect ratio, tracking faces if possible.
shorts_generator/local/clipper.py:40
↓ 1 callersFunction_resolve_device
()
shorts_generator/local/transcriber.py:84
↓ 1 callersFunction_resolve_local_path
Return a local filesystem path if the input already points at one.
shorts_generator/local/downloader.py:61
↓ 1 callersFunction_run_api
( youtube_url: str, num_clips: int, aspect_ratio: str, download_format: str, language: Opt
shorts_generator/pipeline.py:56
↓ 1 callersFunction_run_local
( youtube_url: str, num_clips: int, aspect_ratio: str, download_format: str, language: Opt
shorts_generator/pipeline.py:17
↓ 1 callersFunction_sanitize_highlights
Normalize model output into the expected shape; skip invalid entries.
shorts_generator/highlights.py:127
↓ 1 callersFunction_write_srt_cache
(media_path: str, transcript: Dict)
shorts_generator/local/transcriber.py:40
↓ 1 callersFunctioncall_gemini_llm
Gemini backend used by --mode local when LLM_PROVIDER=gemini.
shorts_generator/local/llm.py:30
↓ 1 callersFunctioncall_openai_llm
OpenAI Chat Completions backend used by --mode local.
shorts_generator/local/llm.py:11
↓ 1 callersFunctionchunk_transcript
(transcript: Dict)
shorts_generator/highlights.py:179
↓ 1 callersFunctioncrop_clip
Submit one autocrop job and return the URL of the rendered short.
shorts_generator/clipper.py:12
↓ 1 callersFunctioncrop_clip_local
Cut + reframe one highlight, returning the local mp4 path.
shorts_generator/local/clipper.py:125
↓ 1 callersFunctioncrop_highlights
Crop every highlight, attaching the resulting URL back onto the dict.
shorts_generator/clipper.py:25
↓ 1 callersFunctioncrop_highlights_local
( source_path: str, highlights: List[Dict], aspect_ratio: str = "9:16", out_dir: Optional[str]
shorts_generator/local/clipper.py:143
↓ 1 callersFunctiondetect_content_type
(transcript: Dict, llm_fn: LLMFn = call_muapi_llm)
shorts_generator/highlights.py:163
↓ 1 callersFunctiondownload_youtube
Hand a YouTube URL to MuAPI; return a hosted mp4 URL we can read from.
shorts_generator/downloader.py:26
↓ 1 callersFunctiondownload_youtube_local
Download a remote URL or return a local file path unchanged.
shorts_generator/local/downloader.py:95
↓ 1 callersFunctionfetch_result
GET the latest result for a request_id; retry on transient timeouts.
shorts_generator/muapi.py:46
↓ 1 callersFunctiongenerate_shorts
Run the full pipeline and return a structured result. Args: youtube_url: source URL. num_clips: how many shorts to render.
shorts_generator/pipeline.py:90
↓ 1 callersFunctionmain
()
main.py:21
↓ 1 callersFunctionpoll
Block until the prediction is done; return the final payload.
shorts_generator/muapi.py:62
↓ 1 callersFunctionrequire_api_key
()
shorts_generator/config.py:44
↓ 1 callersFunctionrequire_gemini_key
()
shorts_generator/config.py:61
↓ 1 callersFunctionrequire_openai_key
()
shorts_generator/config.py:52
↓ 1 callersFunctionsubmit
POST to /api/v1/{endpoint} and return the request_id; retry transient errors.
shorts_generator/muapi.py:26
↓ 1 callersFunctiontranscribe
Run MuAPI /openai-whisper on a hosted media URL. Returns {duration: float, segments: [{start, end, text}, ...]} so it slots straight into the
shorts_generator/transcriber.py:49
↓ 1 callersFunctiontranscribe_local
Run faster-whisper on a local file path, caching the result as .srt.
shorts_generator/local/transcriber.py:98
Functioncall_local_llm
Dispatch to the configured local LLM provider.
shorts_generator/local/llm.py:53
Functioncall_muapi_llm
Default LLM backend: MuAPI gpt-5-mini.
shorts_generator/highlights.py:71
Functionrun
Submit then poll. Returns the final result payload.
shorts_generator/muapi.py:88