<commit_before>import os
import shutil

from urllib.parse import urljoin
from time import sleep

from process import start_process
from threading import Thread

SERVER_HOSTNAME         = os.environ['SERVER_HOSTNAME']
STREAMER_HOSTNAME       = os.environ['STREAMER_HOSTNAME']
OUTPUT_DIRECTORY        = os.environ['OUTPUT_DIRECTORY']
SERVER_PATH             = os.environ['SERVER_PATH']
OUTPUT_INDEX_FILE_NAME  = os.environ['OUTPUT_INDEX_FILE_NAME']
OUTPUT_TS_FILE_PATTERN  = os.environ['OUTPUT_TS_FILE_PATTERN']
SEGMENT_LEN             = 5 # Seconds
SEGMENT_COUNT           = 5

SOUT_CONFIG_TEMPLATE = '\
#std {{\
    access = livehttp {{\
        seglen = {seg_len},\
        delsegs = true,\
        numsegs = {seg_count},\
        index = {index_path},\
        index-url = {ts_url}\
    }},\
    mux = ts{{\
        use-key-frames\
    }},\
    dst = {ts_path}\
}}'

VLC_COMMAND = lambda port, sout_config: [
    'vlc',
    '-I', 'dummy',
    '--play-and-exit',
    '--live-caching', '300',
    'http://{}:{}'.format(STREAMER_HOSTNAME, port),
    '--sout', sout_config
]

class Proxy:<commit_msg>Increased TS segments' count and size The Chromecast was being unreasonably laggy with the previous values<commit_after>import os
import shutil

from urllib.parse import urljoin
from time import sleep

from process import start_process
from threading import Thread

SERVER_HOSTNAME         = os.environ['SERVER_HOSTNAME']
STREAMER_HOSTNAME       = os.environ['STREAMER_HOSTNAME']
OUTPUT_DIRECTORY        = os.environ['OUTPUT_DIRECTORY']
SERVER_PATH             = os.environ['SERVER_PATH']
OUTPUT_INDEX_FILE_NAME  = os.environ['OUTPUT_INDEX_FILE_NAME']
OUTPUT_TS_FILE_PATTERN  = os.environ['OUTPUT_TS_FILE_PATTERN']
SEGMENT_LEN             = 7 # Seconds
SEGMENT_COUNT           = 7

SOUT_CONFIG_TEMPLATE = '\
#std {{\
    access = livehttp {{\
        seglen = {seg_len},\
        delsegs = true,\
        numsegs = {seg_count},\
        index = {index_path},\
        index-url = {ts_url}\
    }},\
    mux = ts{{\
        use-key-frames\
    }},\
    dst = {ts_path}\
}}'

VLC_COMMAND = lambda port, sout_config: [
    'vlc',
    '-I', 'dummy',
    '--play-and-exit',
    '--live-caching', '300',
    'http://{}:{}'.format(STREAMER_HOSTNAME, port),
    '--sout', sout_config
]

class Proxy:
{'fraction_non_alphanumeric': 0.13237221494102228, 'fraction_numerical': 0.00436871996505024, 'mean_word_length': 2.855218855218855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3048094', 'n_tokens_mistral': 786, 'n_tokens_neox': 771, 'n_words': 158}