MCPcopy Create free account

hub / github.com/McCloudS/subgen / functions

Functions221 in github.com/McCloudS/subgen

↓ 73 callersMethodget
(self, block=True, timeout=None)
subgen.py:313
↓ 32 callersMethodfrom_string
Convert a string to a LanguageCode instance. Matches on ISO codes, English name, or native name.
language_code.py:143
↓ 32 callersMethodput
(self, item, block=True, timeout=None)
subgen.py:299
↓ 19 callersFunctionconvert_to_bool
(in_bool)
subgen.py:81
↓ 17 callersFunctionget_env_with_fallback
Get environment variable with backwards compatibility fallback. Args: new_name: The new standardized environment variable name
subgen.py:85
↓ 16 callersFunction_task
(path, task_type="transcribe")
tests/test_queue.py:21
↓ 15 callersFunctionshould_skip_file
Determines if subtitle generation should be skipped for a file. Args: file_path: Path to the media file. target_language: Th
subgen.py:1926
↓ 14 callersFunction_patch_defaults
(monkeypatch)
tests/test_skip_logic.py:25
↓ 12 callersMethodto_iso_639_1
(self)
language_code.py:168
↓ 12 callersMethodto_name
(self, in_english=True)
language_code.py:177
↓ 11 callersFunctionpath_mapping
(fullpath)
subgen.py:2455
↓ 9 callersFunctiongen_subtitles_queue
(file_path: str, transcription_type: str, force_language: LanguageCode = LanguageCode.NONE, **task_kwargs)
subgen.py:1888
↓ 7 callersMethodget_queued_tasks
(self)
subgen.py:336
↓ 6 callersFunctiondelete_model
Only schedules a cleanup timer if the system is actually idle. This prevents unnecessary timer resets when a large batch is being processed.
subgen.py:1512
↓ 6 callersFunctionhandle_multiple_audio_tracks
Handles the possibility of a media file having multiple audio tracks. Returns bytes directly instead of BytesIO to prevent memory leak.
subgen.py:1675
↓ 6 callersMethodis_valid_language
(language: str)
language_code.py:165
↓ 5 callersMethodis_active
Checks if a task_id is currently queued or processing.
subgen.py:331
↓ 4 callersFunctiondownload_from_github
(url, output_file)
launcher.py:22
↓ 4 callersFunctionget_audio_tracks
Extracts information about the audio tracks in a file. Returns: List of dictionaries with information about each audio track.
subgen.py:1808
↓ 4 callersFunctionget_plex_file_name
Gets the full path to a file from the Plex server. Args: itemid: The ID of the item in the Plex library. server_ip: The IP address
subgen.py:2289
↓ 4 callersFunctionget_subtitle_languages
Extract language codes from each subtitle stream in the video file using pyav. Forced subtitle tracks are excluded when ignore_forced_subtitl
subgen.py:2028
↓ 4 callersFunctionstart_model
()
subgen.py:1445
↓ 3 callersMethod_make_payload
(self, event="library.new", rating_key="12345")
tests/test_endpoints.py:107
↓ 3 callersMethodfrom_name
Convert a language name (either English or native) to LanguageCode enum.
language_code.py:132
↓ 3 callersFunctiongenerate_audio_hash
Generate a deterministic hash from audio content and optional parameters. Same audio + same task + same language = always same hash.
subgen.py:261
↓ 3 callersMethodget_processing_tasks
(self)
subgen.py:340
↓ 3 callersFunctionhas_audio
(file_path)
subgen.py:2410
↓ 3 callersFunctionhas_external_subtitle_in_language
Checks if the given folder has a subtitle file with the given language. Args: video_file (str): The path of the video file. target
subgen.py:2118
↓ 3 callersMethodmark_done
(self, item)
subgen.py:322
↓ 3 callersFunctionrefresh_jellyfin_metadata
Refreshes the metadata of a Jellyfin library item. Args: itemid: The ID of the item in the Jellyfin library whose metadata needs
subgen.py:2347
↓ 3 callersMethodset_error
(self, error)
subgen.py:244
↓ 3 callersMethodset_result
(self, result)
subgen.py:240
↓ 3 callersFunctiontranscribe_existing
(transcribe_folders, forceLanguage: LanguageCode = LanguageCode.NONE)
subgen.py:2521
↓ 2 callersMethod_fmt_t
Format seconds as [H:]MM:SS without milliseconds.
subgen.py:483
↓ 2 callersFunctionappendLine
(result)
subgen.py:516
↓ 2 callersFunctionconvert_to_bool
(in_bool)
launcher.py:7
↓ 2 callersMethodfrom_iso_639_2
(code)
language_code.py:125
↓ 2 callersFunctionget_next_plex_episode
Get the next episode's ratingKey based on the current episode in Plex. Args: current_episode_rating_key (str): The ratingKey of the c
subgen.py:2181
↓ 2 callersMethodhandle_event
Wait for file stability before processing.
subgen.py:2508
↓ 2 callersFunctionhas_internal_subtitle_in_language
Checks whether a video container has an embedded subtitle track in the given language. Forced subtitle tracks are excluded when ignore_forced
subgen.py:2081
↓ 2 callersFunctionis_audio_file_extension
(file_extension)
subgen.py:1533
↓ 2 callersMethodis_idle
(self)
subgen.py:327
↓ 2 callersFunctionload_env_variables
(env_filename='subgen.env')
launcher.py:60
↓ 2 callersFunctionname_subtitle
Name the subtitle file to be written, based on the source file and the language of the subtitle. Args: file_path: The path to
subgen.py:1658
↓ 1 callersMethod__init__
(self)
subgen.py:235
↓ 1 callersFunction_is_in_skipped_dir
Return True if any ancestor directory of file_path contains a .subgen_skip marker.
subgen.py:2483
↓ 1 callersFunctionapply_timestamp_offset
Shift all segment and word timestamps forward by the given offset. This compensates for audio start_time offsets in containers where the
subgen.py:1016
↓ 1 callersFunctionasr_task_worker
Worker function that processes ASR tasks from the queue. Called by transcription_worker when task type is 'asr'.
subgen.py:1047
↓ 1 callersFunctionchoose_transcribe_language
Determines the language to be used for transcription based on the provided file path and language preferences. Args: file_path:
subgen.py:1769
↓ 1 callersMethodcreate_subtitle
(self, event)
subgen.py:2498
↓ 1 callersFunctiondefine_subtitle_language_naming
Determines the naming format for a subtitle language based on the given type. Args: language (LanguageCode): The language code obje
subgen.py:1633
↓ 1 callersFunctiondetect_language_from_upload
Worker function that processes detect-language tasks from uploaded audio. Sets the result in the result_container when complete.
subgen.py:1242
↓ 1 callersFunctiondetect_language_task
Worker function that detects language for a local file. Returns the task data to be queued for transcription.
subgen.py:1349
↓ 1 callersFunctionextract_audio_segment_from_content
Extract a segment of audio from in-memory content using FFmpeg. Args: audio_content: Raw audio bytes start_time: Start t
subgen.py:1315
↓ 1 callersFunctionextract_audio_segment_to_memory
Extract a segment of audio from input_file, starting at start_time for duration seconds. :param input_file: UploadFile object or path to
subgen.py:1398
↓ 1 callersFunctionextract_audio_track_to_memory
Extract a specific audio track from a video file to memory using FFmpeg. Args: input_video_path (str): The path to the video file.
subgen.py:1714
↓ 1 callersFunctionfind_default_audio_track_language
Finds the language of the default audio track in the given list of audio tracks. Args: audio_tracks (list): A list of dictionaries c
subgen.py:1872
↓ 1 callersFunctionfind_language_audio_track
Checks if an audio track with any of the given languages is present in the list of audio tracks. Returns the first language from `find_langua
subgen.py:1854
↓ 1 callersFunctiongen_subtitles
Generates subtitles for a video file. Args: file_path: str - The path to the video file. transcription_type: str - The type of tr
subgen.py:1568
↓ 1 callersFunctionget_audio_chunk
Extract a chunk of audio from a file, starting at the given offset and of the given length. :param audio_file: The audio file (UploadFil
subgen.py:1136
↓ 1 callersFunctionget_audio_languages
Extract language codes from each audio stream in the video file. :param video_path: Path to the video file :return: List of language cod
subgen.py:2055
↓ 1 callersFunctionget_audio_start_time
Use ffprobe to detect the audio stream start_time offset from a video file. Some containers (especially Amazon WEB-DL) have audio stream
subgen.py:980
↓ 1 callersFunctionget_audio_track_by_language
Returns the first audio track with the given language. Args: audio_tracks (list): A list of dictionaries containing information
subgen.py:1753
↓ 1 callersFunctionget_jellyfin_admin
(users)
subgen.py:2403
↓ 1 callersFunctionget_jellyfin_file_name
Gets the full path to a file from the Jellyfin server. Args: jellyfin_url: The URL of the Jellyfin server. jellyfin_token: The Jel
subgen.py:2377
↓ 1 callersFunctionhas_audio_extension
(file_name)
subgen.py:2450
↓ 1 callersFunctionhas_video_extension
(file_name)
subgen.py:2446
↓ 1 callersFunctioninstall_packages_from_requirements
(requirements_file)
launcher.py:11
↓ 1 callersFunctionis_file_stable
Returns True if the file size is stable for a given number of checks.
subgen.py:2461
↓ 1 callersFunctionis_valid_path
(file_path)
subgen.py:2433
↓ 1 callersFunctionis_valid_subtitle_language
Checks if any part of the subtitle name matches the target language.
subgen.py:2177
↓ 1 callersFunctionmain
()
launcher.py:75
↓ 1 callersFunctionprompt_and_save_bazarr_env_variables
()
launcher.py:35
↓ 1 callersFunctionrefresh_plex_metadata
Refreshes the metadata of a Plex library item. Args: itemid: The ID of the item in the Plex library whose metadata needs to be r
subgen.py:2317
↓ 1 callersFunctionschedule_model_cleanup
Schedule model cleanup with a delay to allow concurrent requests. Properly joins cancelled timers to prevent thread accumulation.
subgen.py:1452
↓ 1 callersFunctionsend_completion_webhook
Sends a JSON POST request to a configured webhook URL upon task completion.
subgen.py:1545
↓ 1 callersFunctionsubtitle_exists_in_language
Determines if a subtitle file with the target language is available for a specified video file. This function checks both within the video f
subgen.py:2065
↓ 1 callersMethodto_iso_639_2_b
(self)
language_code.py:174
↓ 1 callersFunctionwrite_lrc
(result, file_path)
subgen.py:1536
Method__bool__
(self)
language_code.py:184
Method__call__
(self, seek, total)
subgen.py:491
Method__eq__
Compare the LanguageCode instance to another object. Explicitly handle comparison to None.
language_code.py:187
Method__init__
(self)
subgen.py:293
Method__init__
(self, filename)
subgen.py:476
Method__init__
(self, iso_639_1, iso_639_2_t, iso_639_2_b, name_en, name_native)
language_code.py:110
Method__str__
(self)
language_code.py:179
Functionasr
ASR endpoint that uses audio content hash for deduplication. BLOCKS until processing is complete, then returns the result. If ident
subgen.py:715
Functionbatch
( directory: str = Query(...), forceLanguage: Union[str, None] = Query(default=None) )
subgen.py:704
Functionclient
()
tests/test_endpoints.py:22
Functionclient
()
tests/test_integration.py:31
Functiondetect_language
( audio_file: UploadFile = File(...), encode: bool = Query(default=True), video_file: Union[str, N
subgen.py:1174
Methodfilter
(self, record)
subgen.py:425
Methodfrom_iso_639_1
(code)
language_code.py:118
Functionhandle_get_request
(request: Request)
subgen.py:541
Functionlifespan
(app: FastAPI)
subgen.py:210
Methodon_created
(self, event)
subgen.py:2513
Methodon_modified
(self, event)
subgen.py:2517
Functionopenai_transcriptions
OpenAI-compatible transcription endpoint (/v1/audio/transcriptions).
subgen.py:840
Functionopenai_translations
OpenAI-compatible translation endpoint (/v1/audio/translations). Always translates to English.
subgen.py:911
Functionperform_model_cleanup
Actually perform the model cleanup.
subgen.py:1476
next →1–100 of 221, ranked by callers