m3u8 download settings - panuozzo77/StreamingCommunity GitHub Wiki
This section documents the settings that control how StreamingCommunity downloads HLS (HTTP Live Streaming) content from M3U8 playlists. These settings allow you to customize the download process, including thread counts, audio and subtitle preferences, and cleanup behavior.
These settings are found in the M3U8_DOWNLOAD
section of the config.json
file:
{
"M3U8_DOWNLOAD": {
"tqdm_delay": 0.01,
"default_video_workser": 12,
"default_audio_workser": 12,
"segment_timeout": 8,
"download_audio": true,
"merge_audio": true,
"specific_list_audio": [
"ita"
],
"download_subtitle": true,
"merge_subs": true,
"specific_list_subtitles": [
"ita",
"eng"
],
"cleanup_tmp_folder": true
}
}
- Type: Float
-
Default:
0.01
- Description: The delay (in seconds) between progress bar updates when downloading content. This affects how frequently the download progress display is refreshed.
- Usage: Lower values provide more frequent updates but may increase CPU usage slightly. Higher values reduce update frequency but make the progress display less responsive.
- Type: Integer
-
Default:
12
- Description: The number of concurrent threads used for downloading video segments. More threads can speed up downloads on fast connections but may overload slower connections.
-
Command Line Override:
--default_video_worker <number>
-
Usage:
- Increase for faster downloads on high-bandwidth connections
- Decrease for more stable downloads on limited connections
- Recommended range: 4-24 depending on your internet speed
- Type: Integer
-
Default:
12
- Description: The number of concurrent threads used for downloading audio segments. Similar to video workers, this controls parallelism for audio downloads.
-
Command Line Override:
--default_audio_worker <number>
- Usage: Similar considerations as for video workers. Audio segments are typically smaller than video segments, so this can often be set to the same value as video workers.
- Type: Integer
-
Default:
8
-
Description: The maximum time (in seconds) to wait for an individual segment download before timing out. If a segment download exceeds this time, it will be retried according to the
max_retry
setting in the REQUESTS section. - Usage: Increase this value for slower connections or when downloading from less responsive servers.
- Type: Boolean
-
Default:
true
- Description: Controls whether audio tracks are downloaded. When enabled, the application will download audio tracks along with video.
-
Usage: Set to
false
if you only want to download video without audio (rarely needed).
- Type: Boolean
-
Default:
true
- Description: Controls whether downloaded audio tracks are merged with the video. When enabled, audio will be included in the final output file.
-
Usage: Set to
false
if you want to keep audio tracks as separate files.
- Type: Array of Strings
-
Default:
["ita"]
- Description: List of audio language codes to download. The application will only download audio tracks in these languages.
-
Command Line Override:
--specific_list_audio ita,eng
- Usage: Customize this list to include the languages you want. See the Available Language Codes section below.
- Type: Boolean
-
Default:
true
- Description: Controls whether subtitles are downloaded. When enabled, the application will download subtitle tracks if available.
-
Usage: Set to
false
if you don't want to download any subtitles.
- Type: Boolean
-
Default:
true
- Description: Controls whether downloaded subtitles are merged with the video. When enabled, subtitles will be embedded in the final output file.
-
Usage: Set to
false
if you want to keep subtitle files separate.
- Type: Array of Strings
-
Default:
["ita", "eng"]
- Description: List of subtitle language codes to download. The application will only download subtitle tracks in these languages.
-
Command Line Override:
--specific_list_subtitles ita,eng
- Usage: Customize this list to include the languages you want. See the Available Language Codes section below.
- Type: Boolean
-
Default:
true
- Description: Controls whether temporary .ts files are removed after download and processing is complete. When enabled, temporary files will be deleted to save disk space.
-
Usage: Set to
false
if you want to keep the temporary files for debugging or other purposes.
The following language codes can be used in the specific_list_audio
and specific_list_subtitles
settings:
European | Asian | Middle Eastern | Others |
---|---|---|---|
ita - Italian | chi - Chinese | ara - Arabic | eng - English |
spa - Spanish | jpn - Japanese | heb - Hebrew | por - Portuguese |
fre - French | kor - Korean | tur - Turkish | fil - Filipino |
ger - German | hin - Hindi | ind - Indonesian | |
rus - Russian | mal - Malayalam | may - Malay | |
swe - Swedish | tam - Tamil | vie - Vietnamese | |
pol - Polish | tel - Telugu | ||
ukr - Ukrainian | tha - Thai |
Several of these settings can be overridden via command line arguments when running the application:
python test_run.py --default_video_worker 8 --default_audio_worker 8 --specific_list_audio ita,eng --specific_list_subtitles eng,spa
For optimal download performance, consider these adjustments:
-
default_video_workser
: 16-24 -
default_audio_workser
: 16-24 -
segment_timeout
: 5-8
-
default_video_workser
: 8-12 -
default_audio_workser
: 8-12 -
segment_timeout
: 8-12
-
default_video_workser
: 4-6 -
default_audio_workser
: 4-6 -
segment_timeout
: 12-20
You can access and modify these settings programmatically:
from StreamingCommunity.Util.config_json import config_manager
# Get a configuration value
video_workers = config_manager.get_int('M3U8_DOWNLOAD', 'default_video_workser')
# Set a configuration value
config_manager.set_key('M3U8_DOWNLOAD', 'default_video_workser', 16)
config_manager.save_config()
- Request Settings - Configure network request behavior
- M3U8 Parser Settings - Configure HLS playlist parsing
- M3U8 Conversion Settings - Configure media conversion options