<filename>unbloated_youtube/backend/headers.py
"""
Python script to generate random User-Agent header.
"""
import random


DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{chrome_version} Safari/537.36"

CHROME_VERSIONS = [
                   '74.0.3729.129',
                   '76.0.3780.3',
                   '76.0.3780.2',
                   '74.0.3729.128',
                   '76.0.3780.1',
                   '76.0.3780.0',
                   '75.0.3770.15',
                   '74.0.3729.127',
                   '74.0.3729.126',
                   '76.0.3779.1',
                   '76.0.3779.0',
                   '75.0.3770.14',
                   '74.0.3729.125',
                   '76.0.3778.1',
                   '76.0.3778.0',
                   '75.0.3770.13',
                   '74.0.3729.124',
                   '74.0.3729.123',
                   '73.0.3683.121',
                   '76.0.3777.1',
                   '76.0.3777.0',
                   '75.0.3770.12',
                   '74.0.3729.122',
                   '76.0.3776.4',
                   '75.0.3770.11',
                   '74.0.3729.121',
                   '76.0.3776.3',
                   '76.0.3776.2',
                   '73.0.3683.120',
                   '74.0.3729.120',
                   '74.0.3729.119',
                   '74.0.3729.118',
                   '76.0.3776.1',
                   '76.0.3776.0',
                   '76.0.3775.5',
                   '75.0.3770.10',
                   '74.0.3729.117',
                   '76.0.3775.4',
                   '76.0.3775.3',
                   '74.0.3729.116',
                   '75.0.3770.9',
                   '76.0.3775.2',
                   '76.0.3775.1',
                   '76.0.3775.0',
                   '75.0.3770.8',
                   '74.0.3729.115',
                   '74.0.3729.114',
                   '76.0.3774.1',
                   '76.0.3774.0',
                   '75.0.3770.7',
                   '74.0.3729.113',
                   '74.0.3729.112',
                   '74.0.3729.111',
                   '76.0.3773.1',
                   '76.0.3773.0',
                   '75.0.3770.6',
                   '74.0.3729.110',
                   '74.0.3729.109',
                   '76.0.3772.1',
                   '76.0.3772.0',
                   '75.0.3770.5',
                   '74.0.3729.108',
                   '74.0.3729.107',
                   '76.0.3771.1',
                   '76.0.3771.0',
                   '75.0.3770.4',
                   '74.0.3729.106',
                   '74.0.3729.105']


def generate():
    version = random.choice(CHROME_VERSIONS)
    return DEFAULT_USER_AGENT.format(chrome_version=version)


if __name__ == "__main__":
    print(generate())


<filename>unbloated_youtube/backend/headers.py
"""
Python script to generate random User-Agent header.
"""
import random


DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/{chrome_version} Safari/537.36"

CHROME_VERSIONS = [
                   '74.0.3729.129',
                   '76.0.3780.3',
                   '76.0.3780.2',
                   '74.0.3729.128',
                   '76.0.3780.1',
                   '76.0.3780.0',
                   '75.0.3770.15',
                   '74.0.3729.127',
                   '74.0.3729.126',
                   '76.0.3779.1',
                   '76.0.3779.0',
                   '75.0.3770.14',
                   '74.0.3729.125',
                   '76.0.3778.1',
                   '76.0.3778.0',
                   '75.0.3770.13',
                   '74.0.3729.124',
                   '74.0.3729.123',
                   '73.0.3683.121',
                   '76.0.3777.1',
                   '76.0.3777.0',
                   '75.0.3770.12',
                   '74.0.3729.122',
                   '76.0.3776.4',
                   '75.0.3770.11',
                   '74.0.3729.121',
                   '76.0.3776.3',
                   '76.0.3776.2',
                   '73.0.3683.120',
                   '74.0.3729.120',
                   '74.0.3729.119',
                   '74.0.3729.118',
                   '76.0.3776.1',
                   '76.0.3776.0',
                   '76.0.3775.5',
                   '75.0.3770.10',
                   '74.0.3729.117',
                   '76.0.3775.4',
                   '76.0.3775.3',
                   '74.0.3729.116',
                   '75.0.3770.9',
                   '76.0.3775.2',
                   '76.0.3775.1',
                   '76.0.3775.0',
                   '75.0.3770.8',
                   '74.0.3729.115',
                   '74.0.3729.114',
                   '76.0.3774.1',
                   '76.0.3774.0',
                   '75.0.3770.7',
                   '74.0.3729.113',
                   '74.0.3729.112',
                   '74.0.3729.111',
                   '76.0.3773.1',
                   '76.0.3773.0',
                   '75.0.3770.6',
                   '74.0.3729.110',
                   '74.0.3729.109',
                   '76.0.3772.1',
                   '76.0.3772.0',
                   '75.0.3770.5',
                   '74.0.3729.108',
                   '74.0.3729.107',
                   '76.0.3771.1',
                   '76.0.3771.0',
                   '75.0.3770.4',
                   '74.0.3729.106',
                   '74.0.3729.105']


def generate():
    version = random.choice(CHROME_VERSIONS)
    return DEFAULT_USER_AGENT.format(chrome_version=version)


if __name__ == "__main__":
    print(generate())


Python script to generate random User-Agent header.