m3u8 parser settings - panuozzo77/StreamingCommunity GitHub Wiki

M3U8 Parser Settings

This section documents the settings that control how StreamingCommunity parses and processes M3U8 playlists. These settings allow you to customize the resolution selection and determine whether to download content or just retrieve links.

Configuration Location

These settings are found in the M3U8_PARSER section of the config.json file:

{
    "M3U8_PARSER": {
        "force_resolution": "Best",
        "get_only_link": false
    }
}

Available Settings

force_resolution

  • Type: String
  • Default: "Best"
  • Description: Controls which video resolution is selected for downloading from the available options in the M3U8 playlist.
  • Options:
    • "Best": Selects the highest available resolution
    • "Worst": Selects the lowest available resolution
    • "1080p": Forces 1920x1080 resolution
    • "720p": Forces 1280x720 resolution
    • "480p": Forces 640x480 resolution
    • "360p": Forces 640x360 resolution
    • "320p": Forces 480x320 resolution
    • "240p": Forces 426x240 or 320x240 resolution
    • "144p": Forces 256x144 resolution
  • Usage: Choose based on your quality preferences and bandwidth limitations.

get_only_link

  • Type: Boolean
  • Default: false
  • Description: Controls whether the application downloads the content or just returns the M3U8 playlist URL. When enabled, the application will not download the content but will instead return the URL.
  • Usage: Set to true if you want to get the M3U8 URL for use with external players or tools instead of downloading the content.

Resolution Selection Behavior

When parsing an M3U8 playlist, the application follows these steps:

  1. Playlist Analysis: The application analyzes the M3U8 playlist to identify all available resolution variants.

  2. Resolution Matching:

    • If force_resolution is set to "Best", the highest resolution variant is selected.
    • If force_resolution is set to "Worst", the lowest resolution variant is selected.
    • If force_resolution is set to a specific resolution (e.g., "720p"), the application tries to find an exact match.
    • If the exact resolution is not available, the application selects the closest available resolution.
  3. Variant Selection: Once a resolution is selected, the application either:

    • Downloads the content if get_only_link is false
    • Returns the URL if get_only_link is true

Use Cases

Bandwidth Management

If you have limited bandwidth or storage constraints, you can use the force_resolution setting to control the quality of downloaded content:

  • For limited bandwidth: Set force_resolution to "480p" or lower
  • For mobile devices: Set force_resolution to "720p" or "480p"
  • For high-quality archiving: Set force_resolution to "Best" or "1080p"

External Players

If you want to use an external player like VLC or MPV to stream content:

  1. Set get_only_link to true
  2. Run the application to get the M3U8 URL
  3. Use the URL with your preferred player:
    vlc "http://example.com/stream.m3u8"
    
    or
    mpv "http://example.com/stream.m3u8"
    

Programmatic Access

You can access and modify these settings programmatically:

from StreamingCommunity.Util.config_json import config_manager

# Get a configuration value
resolution = config_manager.get('M3U8_PARSER', 'force_resolution')

# Set a configuration value
config_manager.set_key('M3U8_PARSER', 'force_resolution', '720p')
config_manager.save_config()

Related Settings

⚠️ **GitHub.com Fallback** ⚠️