id
int64 0
458k
| file_name
stringlengths 4
119
| file_path
stringlengths 14
227
| content
stringlengths 24
9.96M
| size
int64 24
9.96M
| language
stringclasses 1
value | extension
stringclasses 14
values | total_lines
int64 1
219k
| avg_line_length
float64 2.52
4.63M
| max_line_length
int64 5
9.91M
| alphanum_fraction
float64 0
1
| repo_name
stringlengths 7
101
| repo_stars
int64 100
139k
| repo_forks
int64 0
26.4k
| repo_open_issues
int64 0
2.27k
| repo_license
stringclasses 12
values | repo_extraction_date
stringclasses 433
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,287,300 | 0015_starlog.py | Aftendo_Afternote/db/migrations/0015_starlog.py | # Generated by Django 4.1.7 on 2024-01-15 03:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('db', '0014_flipnote_blue_star_flipnote_green_star_and_more'),
]
operations = [
migrations.CreateModel(
name='StarLog',
fields=[
('id', models.IntegerField(blank=True, primary_key=True, serialize=False)),
('star', models.IntegerField(default=0)),
('green_star', models.IntegerField(default=0)),
('red_star', models.IntegerField(default=0)),
('blue_star', models.IntegerField(default=0)),
('purple_star', models.IntegerField(default=0)),
('flipnote', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='db.flipnote')),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
| 1,087 | Python | .py | 23 | 37.173913 | 129 | 0.620397 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,301 | 0004_user_ban.py | Aftendo_Afternote/db/migrations/0004_user_ban.py | # Generated by Django 4.1.7 on 2024-01-14 11:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0003_alter_session_user'),
]
operations = [
migrations.AddField(
model_name='user',
name='ban',
field=models.BooleanField(default=False),
),
]
| 377 | Python | .py | 13 | 21.769231 | 53 | 0.607242 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,302 | 0014_flipnote_blue_star_flipnote_green_star_and_more.py | Aftendo_Afternote/db/migrations/0014_flipnote_blue_star_flipnote_green_star_and_more.py | # Generated by Django 4.1.7 on 2024-01-15 00:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0013_user_blue_star_user_green_star_user_purple_star_and_more'),
]
operations = [
migrations.AddField(
model_name='flipnote',
name='blue_star',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='flipnote',
name='green_star',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='flipnote',
name='purple_star',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='flipnote',
name='red_star',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='flipnote',
name='star',
field=models.IntegerField(default=0),
),
]
| 1,038 | Python | .py | 33 | 21.69697 | 80 | 0.563 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,303 | 0002_flipnote_saved_flipnote_views_and_more.py | Aftendo_Afternote/db/migrations/0002_flipnote_saved_flipnote_views_and_more.py | # Generated by Django 4.1.7 on 2024-01-14 02:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='flipnote',
name='saved',
field=models.IntegerField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='flipnote',
name='views',
field=models.IntegerField(default=0),
preserve_default=False,
),
migrations.AlterField(
model_name='flipnote',
name='real_filename',
field=models.CharField(max_length=24, unique=True),
),
]
| 766 | Python | .py | 25 | 21.28 | 63 | 0.570652 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,304 | 0003_alter_flipnote_saved_alter_flipnote_views.py | Aftendo_Afternote/db/migrations/0003_alter_flipnote_saved_alter_flipnote_views.py | # Generated by Django 4.1.7 on 2024-01-14 02:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0002_flipnote_saved_flipnote_views_and_more'),
]
operations = [
migrations.AlterField(
model_name='flipnote',
name='saved',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='flipnote',
name='views',
field=models.IntegerField(default=0),
),
]
| 554 | Python | .py | 18 | 22.388889 | 62 | 0.595104 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,305 | 0017_flipnote_date.py | Aftendo_Afternote/db/migrations/0017_flipnote_date.py | # Generated by Django 4.1.7 on 2024-01-15 04:27
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('db', '0016_flipnote_total'),
]
operations = [
migrations.AddField(
model_name='flipnote',
name='date',
field=models.DateField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
]
| 479 | Python | .py | 15 | 24.733333 | 89 | 0.638344 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,306 | 0016_flipnote_total.py | Aftendo_Afternote/db/migrations/0016_flipnote_total.py | # Generated by Django 4.1.7 on 2024-01-15 04:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0015_starlog'),
]
operations = [
migrations.AddField(
model_name='flipnote',
name='total',
field=models.IntegerField(default=0),
),
]
| 368 | Python | .py | 13 | 21.076923 | 49 | 0.602857 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,307 | 0003_alter_session_user.py | Aftendo_Afternote/db/migrations/0003_alter_session_user.py | # Generated by Django 4.1.7 on 2024-01-14 11:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('db', '0002_session'),
]
operations = [
migrations.AlterField(
model_name='session',
name='user',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]
| 506 | Python | .py | 15 | 27.333333 | 121 | 0.668724 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,308 | 0008_alter_user_fsid_alter_user_mac.py | Aftendo_Afternote/db/migrations/0008_alter_user_fsid_alter_user_mac.py | # Generated by Django 4.1.7 on 2024-01-14 13:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0007_session_fsid_session_mac'),
]
operations = [
migrations.AlterField(
model_name='user',
name='fsid',
field=models.CharField(max_length=16, null=True, unique=True),
),
migrations.AlterField(
model_name='user',
name='mac',
field=models.CharField(max_length=12, null=True, unique=True),
),
]
| 579 | Python | .py | 18 | 23.777778 | 74 | 0.591727 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,309 | 0010_category_channel.py | Aftendo_Afternote/db/migrations/0010_category_channel.py | # Generated by Django 4.1.7 on 2024-01-14 17:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0009_flipnote_made_by_alter_user_fsid_alter_user_mac'),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.IntegerField(blank=True, primary_key=True, serialize=False)),
('internal_id', models.CharField(max_length=16)),
('name', models.CharField(max_length=32)),
],
),
migrations.CreateModel(
name='Channel',
fields=[
('id', models.IntegerField(blank=True, primary_key=True, serialize=False)),
('internal_id', models.CharField(max_length=16)),
('name', models.CharField(max_length=32)),
],
),
]
| 906 | Python | .py | 24 | 27.208333 | 91 | 0.559863 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,310 | 0009_flipnote_made_by_alter_user_fsid_alter_user_mac.py | Aftendo_Afternote/db/migrations/0009_flipnote_made_by_alter_user_fsid_alter_user_mac.py | # Generated by Django 4.1.7 on 2024-01-14 14:03
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('db', '0008_alter_user_fsid_alter_user_mac'),
]
operations = [
migrations.AddField(
model_name='flipnote',
name='made_by',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
preserve_default=False,
),
migrations.AlterField(
model_name='user',
name='fsid',
field=models.CharField(blank=True, max_length=16, null=True, unique=True),
),
migrations.AlterField(
model_name='user',
name='mac',
field=models.CharField(blank=True, max_length=12, null=True, unique=True),
),
]
| 936 | Python | .py | 26 | 27.423077 | 121 | 0.61989 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,311 | 0007_session_fsid_session_mac.py | Aftendo_Afternote/db/migrations/0007_session_fsid_session_mac.py | # Generated by Django 4.1.7 on 2024-01-14 13:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('db', '0006_session_temp_alter_session_token'),
]
operations = [
migrations.AddField(
model_name='session',
name='fsid',
field=models.CharField(default='', max_length=16),
preserve_default=False,
),
migrations.AddField(
model_name='session',
name='mac',
field=models.CharField(default='', max_length=12),
preserve_default=False,
),
]
| 637 | Python | .py | 20 | 23 | 62 | 0.581699 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,312 | ugo.py | Aftendo_Afternote/util/ugo.py | """
ugo.py
Conversion by ChatGPT
Based off jaames and sudofox class.ugomenu.php: https://github.com/Sudomemo/sudomemo-utils/blob/master/php/class.ugomenu.php
"""
import base64
import os
import struct
class UgoMenu:
def __init__(self):
self.types = {
"0": "0",
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"index": "0",
"small_list": "1",
"grid": "2",
"list": "4",
}
self.meta = {}
self.menu = {}
self.embeds = []
def write_label(self, text):
return base64.b64encode(text.encode("utf-16le")).decode()
def set_type(self, value):
self.meta["type"] = self.types[value]
def set_meta(self, value, text):
self.meta[value.lower()] = text
def add_dropdown(self, args):
if "dropdown" not in self.menu:
self.menu["dropdown"] = []
self.menu["dropdown"].append(
{
"url": args.get("url", ""),
"label": args.get("label", ""),
"selected": args.get("selected", "0"),
}
)
def add_button(self, args):
if "button" not in self.menu:
self.menu["button"] = []
self.menu["button"].append(
{
"url": args.get("url", ""),
"label": args.get("label", ""),
}
)
def add_item(self, args, should_replace_icon=True):
if "item" not in self.menu:
self.menu["item"] = []
if "file" in args:
self.add_file(args["file"])
if should_replace_icon:
args["icon"] = str(len(self.embeds) - 1)
self.menu["item"].append(
{
"url": args.get("url", ""),
"label": args.get("label", ""),
"icon": args.get("icon", "104"),
"counter": args.get("counter", ""),
"lock": args.get("lock", ""),
"unknown": args.get("unknown", "0"),
}
)
def add_file(self, path):
self.embeds.append(
{
"ext": os.path.splitext(path)[1][1:],
"path": path,
}
)
def get_ugo(self):
ret = b""
section_table = []
menu_data = []
# TYPE 0 -- LAYOUT TYPE
menu_data.append(b"0\t" + (self.meta.get("type", "4")).encode())
# TYPE 1 -- TOP SCREEN LAYOUT
if "upperlink" in self.meta:
menu_data.append(
b"1\t1\t" + self.meta["upperlink"].encode()
)
else:
menu_data.append(
b"1\t0\t"
+ self.write_label(self.meta.get("uppertitle", "")).encode()
+ b"\t"
+ self.write_label(self.meta.get("uppersubleft", "")).encode()
+ b"\t"
+ self.write_label(self.meta.get("uppersubright", "")).encode()
+ b"\t"
+ self.write_label(self.meta.get("uppersubtop", "")).encode()
+ b"\t"
+ self.write_label(self.meta.get("uppersubbottom", "")).encode()
)
# TYPE 2 -- DROPDOWN ITEMS
if "dropdown" in self.menu:
for item in self.menu["dropdown"]:
menu_data.append(
b"2\t"
+ item.get("url", b"").encode()
+ b"\t"
+ self.write_label(item.get("label", "")).encode()
+ b"\t"
+ item.get("selected", b"0").encode()
)
# TYPE 3 -- BUTTONS
if "button" in self.menu:
for item in self.menu["button"]:
menu_data.append(
b"3\t" + item.get("url", b"").encode() + b"\t" + self.write_label(item.get("label", "")).encode()
)
# TYPE 4 -- ITEMS
if "item" in self.menu:
for item in self.menu["item"]:
#dirty fix
if isinstance(item.get("icon"), int):
icon = "104"
else:
icon = item.get("icon")
menu_data.append(
b"4\t"
+ item.get("url", b"").encode()
+ b"\t"
+ icon.encode()
+ b"\t"
+ self.write_label(item.get("label", "")).encode()
+ b"\t"
+ item.get("counter", b"").encode()
+ b"\t"
+ item.get("lock", b"").encode()
+ b"\t"
+ item.get("unknown", b"0").encode()
)
# join all the items using newlines
menu_data = b"\n".join(menu_data)
# HEADER
# get the byte length of this section and add it to the section table
menu_data_len = len(menu_data)
section_table.append(menu_data_len)
# pad the actual length to the nearest multiple of four
menu_data = menu_data.ljust((menu_data_len + 3) // 4 * 4, b"\0")
# calculate the embed section length
embed_len = False
if len(self.embeds) > 0:
embed_len = 0
for item in self.embeds:
# .ppm is 1696 bytes while ntft is 2024
embed_len += 1696 if item["ext"] == "ppm" else 2048
# add this length to the section table
section_table.append(embed_len)
# write the magic ('UGAR') and number of sections
ret += struct.pack(f"4sI", b"UGAR", len(section_table))
# write the length of each section
ret += struct.pack(f"{len(section_table)}I", *section_table)
# append the menu data
ret += menu_data
# EMBEDS
if embed_len is not False:
for item in self.embeds:
# check that the file exists
if not os.path.exists(item["path"]):
filename = item["path"]
print(f"Error generating Ugomenu: could not open file {filename}")
exit()
# open the file
with open(item["path"], "rb") as file:
if item["ext"] == "ppm":
ret += file.read(1696)
elif item["ext"] == "ntft":
ret += file.read(2048)
return ret
| 6,478 | Python | .py | 174 | 24.114943 | 124 | 0.448248 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,313 | ppm.py | Aftendo_Afternote/util/ppm.py | # ========================================
# ppm.py version 1.0.0, fork for AfterNote
# ========================================
# Class for parsing Flipnote Studio's .ppm animation format
# Implementation by James Daniel (aka jaames) (github.com/jaames | rakujira.jp)
# Modified by Rixy for Afternote purposes, original code available at https://
#
# Credits:
# PPM format reverse-engineering and documentation:
# bricklife (http://ugomemo.g.hatena.ne.jp/bricklife/20090307/1236391313)
# mirai-iro (http://mirai-iro.hatenablog.jp/entry/20090116/ugomemo_ppm)
# harimau_tigris (http://ugomemo.g.hatena.ne.jp/harimau_tigris)
# steven (http://www.dsibrew.org/wiki/User:Steven)
# yellows8 (http://www.dsibrew.org/wiki/User:Yellows8)
# PBSDS (https://github.com/pbsds)
# jaames (https://github.com/jaames)
# Identifying the PPM sound codec:
# Midmad from Hatena Haiku
# WDLMaster from hcs64.com
import struct
import numpy as np
from datetime import datetime
class PPMParser:
@classmethod
def open(cls, path):
f = open(path, "rb")
return cls(f)
def __init__(self, stream=None):
if stream: self.load(stream)
def load(self, stream):
self.stream = stream
self.read_header()
if self.magic != b'PARA':
return False
self.read_meta()
return True
def unload(self):
self.stream.close()
def read_header(self):
# decode header
# https://github.com/pbsds/hatena-server/wiki/PPM-format#file-header
self.stream.seek(0)
magic, animation_data_size, sound_data_size, frame_count, version = struct.unpack("<4sIIHH", self.stream.read(16))
self.magic = magic
self.animation_data_size = animation_data_size
self.sound_data_size = sound_data_size
self.frame_count = frame_count + 1
def read_filename(self):
# Parent and current filenames are stored as:
# - 3 bytes representing the last 6 digits of the Consoles's MAC address
# - 13-character string
# - uint16 edit counter
mac, ident, edits = struct.unpack("<3s13sH", self.stream.read(18));
# Filenames are formatted as <3-byte MAC as hex>_<13-character string>_<edit counter as a 3-digit number>
# eg F78DA8_14768882B56B8_030
return "{0}_{1}_{2:03d}".format("".join(["%02X" % c for c in mac]), ident.decode("ascii"), edits)
def read_meta(self):
# decode metadata
# https://github.com/pbsds/hatena-server/wiki/PPM-format#file-header
self.stream.seek(0x10)
self.lock, self.thumb_index = struct.unpack("<HH", self.stream.read(4))
self.root_author_name = self.stream.read(22).decode("utf-16").rstrip("\x00")
self.parent_author_name = self.stream.read(22).decode("utf-16").rstrip("\x00")
self.current_author_name = self.stream.read(22).decode("utf-16").rstrip("\x00")
self.parent_author_id = "%016X" % struct.unpack("<Q", self.stream.read(8))
self.current_author_id = "%016X" % struct.unpack("<Q", self.stream.read(8))
self.parent_filename = self.read_filename()
self.current_filename = self.read_filename()
self.root_author_id = "%016X" % struct.unpack("<Q", self.stream.read(8))
self.partial_filename = self.stream.read(8) # not really useful for anything :/
# timestamp is stored as the number of seconds since jan 1st 2000
timestamp = struct.unpack("<I", self.stream.read(4))[0]
# we add 946684800 to convert this to a more common unix timestamp, which start on jan 1st 1970
self.timestamp = datetime.fromtimestamp(timestamp + 946684800)
def get_filename(self):
return self.current_filename
def read_thumbnail(self):
self.stream.seek(0xA0)
bitmap = np.zeros((48, 64), dtype=np.uint8)
for tile_index in range(0, 48):
tile_x = tile_index % 8 * 8
tile_y = tile_index // 8 * 8
for line in range(0, 8):
for pixel in range(0, 8, 2):
byte = ord(self.stream.read(1))
x = tile_x + pixel
y = tile_y + line
bitmap[y][x] = byte & 0x0F
bitmap[y][x + 1] = (byte >> 4) & 0x0F
return bitmap
def get_tmb(self):
self.stream.seek(0)
return self.stream.read(1696) | 4,127 | Python | .py | 93 | 39.967742 | 118 | 0.668243 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,314 | settings.py | Aftendo_Afternote/ugoflip/settings.py | """
Django settings for ugoflip project.
Generated by 'django-admin startproject' using Django 4.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-14nhy^-i)ku(#am35bbeqwn%^fnl@^ay626v7m!kvob!37v_5w'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ["*"]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'db.apps.DbConfig',
'flip.apps.FlipConfig',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'ugoflip.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'ugoflip.wsgi.application'
AUTH_USER_MODEL = "db.User"
# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/
STATIC_URL = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
| 3,308 | Python | .py | 92 | 31.48913 | 91 | 0.717699 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,315 | asgi.py | Aftendo_Afternote/ugoflip/asgi.py | """
ASGI config for ugoflip project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ugoflip.settings')
application = get_asgi_application()
| 391 | Python | .py | 10 | 37.5 | 78 | 0.802667 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,316 | urls.py | Aftendo_Afternote/ugoflip/urls.py | """ugoflip URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('ds/v2-<str:reg>/', include("flip.urls"))
]
| 809 | Python | .py | 20 | 37.55 | 77 | 0.716645 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,317 | wsgi.py | Aftendo_Afternote/ugoflip/wsgi.py | """
WSGI config for ugoflip project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ugoflip.settings')
application = get_wsgi_application()
| 391 | Python | .py | 10 | 37.5 | 78 | 0.802667 | Aftendo/Afternote | 8 | 2 | 1 | GPL-2.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,318 | main.py | Bbalduzz_phantomplus/main.py | from src.auth import DisneyPlusLogin
from src.api import DisneyPlusAPI
from src.parser import DisneyPlusParser
from src.m3u8_formatter import M3U8
from utils import utils
from pywidevine.decrypt.wvdecrypt import WvDecrypt
from collections import OrderedDict
from pathlib import Path
import m3u8, requests, base64, os, shutil, subprocess, ffmpy, json, random
mp4decrypt = os.path.join(os.path.dirname(__file__), "bin", "macos" if os.name == "posix" else "windows", "mp4decrypt" if os.name == "posix" else "mp4decrypt.exe")
mp4dump = os.path.join(os.path.dirname(__file__), "bin", "macos" if os.name == "posix" else "windows", "mp4dump" if os.name == "posix" else "mp4dump.exe")
aria2c = "aria2c" if os.name == "posix" else os.path.join(os.path.dirname(__file__), "bin", "widows", "aria2c.exe")
def get_pssh(url):
widevine_pssh = None
m3u8_obj = m3u8.load(url)
for key in m3u8_obj.keys:
if key is not None and key.keyformat == "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":
widevine_pssh = key.uri
if widevine_pssh is not None:
widevine_pssh = widevine_pssh.partition('base64,')[2]
return widevine_pssh
return False
def do_decrypt(auth_token, pssh):
wvdecrypt = WvDecrypt(pssh)
challenge = wvdecrypt.get_challenge()
resp = requests.post(
url='https://disney.playback.edge.bamgrid.com/widevine/v1/obtain-license',
headers={
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36',
'Authorization': f'Bearer {auth_token}'
},
data=challenge
)
license_b64 = base64.b64encode(resp.content)
wvdecrypt.update_license(license_b64)
keys = wvdecrypt.start_process()[1]
return keys
def download(url, output):
txturls = output + '_links_.txt'
baseurl = url.rsplit('/', 1)[0] + '/'
manifest = requests.get(url).text
dict_m3u8 = M3U8(manifest)
media_segment = dict_m3u8.media_segment
segments = []
frags_path = []
if 'MAIN' in manifest:
for seg in media_segment:
if seg.get('EXT-X-MAP') is not None and 'MAIN' in seg.get('EXT-X-MAP').get('URI'):
segments.append(baseurl+seg.get('EXT-X-MAP').get('URI'))
segments.append(baseurl+seg.get('URI'))
if seg.get('EXT-X-MAP') is None and 'MAIN' in seg.get('URI'):
segments.append(baseurl+seg.get('URI'))
else:
for seg in media_segment:
if seg.get('EXT-X-MAP') is not None:
segments.append(baseurl+seg.get('EXT-X-MAP').get('URI'))
segments.append(baseurl+seg.get('URI'))
if seg.get('EXT-X-MAP') is None:
segments.append(baseurl+seg.get('URI'))
segments = list(dict.fromkeys(segments)) # Remove duplicates
txt = open(txturls,"w+")
for i, s in enumerate(segments):
name = "0" + str(i) + '.mp4'
frags_path.append(name)
txt.write(s + f"\n out={name}\n")
txt.close()
aria2c_command = [
aria2c,
f'--input-file={txturls}',
'-x16',
'-j16',
'-s16',
'--summary-interval=0',
'--retry-wait=3',
'--max-tries=10',
'--enable-color=false',
'--download-result=hide',
'--console-log-level=error'
]
subprocess.run(aria2c_command)
runs = int(len(frags_path))
openfile = open(output ,"wb")
for run_num, fragment in enumerate(frags_path):
if os.path.isfile(fragment):
shutil.copyfileobj(open(fragment,"rb"),openfile)
os.remove(fragment)
utils.progress_bar(runs, run_num + 1, output)
openfile.close()
os.remove(txturls)
print('Download and concatenation complete!')
def decryptmedia(keys, inputName, outputName):
cmd = [mp4decrypt, *" ".join([f"--key {key}" for key in keys]).split(), inputName, outputName]
wvdecrypt_process = subprocess.Popen(cmd)
stdoutdata, stderrdata = wvdecrypt_process.communicate()
wvdecrypt_process.wait()
return True
def merge(input_video, input_audio, output_file):
downloads_path = Path('downloads')
if not downloads_path.is_dir(): downloads_path.mkdir()
output_path = downloads_path / output_file
ff = ffmpy.FFmpeg(
inputs={input_video: None, input_audio: None},
outputs={output_path: '-c:v copy -c:a copy'},
global_options="-y -hide_banner -loglevel warning"
)
ff.run()
return True
class DisneyPlusClient:
def __init__(self, email, password, disney_id, language, media_type="movie", serie_season=0, episode=0, quality = 1080):
self.email: str = email
self.password: str = password
self.disney_id: str = disney_id
self.language: str = language
self.media_type: str = media_type
self.serie_season: int = serie_season
self.season_episode: int = episode
self.quality: int = quality
login = DisneyPlusLogin(email=self.email, password=self.password)
token, expire = login.get_auth_token()
if self.media_type == "movie":
dsnp = DisneyPlusAPI(dsny_id=self.disney_id, token=token, language=self.language, media_type=self.media_type)
content = dsnp.load_playlist()
title = content["title"]
else:
dsnp = DisneyPlusAPI(dsny_id=self.disney_id, token=token, language=self.language, media_type="show", season=self.serie_season, episode=self.season_episode)
content = dsnp.load_playlist()
title = f'{content["title"]}_S{self.serie_season}E{self.season_episode}'
print(title)
m3u8_url = dsnp.load_info_m3u8(content["id"]["mediaId"], content["mediaFormat"])
load_manifest = DisneyPlusParser(m3u8_url["url"])
video_list, audio_list, subtitle_list, forced_list, audio_extension = load_manifest.parse()
print('[?] available audio: ',[audio['language'] for audio in audio_list])
quality_available = [int(x['height']) for x in video_list]
quality_available = list(OrderedDict.fromkeys(quality_available))
print('[?] available qualities: ',quality_available)
chosen_video_list = [x for x in video_list if int(x['height']) == int(self.quality)][0]
input_video_name = 'temp_video__enc.mp4'
decrypted_video_name = 'temp_video__dec.mp4'
download(chosen_video_list["url"], input_video_name)
for audio in audio_list:
if audio['language'] == self.language.title():
input_audio_name = 'temp_audio_' + audio['code'] + '_.mp4'
download(url=audio['url'], output=input_audio_name)
pssh = get_pssh(chosen_video_list["url"])
keys = do_decrypt(token, pssh)
print("[+] Decrypting media...")
decryptmedia(keys, input_video_name, decrypted_video_name)
print("[+] Merging video and audio...")
merge(decrypted_video_name, input_audio_name, f'{content["title"]} [{self.quality}p].mp4')
os.remove(input_audio_name)
os.remove(decrypted_video_name)
os.remove(input_video_name)
print("[+] Done. Check", os.path.join(os.getcwd(), "downloads"))
# == run ==
# > this is downloading the 3th episide of thr 1st season
# DisneyPlusClient(
# email = "", # your email
# password = "", # your password
# disney_id = "ql33aq42HBdr", # disneyplus_id (last part of the url)
# language = "italian",
# media_type = "show",
# serie_season = 1,
# episode = 3,
# quality = 720 # max
# )
# > this is downloading a movie
DisneyPlusClient(
email = " ", # your email
password = " ", # your password
disney_id = "1tmc3nPw04S2", # disneyplus_id (last part of the url)
language = "italian",
quality = 720 # max
) | 7,349 | Python | .py | 173 | 38.069364 | 163 | 0.679916 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,319 | api.py | Bbalduzz_phantomplus/src/api.py | import json
import uuid
import requests
import base64
import pycountry
class DisneyPlusAPI:
def __init__(self, dsny_id, token, media_type, language="english", season=None, episode=None):
self.is_movie = media_type.lower() == 'movie'
self.dsny_id = dsny_id
self.token = token
self.content_transaction_id = uuid.uuid4()
self.season = None if self.is_movie else season
self.episode = None if self.is_movie else episode
self.language = pycountry.languages.get(name=language).alpha_2
self.api_endpoints = {
'DmcSeriesBundle': f'https://disney.content.edge.bamgrid.com/svc/content/DmcSeriesBundle/version/5.1/region/US/audience/false/maturity/1850/language/{self.language}/encodedSeriesId/{{video_id}}',
'DmcEpisodes': f'https://disney.content.edge.bamgrid.com/svc/content/DmcEpisodes/version/5.1/region/US/audience/false/maturity/1850/language/{self.language}/seasonId/{{season_id}}/pageSize/30/page/1',
'DmcVideo': f'https://disney.content.edge.bamgrid.com/svc/content/DmcVideoBundle/version/5.1/region/US/audience/false/maturity/1850/language/{self.language}/encodedFamilyId/{{family_id}}',
'LicenseServer': 'https://edge.bamgrid.com/widevine/v1/obtain-license',
'manifest': 'https://disney.playback.edge.bamgrid.com/v7/playback/ctr-limited'
}
self.scenarios = {
"default": "restricted-drm-ctr-sw",
"default_hevc": "handset-drm-ctr-h265",
"SD": "handset-drm-ctr",
"HD": "tv-drm-ctr",
"atmos": "tv-drm-ctr-h265-hdr10-atmos",
"uhd_sdr": "tv-drm-ctr-h265-atmos",
"uhd_hdr": "tv-drm-ctr-h265-hdr10-atmos",
"uhd_dv": "tv-drm-ctr-h265-dovi-atmos",
}
def _get_headers(self, extra_headers=None):
headers = {
"accept": "application/json",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36",
"Sec-Fetch-Mode": "cors",
"x-bamsdk-platform": "windows",
"x-bamsdk-version": '3.10',
"authorization": f'Bearer {self.token}'
}
if extra_headers: headers |= extra_headers
return headers
def load_info_m3u8(self, media_id, media_format, is_atmos=False):
# NOTE: this has a sort of rate limiting
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0',
'Accept': 'application/vnd.media-service+json',
'Accept-Language': 'en-US,en;q=0.5',
# 'Accept-Encoding': 'gzip, deflate, br',
'Referer': 'https://www.disneyplus.com/',
'authorization': self.token,
'content-type': 'application/json',
'x-dss-feature-filtering': 'true',
'x-application-version': '1.1.2',
'x-bamsdk-client-id': 'disney-svod-3d9324fc',
'x-bamsdk-platform': 'javascript/macosx/firefox',
'x-bamsdk-version': '27.1',
'x-dss-edge-accept': 'vnd.dss.edge+json; version=2',
# 'x-request-id': '16556402-8fc2-45fa-905d-9894cbdd01bd',
'Origin': 'https://www.disneyplus.com',
# 'Connection': 'keep-alive',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'cross-site',
'Pragma': 'no-cache',
'Cache-Control': 'no-cache',
}
json_data = {
'playback': {
'attributes': {
'resolution': {'max': ['1280x720']}, # max res supported seems to be 720, but idk for sure
'protocol': 'HTTPS',
'assetInsertionStrategy': 'SGAI',
'playbackInitiationContext': 'ONLINE',
'frameRates': [60],
'slugDuration': 'SLUG_500_MS',
},
'adTracking': {
'limitAdTrackingEnabled': 'YES',
'deviceAdId': '00000000-0000-0000-0000-000000000000',
},
'tracking': {
'playbackSessionId': str(self.content_transaction_id),
},
},
'playbackId': base64.b64encode(json.dumps({"mediaId": f"{media_id}"}).encode()).decode(),
}
if is_atmos:
atmos_url = self.api_endpoints['manifest'].format(mediaid=media_id, scenarios=self.scenarios['uhd_hdr'])
resp = requests.get(atmos_url, headers=headers)
if resp.status_code != 200:
print(f'M3U8 - Error: {resp.text}')
return False
atmos_data = json.loads(resp.text)
atmos_stream_url = atmos_data['stream']['complete']
url = self.api_endpoints['manifest']
resp = requests.post(url=url, json=json_data, headers=headers)
if resp.status_code != 200:
print(f'M3U8 - Error: {resp.text}')
return False
data = json.loads(resp.text)
m3u8_url = data['stream']["sources"][0]['complete']
return (m3u8_url, atmos_stream_url) if is_atmos else m3u8_url
def load_playlist(self):
headers = self._get_headers()
if self.is_movie:
url = self.api_endpoints['DmcVideo'].format(family_id=self.dsny_id)
else:
url = self.api_endpoints['DmcSeriesBundle'].format(video_id=self.dsny_id)
resp = requests.get(url=url, headers=headers)
if resp.status_code != 200:
print(f'DATA - Error: {resp.text}')
return False
data = resp.json()
if self.is_movie:
return self._process_movie_data(data)
else:
return self._process_episode_data(data)
def _process_movie_data(self, data):
data_info = data['data']['DmcVideoBundle']['video']
title = data_info['text']['title']['full']['program']['default']['content']
description = data_info['text']['description']['medium']['program']['default']['content']
return {
'title': title,
'year': data_info['releases'][0]['releaseYear'],
'description': description,
'mediaFormat': data_info['mediaMetadata']['format'],
'id': {
'contentId': data_info['contentId'],
'mediaId': data_info['mediaMetadata']['mediaId']
}
}
def _process_episode_data(self, data):
episode_list = []
data_info = data['data']['DmcSeriesBundle']
season_title = data_info['series']['text']['title']['full']['series']['default']['content']
season = data_info['seasons']['seasons'][self.season - 1]
season_content_id = season['seasonId']
url = self.api_endpoints['DmcEpisodes'].format(season_id=season_content_id)
resp = requests.get(url=url, headers=self._get_headers())
if resp.status_code != 200:
print(f'DATA - Error: {resp.text}')
return False
episodes_data = resp.json()['data']['DmcEpisodes']['videos']
episode = episodes_data[self.episode - 1]
return {
'id': {
'contentId': episode['contentId'],
'mediaId': episode['mediaMetadata']['mediaId'],
},
'seasonNumber': episode['seasonSequenceNumber'],
'episodeNumber': episode['episodeSequenceNumber'],
'title': season_title,
'mediaFormat': episode['mediaMetadata']['format']
}
def __get_serie_data(self, data):
episode_list = []
data_info = data['data']['DmcSeriesBundle']
for season in data_info['seasons']['seasons']:
if int(season['seasonSequenceNumber']) == int(self.season) :
season_content_id = season['seasonId']
url = self.api_endpoints['DmcEpisodes'].format(season_id=season_content_id)
resp = requests.get(url=url, headers=self._get_headers())
if resp.status_code != 200:
print(f'DATA - Error: {resp.text}')
return False
episodes_data = resp.json()['data']['DmcEpisodes']['videos']
for episode in episodes_data:
episode_dict = {
'contentId': episode['contentId'],
'mediaId': episode['mediaMetadata']['mediaId'],
'seasonNumber': episode['seasonSequenceNumber'],
'episodeNumber': episode['episodeSequenceNumber'],
'Title': season_title,
'mediaFormat': episode['mediaMetadata']['format']
}
episode_list.append(episode_dict)
return episode_list
| 8,914 | Python | .py | 178 | 37.466292 | 212 | 0.563096 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,320 | m3u8_formatter.py | Bbalduzz_phantomplus/src/m3u8_formatter.py | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
from __future__ import absolute_import
import binascii
import copy
import os
import random
import re
import time
from datetime import datetime
from datetime import timedelta
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import algorithms
from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.ciphers import modes
from svtplay_dl.error import ServiceError
from svtplay_dl.error import UIException
from svtplay_dl.fetcher import VideoRetriever
from svtplay_dl.subtitle import subtitle
from svtplay_dl.utils.http import get_full_url
from svtplay_dl.utils.output import ETA
from svtplay_dl.utils.output import progress_stream
from svtplay_dl.utils.output import progressbar
class HLSException(UIException):
def __init__(self, url, message):
self.url = url
super().__init__(message)
class LiveHLSException(HLSException):
def __init__(self, url):
super().__init__(url, "This is a live HLS stream, and they are not supported.")
def hlsparse(config, res, url, **kwargs):
streams = {}
if not res:
return streams
if res.status_code > 400:
streams[0] = ServiceError("Can't read HLS playlist. {}".format(res.status_code))
return streams
m3u8 = M3U8(res.text)
keycookie = kwargs.pop("keycookie", None)
authorization = kwargs.pop("authorization", None)
httpobject = kwargs.pop("httpobject", None)
output = kwargs.pop("output", None)
media = {}
subtitles = {}
segments = None
if m3u8.master_playlist:
for i in m3u8.master_playlist:
audio_url = None
if i["TAG"] == "EXT-X-MEDIA":
if "AUTOSELECT" in i and (i["AUTOSELECT"].upper() == "YES"):
if i["TYPE"] and i["TYPE"] != "SUBTITLES":
if "URI" in i:
if segments is None:
segments = True
if i["GROUP-ID"] not in media:
media[i["GROUP-ID"]] = []
media[i["GROUP-ID"]].append(i["URI"])
else:
segments = False
if i["TYPE"] == "SUBTITLES":
if "URI" in i:
if i["GROUP-ID"] not in subtitles:
subtitles[i["GROUP-ID"]] = []
item = [i["URI"], i["LANGUAGE"]]
if item not in subtitles[i["GROUP-ID"]]:
subtitles[i["GROUP-ID"]].append(item)
continue
elif i["TAG"] == "EXT-X-STREAM-INF":
bit_rate = float(i["BANDWIDTH"]) / 1000
if "AUDIO" in i and (i["AUDIO"] in media):
audio_url = get_full_url(media[i["AUDIO"]][0], url)
urls = get_full_url(i["URI"], url)
else:
continue # Needs to be changed to utilise other tags.
streams[int(bit_rate)] = HLS(
copy.copy(config),
urls,
bit_rate,
cookies=res.cookies,
keycookie=keycookie,
authorization=authorization,
audio=audio_url,
output=output,
segments=bool(segments),
kwargs=kwargs,
)
if subtitles and httpobject:
for sub in list(subtitles.keys()):
for n in subtitles[sub]:
m3u8s = M3U8(httpobject.request("get", get_full_url(n[0], url), cookies=res.cookies).text)
if "cmore" in url:
subtype = "wrstsegment" # this have been seen in tv4play
else:
subtype = "wrst"
streams[int(random.randint(1, 40))] = subtitle(
copy.copy(config),
subtype,
get_full_url(m3u8s.media_segment[0]["URI"], url),
subfix=n[1],
output=copy.copy(output),
m3u8=m3u8s,
)
elif m3u8.media_segment:
config.set("segments", False)
streams[0] = HLS(
copy.copy(config), url, 0, cookies=res.cookies, keycookie=keycookie, authorization=authorization, output=output, segments=False
)
else:
streams[0] = ServiceError("Can't find HLS playlist in m3u8 file.")
return streams
class HLS(VideoRetriever):
@property
def name(self):
return "hls"
def download(self):
self.output_extention = "ts"
if self.segments:
if self.audio:
self._download(self.audio, file_name=(copy.copy(self.output), "audio.ts"))
self._download(self.url, file_name=(self.output, "ts"))
else:
# Ignore audio
self.audio = None
self._download(self.url, file_name=(self.output, "ts"))
def _download(self, url, file_name):
cookies = self.kwargs.get("cookies", None)
start_time = time.time()
m3u8 = M3U8(self.http.request("get", url, cookies=cookies).text)
key = None
def random_iv():
return os.urandom(16)
file_d = output(file_name[0], self.config, file_name[1])
if file_d is None:
return
hls_time_stamp = self.kwargs.pop("hls_time_stamp", False)
decryptor = None
size_media = len(m3u8.media_segment)
eta = ETA(size_media)
total_duration = 0
duration = 0
max_duration = 0
for index, i in enumerate(m3u8.media_segment):
if "duration" in i["EXTINF"]:
duration = i["EXTINF"]["duration"]
max_duration = max(max_duration, duration)
total_duration += duration
item = get_full_url(i["URI"], url)
if not self.config.get("silent"):
if self.config.get("live"):
progressbar(size_media, index + 1, "".join(["DU: ", str(timedelta(seconds=int(total_duration)))]))
else:
eta.increment()
progressbar(size_media, index + 1, "".join(["ETA: ", str(eta)]))
data = self.http.request("get", item, cookies=cookies)
if data.status_code == 404:
break
data = data.content
if m3u8.encrypted:
headers = {}
if self.keycookie:
keycookies = self.keycookie
else:
keycookies = cookies
if self.authorization:
headers["authorization"] = self.authorization
# Update key/decryptor
if "EXT-X-KEY" in i:
keyurl = get_full_url(i["EXT-X-KEY"]["URI"], url)
if keyurl and keyurl[:4] == "skd:":
raise HLSException(keyurl, "Can't decrypt beacuse of DRM")
key = self.http.request("get", keyurl, cookies=keycookies, headers=headers).content
iv = binascii.unhexlify(i["EXT-X-KEY"]["IV"][2:].zfill(32)) if "IV" in i["EXT-X-KEY"] else random_iv()
backend = default_backend()
cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=backend)
decryptor = cipher.decryptor()
if decryptor:
data = decryptor.update(data)
else:
raise ValueError("No decryptor found for encrypted hls steam.")
file_d.write(data)
if self.config.get("capture_time") > 0 and total_duration >= self.config.get("capture_time") * 60:
break
if (size_media == (index + 1)) and self.config.get("live"):
sleep_int = (start_time + max_duration * 2) - time.time()
if sleep_int > 0:
time.sleep(sleep_int)
size_media_old = size_media
while size_media_old == size_media:
start_time = time.time()
if hls_time_stamp:
end_time_stamp = (datetime.utcnow() - timedelta(minutes=1, seconds=max_duration * 2)).replace(microsecond=0)
start_time_stamp = end_time_stamp - timedelta(minutes=1)
base_url = url.split(".m3u8")[0]
url = "{}.m3u8?in={}&out={}?".format(base_url, start_time_stamp.isoformat(), end_time_stamp.isoformat())
new_m3u8 = M3U8(self.http.request("get", url, cookies=cookies).text)
for n_m3u in new_m3u8.media_segment:
if not any(d["URI"] == n_m3u["URI"] for d in m3u8.media_segment):
m3u8.media_segment.append(n_m3u)
size_media = len(m3u8.media_segment)
if size_media_old == size_media:
time.sleep(max_duration)
file_d.close()
if not self.config.get("silent"):
progress_stream.write("\n")
self.finished = True
class M3U8:
# Created for hls version <=7
# https://tools.ietf.org/html/rfc8216
MEDIA_SEGMENT_TAGS = ("EXTINF", "EXT-X-BYTERANGE", "EXT-X-DISCONTINUITY", "EXT-X-KEY", "EXT-X-MAP", "EXT-X-PROGRAM-DATE-TIME", "EXT-X-DATERANGE")
MEDIA_PLAYLIST_TAGS = (
"EXT-X-TARGETDURATION",
"EXT-X-MEDIA-SEQUENCE",
"EXT-X-DISCONTINUITY-SEQUENCE",
"EXT-X-ENDLIST",
"EXT-X-PLAYLIST-TYPE",
"EXT-X-I-FRAMES-ONLY",
)
MASTER_PLAYLIST_TAGS = ("EXT-X-MEDIA", "EXT-X-STREAM-INF", "EXT-X-I-FRAME-STREAM-INF", "EXT-X-SESSION-DATA", "EXT-X-SESSION-KEY")
MEDIA_OR_MASTER_PLAYLIST_TAGS = ("EXT-X-INDEPENDENT-SEGMENTS", "EXT-X-START")
TAG_TYPES = {"MEDIA_SEGMENT": 0, "MEDIA_PLAYLIST": 1, "MASTER_PLAYLIST": 2}
def __init__(self, data):
self.version = None
self.media_segment = []
self.media_playlist = {}
self.master_playlist = []
self.encrypted = False
self.independent_segments = False
self.parse_m3u(data)
def __str__(self):
return "Version: {}\nMedia Segment: {}\nMedia Playlist: {}\nMaster Playlist: {}\nEncrypted: {}\tIndependent_segments: {}".format(
self.version, self.media_segment, self.media_playlist, self.master_playlist, self.encrypted, self.independent_segments
)
def parse_m3u(self, data):
if not data.startswith("#EXTM3U"):
raise ValueError("Does not appear to be an 'EXTM3U' file.")
data = data.replace("\r\n", "\n")
lines = data.split("\n")[1:]
last_tag_type = None
tag_type = None
media_segment_info = {}
for index, l in enumerate(lines):
if not l:
continue
elif l.startswith("#EXT"):
info = {}
tag, attr = _get_tag_attribute(l)
if tag == "EXT-X-VERSION":
self.version = int(attr)
# 4.3.2. Media Segment Tags
elif tag in M3U8.MEDIA_SEGMENT_TAGS:
tag_type = M3U8.TAG_TYPES["MEDIA_SEGMENT"]
# 4.3.2.1. EXTINF
if tag == "EXTINF":
if "," in attr:
dur, title = attr.split(",", 1)
else:
dur = attr
title = None
info["duration"] = float(dur)
info["title"] = title
# 4.3.2.2. EXT-X-BYTERANGE
elif tag == "EXT-X-BYTERANGE":
if "@" in attr:
n, o = attr.split("@", 1)
info["n"], info["o"] = (int(n), int(o))
else:
info["n"] = int(attr)
info["o"] = 0
# 4.3.2.3. EXT-X-DISCONTINUITY
elif tag == "EXT-X-DISCONTINUITY":
pass
# 4.3.2.4. EXT-X-KEY
elif tag == "EXT-X-KEY":
self.encrypted = True
info = _get_tuple_attribute(attr)
# 4.3.2.5. EXT-X-MAP
elif tag == "EXT-X-MAP":
info = _get_tuple_attribute(attr)
# 4.3.2.6. EXT-X-PROGRAM-DATE-TIME"
elif tag == "EXT-X-PROGRAM-DATE-TIME":
info = attr
# 4.3.2.7. EXT-X-DATERANGE
elif tag == "EXT-X-DATERANGE":
info = _get_tuple_attribute(attr)
media_segment_info[tag] = info
# 4.3.3. Media Playlist Tags
elif tag in M3U8.MEDIA_PLAYLIST_TAGS:
tag_type = M3U8.TAG_TYPES["MEDIA_PLAYLIST"]
# 4.3.3.1. EXT-X-TARGETDURATION
if tag == "EXT-X-TARGETDURATION":
info = int(attr)
# 4.3.3.2. EXT-X-MEDIA-SEQUENCE
elif tag == "EXT-X-MEDIA-SEQUENCE":
info = int(attr)
# 4.3.3.3. EXT-X-DISCONTINUITY-SEQUENCE
elif tag == "EXT-X-DISCONTINUITY-SEQUENCE":
info = int(attr)
# 4.3.3.4. EXT-X-ENDLIST
elif tag == "EXT-X-ENDLIST":
break
# 4.3.3.5. EXT-X-PLAYLIST-TYPE
elif tag == "EXT-X-PLAYLIST-TYPE":
info = attr
# 4.3.3.6. EXT-X-I-FRAMES-ONLY
elif tag == "EXT-X-I-FRAMES-ONLY":
pass
self.media_playlist[tag] = info
# 4.3.4. Master Playlist Tags
elif tag in M3U8.MASTER_PLAYLIST_TAGS:
tag_type = M3U8.TAG_TYPES["MASTER_PLAYLIST"]
# 4.3.4.1. EXT-X-MEDIA
if tag == "EXT-X-MEDIA":
info = _get_tuple_attribute(attr)
# 4.3.4.2. EXT-X-STREAM-INF
elif tag == "EXT-X-STREAM-INF":
info = _get_tuple_attribute(attr)
if "BANDWIDTH" not in info:
raise ValueError("Can't find 'BANDWIDTH' in 'EXT-X-STREAM-INF'")
info["URI"] = lines[index + 1]
# 4.3.4.3. EXT-X-I-FRAME-STREAM-INF
elif tag == "EXT-X-I-FRAME-STREAM-INF":
info = _get_tuple_attribute(attr)
# 4.3.4.4. EXT-X-SESSION-DATA
elif tag == "EXT-X-SESSION-DATA":
info = _get_tuple_attribute(attr)
# 4.3.4.5. EXT-X-SESSION-KEY
elif tag == "EXT-X-SESSION-KEY":
self.encrypted = True
info = _get_tuple_attribute(attr)
info["TAG"] = tag
self.master_playlist.append(info)
# 4.3.5. Media or Master Playlist Tags
elif tag in M3U8.MEDIA_OR_MASTER_PLAYLIST_TAGS:
tag_type = M3U8.TAG_TYPES["MEDIA_PLAYLIST"]
# 4.3.5.1. EXT-X-INDEPENDENT-SEGMENTS
if tag == "EXT-X-INDEPENDENT-SEGMENTS":
self.independent_segments = True
# 4.3.5.2. EXT-X-START
elif tag == "EXT-X-START":
info = _get_tuple_attribute(attr)
self.media_playlist[tag] = info
# Unused tags
else:
pass
# This is a comment
elif l.startswith("#"):
pass
# This must be a url/uri
else:
tag_type = None
if last_tag_type is M3U8.TAG_TYPES["MEDIA_SEGMENT"]:
media_segment_info["URI"] = l
self.media_segment.append(media_segment_info)
media_segment_info = {}
last_tag_type = tag_type
if self.media_segment and self.master_playlist:
raise ValueError("This 'M3U8' file contains data for both 'Media Segment' and 'Master Playlist'. This is not allowed.")
def _get_tag_attribute(line):
line = line[1:]
try:
search_line = re.search(r"^([A-Z\-]*):(.*)", line)
return search_line.group(1), search_line.group(2)
except Exception:
return line, None
def _get_tuple_attribute(attribute):
attr_tuple = {}
for art_l in re.split(""",(?=(?:[^'"]|'[^']*'|"[^"]*")*$)""", attribute):
if art_l:
name, value = art_l.split("=", 1)
name = name.strip()
# Checks for attribute name
if not re.match(r"^[A-Z0-9\-]*$", name):
raise ValueError("Not a valid attribute name.")
# Remove extra quotes of string
if value.startswith('"') and value.endswith('"'):
value = value[1:-1]
attr_tuple[name] = value
return attr_tuple | 17,573 | Python | .py | 378 | 30.981481 | 149 | 0.496287 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,321 | auth.py | Bbalduzz_phantomplus/src/auth.py | import json
import re
import requests
class DisneyPlusLogin:
def __init__(self, email, password, proxies=None):
self.email = email
self.password = password
self.web_page = 'https://www.disneyplus.com/login'
self.devices_url = "https://global.edge.bamgrid.com/devices"
self.login_url = 'https://global.edge.bamgrid.com/idp/login'
self.token_url = "https://global.edge.bamgrid.com/token"
self.grant_url = 'https://global.edge.bamgrid.com/accounts/grant'
self.session = requests.Session()
if proxies:
self.session.proxies.update(proxies)
def _get_client_api_key(self):
response = self.session.get(self.web_page)
match = re.search("window.server_path = ({.*});", response.text)
json_data = json.loads(match.group(1))
return json_data["sdk"]["clientApiKey"]
def _get_assertion(self, client_api_key):
headers = {"Authorization": f"Bearer {client_api_key}", "Origin": "https://www.disneyplus.com"}
post_data = {
"applicationRuntime": "firefox",
"attributes": {},
"deviceFamily": "browser",
"deviceProfile": "macosx"
}
response = self.session.post(url=self.devices_url, headers=headers, json=post_data)
return response.json()["assertion"]
def _get_access_token(self, client_api_key, assertion):
headers = {"Authorization": f"Bearer {client_api_key}", "Origin": "https://www.disneyplus.com"}
post_data = {
"grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
"latitude": "0",
"longitude": "0",
"platform": "browser",
"subject_token": assertion,
"subject_token_type": "urn:bamtech:params:oauth:token-type:device"
}
response = self.session.post(url=self.token_url, headers=headers, data=post_data)
if response.status_code == 200:
return response.json()["access_token"]
else:
self._handle_error(response)
def _handle_error(self, response):
try:
error_message = response.json().get("errors", {}).get('error_description', response.text)
except json.JSONDecodeError:
error_message = response.text
print(f'Error: {error_message}')
exit()
def _login(self, access_token):
headers = self._get_headers(access_token)
data = {'email': self.email, 'password': self.password}
response = self.session.post(url=self.login_url, data=json.dumps(data), headers=headers)
if response.status_code == 200:
return response.json()["id_token"]
else:
self._handle_error(response)
def _get_headers(self, access_token):
return {
'Accept': 'application/json; charset=utf-8',
'Authorization': f"Bearer {access_token}",
'Content-Type': 'application/json; charset=UTF-8',
'Origin': 'https://www.disneyplus.com',
'Referer': 'https://www.disneyplus.com/login/password',
'Sec-Fetch-Mode': 'cors',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36',
'X-Bamsdk-Platform': 'windows',
'X-Bamsdk-Version': '3.10',
}
def _grant(self, id_token, access_token):
headers = self._get_headers(access_token)
data = {'id_token': id_token}
response = self.session.post(url=self.grant_url, data=json.dumps(data), headers=headers)
return response.json()["assertion"]
def _get_final_token(self, subject_token, client_api_key):
headers = {"Authorization": f"Bearer {client_api_key}", "Origin": "https://www.disneyplus.com"}
post_data = {
"grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
"latitude": "0",
"longitude": "0",
"platform": "browser",
"subject_token": subject_token,
"subject_token_type": "urn:bamtech:params:oauth:token-type:account"
}
response = self.session.post(url=self.token_url, headers=headers, data=post_data)
if response.status_code == 200:
token_data = response.json()
return token_data["access_token"], token_data["expires_in"]
else:
self._handle_error(response)
def get_auth_token(self):
client_api_key = self._get_client_api_key()
assertion = self._get_assertion(client_api_key)
access_token = self._get_access_token(client_api_key, assertion)
id_token = self._login(access_token)
user_assertion = self._grant(id_token, access_token)
final_token, expires_in = self._get_final_token(user_assertion, client_api_key)
return final_token, expires_in
| 4,902 | Python | .py | 101 | 38.732673 | 144 | 0.61132 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,322 | parser.py | Bbalduzz_phantomplus/src/parser.py | import requests
import re
import sys
import pycountry
from src.m3u8_formatter import M3U8
language_codes = {
"zh-Hans": "zhoS",
"zh-Hant": "zhoT",
"pt-BR": "brPor",
"es-ES": "euSpa",
"en-GB": "enGB",
"en-PH": "enPH",
"nl-BE": "nlBE",
"fil": "enPH",
"yue": "zhoS",
'fr-CA': 'caFra'
}
class DisneyPlusParser:
def __init__(self, m3u8_url, atmos_m3u8_url=None, is_2ch=False):
self.m3u8_url = m3u8_url
self.base_url = self.m3u8_url.rsplit('/', 1)[0] + '/'
self.is_atmos = atmos_m3u8_url is not None
self.atmos_m3u8_url = atmos_m3u8_url
self.atmos_base_url = self.atmos_m3u8_url.rsplit('/', 1)[0] + '/' if self.is_atmos else None
self.is_2ch = is_2ch
def get_country_code(self, code):
if code in ['cmn-Hans', 'cmn-Hant', 'es-419', 'es-ES', 'pt-BR', 'pt-PT', 'fr-CA', 'fr-FR']:
translations = {
'cmn-Hans': ('Mandarin Chinese (Simplified)', 'zh-Hans'),
'cmn-Hant': ('Mandarin Chinese (Traditional)', 'zh-Hant'),
'es-419': ('Spanish', 'spa'),
'es-ES': ('European Spanish', 'euSpa'),
'pt-BR': ('Brazilian Portuguese', 'brPor'),
'pt-PT': ('Portuguese', 'por'),
'fr-CA': ('French Canadian', 'caFra'),
'fr-FR': ('French', 'fra')
}
return translations[code]
lang_code = code.split('-')[0]
lang = pycountry.languages.get(alpha_2=lang_code) or pycountry.languages.get(alpha_3=lang_code)
try:
language_code = language_codes[code]
except KeyError:
language_code = lang.alpha_3
return lang.name, language_code
def get_codec(self, codecs):
search = 'hvc' if is_hevc or is_hdr or is_hdrdv else 'avc'
filtered_codecs = [c for c in codecs.split(',') if search in c]
return filtered_codecs[-1] if filtered_codecs else None
def parse(self):
video_list, audio_list, subtitle_list, forced_list = [], [], [], []
added = set()
video_manifest = self._fetch_manifest(self.m3u8_url)
audio_manifest = self._fetch_manifest(self.m3u8_url)
audio_base = self.base_url
audio_text = requests.get(self.m3u8_url).text
if 'eac-3' in str(audio_text):
audio_codecs = 'eac-3'
audio_extension = '.eac3'
else:
print('this item has no ac3 6ch, trying aac 2ch')
if 'aac-128k' in str(audio_text):
audio_codecs = 'aac-128k'
audio_extension = '.aac'
else:
print('this item has no aac 2ch')
sys.exit(1)
if audio_codecs is None or audio_extension is None:
print('error while search for audio codec in m3u8 streams.')
sys.exit(1)
video_streams = [x for x in video_manifest.master_playlist if x['TAG'] == 'EXT-X-STREAM-INF']
audio_streams = [x for x in audio_manifest.master_playlist if x['TAG'] == 'EXT-X-MEDIA']
subs_streams = [x for x in video_manifest.master_playlist if x['TAG'] == 'EXT-X-MEDIA']
for video in video_streams:
if not video["URI"] in added:
bitrate = 'None'
if re.search('([0-9]*)k_', video["URI"]):
bitrate = str(re.search('([0-9]*)k_', video["URI"])[1])
else:
if re.search('([0-9]*)_complete', video["URI"]):
bitrate = str(re.search('([0-9]*)_complete', video["URI"])[1])
video_list.append(
{
'resolution': video["RESOLUTION"],
'codec': str(video["CODECS"]),
'bandwidth': str(video["BANDWIDTH"]),
'bitrate': bitrate,
'height': video["RESOLUTION"].rsplit('x', 1)[1],
'url': self.base_url+video["URI"]
}
)
added.add(video["URI"])
for m in audio_streams:
if m['TYPE'] == 'AUDIO' and m['GROUP-ID'] == audio_codecs and m.get('CHARACTERISTICS') is None:
bitrate = 'None'
if re.search('([0-9]*)k_', m["URI"]):
bitrate = str(re.search('([0-9]*)k_', m["URI"])[1])
else:
if re.search('([0-9]*)_complete', m["URI"]):
bitrate = str(re.search('([0-9]*)_complete', m["URI"])[1])
bitrate = '768' if str(m['CHANNELS']) == '16/JOC' and int(bitrate) > 768 else bitrate
language, code = self.get_country_code(m['LANGUAGE'])
Profile = m['GROUP-ID']
Profile = "aac" if "aac" in m['GROUP-ID'].lower() else Profile
Profile = "eac-3" if "eac-3" in m['GROUP-ID'].lower() else Profile
Profile = "atmos" if "joc" in m['GROUP-ID'].lower() else Profile
audio_list.append(
{
'language': str(language),
'code': str(code),
'bitrate': bitrate,
'codec': Profile,
'channels': str(m['CHANNELS'].replace('"', "").replace("/JOC", "")),
'url': audio_base+m['URI']
}
)
for m in subs_streams:
if m['TYPE'] == 'SUBTITLES' and m['FORCED'] == 'NO':
language, code = self.get_country_code(m['LANGUAGE'])
subtitle_list.append(
{
'language': str(language),
'code': str(code),
'url': self.base_url+m['URI']
}
)
if m['TYPE'] == 'SUBTITLES' and m['FORCED'] == 'NO' and m['LANGUAGE'] == 'en':
language, code = self.get_country_code(m['LANGUAGE'])
subtitle_list.append(
{
'language': str(language),
'code': 'sdh-' + str(code),
'url': self.base_url+m['URI']
}
)
if m['TYPE'] == 'SUBTITLES' and m['FORCED'] == 'YES':
language, code = self.get_country_code(m['LANGUAGE'])
forced_list.append(
{
'language': str(language),
'code': str(code),
'url': self.base_url+m['URI']
}
)
video_list = sorted(video_list, key=lambda k: int(k['bandwidth']))
return video_list, audio_list, subtitle_list, forced_list, audio_extension
def _fetch_manifest(self, url):
response = requests.get(url)
return M3U8(response.text)
| 7,131 | Python | .py | 149 | 31.986577 | 107 | 0.465284 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,323 | cdm.py | Bbalduzz_phantomplus/pywidevine/cdm/cdm.py | import base64
import os
import time
import binascii
from google.protobuf.message import DecodeError
from google.protobuf import text_format
from pywidevine.cdm.formats import wv_proto2_pb2 as wv_proto2
from pywidevine.cdm.session import Session
from pywidevine.cdm.key import Key
from Cryptodome.Random import get_random_bytes
from Cryptodome.Random import random
from Cryptodome.Cipher import PKCS1_OAEP, AES
from Cryptodome.Hash import CMAC, SHA256, HMAC, SHA1
from Cryptodome.PublicKey import RSA
from Cryptodome.Signature import pss
from Cryptodome.Util import Padding
import logging
class Cdm:
def __init__(self):
self.logger = logging.getLogger(__name__)
self.sessions = {}
self.loglevel = logging.DEBUG
"""basic logging that only shows the message"""
if self.loglevel == logging.INFO:
logging.basicConfig(
format='%(message)s',
level=self.loglevel,
)
def open_session(self, init_data_b64, device, raw_init_data = None, offline=False):
self.logger.debug("open_session(init_data_b64={}, device={}".format(init_data_b64, device))
self.logger.info("opening new cdm session")
if device.session_id_type == 'android':
# format: 16 random hexdigits, 2 digit counter, 14 0s
rand_ascii = ''.join(random.choice('ABCDEF0123456789') for _ in range(16))
counter = '01' # this resets regularly so its fine to use 01
rest = '00000000000000'
session_id = rand_ascii + counter + rest
session_id = session_id.encode('ascii')
elif device.session_id_type == 'chrome':
rand_bytes = get_random_bytes(16)
session_id = rand_bytes
else:
# other formats NYI
self.logger.error("device type is unusable")
return 1
if raw_init_data and isinstance(raw_init_data, (bytes, bytearray)):
# used for NF key exchange, where they don't provide a valid PSSH
init_data = raw_init_data
self.raw_pssh = True
else:
init_data = self._parse_init_data(init_data_b64)
self.raw_pssh = False
if init_data:
new_session = Session(session_id, init_data, device, offline)
else:
self.logger.error("unable to parse init data")
return 1
self.sessions[session_id] = new_session
self.logger.info("session opened and init data parsed successfully")
return session_id
def _parse_init_data(self, init_data_b64):
parsed_init_data = wv_proto2.WidevineCencHeader()
try:
self.logger.debug("trying to parse init_data directly")
parsed_init_data.ParseFromString(base64.b64decode(init_data_b64)[32:])
except DecodeError:
self.logger.debug("unable to parse as-is, trying with removed pssh box header")
try:
id_bytes = parsed_init_data.ParseFromString(base64.b64decode(init_data_b64)[32:])
except DecodeError:
self.logger.error("unable to parse, unsupported init data format")
return None
self.logger.debug("init_data:")
for line in text_format.MessageToString(parsed_init_data).splitlines():
self.logger.debug(line)
return parsed_init_data
def close_session(self, session_id):
self.logger.debug("close_session(session_id={})".format(session_id))
self.logger.info("closing cdm session")
if session_id in self.sessions:
self.sessions.pop(session_id)
self.logger.info("cdm session closed")
return 0
else:
self.logger.info("session {} not found".format(session_id))
return 1
def set_service_certificate(self, session_id, cert_b64):
self.logger.debug("set_service_certificate(session_id={}, cert={})".format(session_id, cert_b64))
self.logger.info("setting service certificate")
if session_id not in self.sessions:
self.logger.error("session id doesn't exist")
return 1
session = self.sessions[session_id]
message = wv_proto2.SignedMessage()
try:
message.ParseFromString(base64.b64decode(cert_b64))
except DecodeError:
self.logger.error("failed to parse cert as SignedMessage")
service_certificate = wv_proto2.SignedDeviceCertificate()
if message.Type:
self.logger.debug("service cert provided as signedmessage")
try:
service_certificate.ParseFromString(message.Msg)
except DecodeError:
self.logger.error("failed to parse service certificate")
return 1
else:
self.logger.debug("service cert provided as signeddevicecertificate")
try:
service_certificate.ParseFromString(base64.b64decode(cert_b64))
except DecodeError:
self.logger.error("failed to parse service certificate")
return 1
self.logger.debug("service certificate:")
for line in text_format.MessageToString(service_certificate).splitlines():
self.logger.debug(line)
session.service_certificate = service_certificate
session.privacy_mode = True
return 0
def get_license_request(self, session_id):
self.logger.debug("get_license_request(session_id={})".format(session_id))
self.logger.info("getting license request")
if session_id not in self.sessions:
self.logger.error("session ID does not exist")
return 1
session = self.sessions[session_id]
# print("cmd.py", session.device_config.parent_dir)
# raw pssh will be treated as bytes and not parsed
if self.raw_pssh:
license_request = wv_proto2.SignedLicenseRequestRaw()
else:
license_request = wv_proto2.SignedLicenseRequest()
client_id = wv_proto2.ClientIdentification()
if not os.path.exists(session.device_config.device_client_id_blob_filename):
self.logger.error("no client ID blob available for this device")
return 1
with open(session.device_config.device_client_id_blob_filename, "rb") as f:
try:
cid_bytes = client_id.ParseFromString(f.read())
except DecodeError:
self.logger.error("client id failed to parse as protobuf")
return 1
self.logger.debug("building license request")
if not self.raw_pssh:
license_request.Type = wv_proto2.SignedLicenseRequest.MessageType.Value('LICENSE_REQUEST')
license_request.Msg.ContentId.CencId.Pssh.CopyFrom(session.init_data)
else:
license_request.Type = wv_proto2.SignedLicenseRequestRaw.MessageType.Value('LICENSE_REQUEST')
license_request.Msg.ContentId.CencId.Pssh = session.init_data # bytes
if session.offline:
license_type = wv_proto2.LicenseType.Value('OFFLINE')
else:
license_type = wv_proto2.LicenseType.Value('DEFAULT')
license_request.Msg.ContentId.CencId.LicenseType = license_type
license_request.Msg.ContentId.CencId.RequestId = session_id
license_request.Msg.Type = wv_proto2.LicenseRequest.RequestType.Value('NEW')
license_request.Msg.RequestTime = int(time.time())
license_request.Msg.ProtocolVersion = wv_proto2.ProtocolVersion.Value('CURRENT')
if session.device_config.send_key_control_nonce:
license_request.Msg.KeyControlNonce = random.randrange(1, 2**31)
if session.privacy_mode:
if session.device_config.vmp:
self.logger.debug("vmp required, adding to client_id")
self.logger.debug("reading vmp hashes")
vmp_hashes = wv_proto2.FileHashes()
with open(session.device_config.device_vmp_blob_filename, "rb") as f:
try:
vmp_bytes = vmp_hashes.ParseFromString(f.read())
except DecodeError:
self.logger.error("vmp hashes failed to parse as protobuf")
return 1
client_id._FileHashes.CopyFrom(vmp_hashes)
self.logger.debug("privacy mode & service certificate loaded, encrypting client id")
self.logger.debug("unencrypted client id:")
for line in text_format.MessageToString(client_id).splitlines():
self.logger.debug(line)
cid_aes_key = get_random_bytes(16)
cid_iv = get_random_bytes(16)
cid_cipher = AES.new(cid_aes_key, AES.MODE_CBC, cid_iv)
encrypted_client_id = cid_cipher.encrypt(Padding.pad(client_id.SerializeToString(), 16))
service_public_key = RSA.importKey(session.service_certificate._DeviceCertificate.PublicKey)
service_cipher = PKCS1_OAEP.new(service_public_key)
encrypted_cid_key = service_cipher.encrypt(cid_aes_key)
encrypted_client_id_proto = wv_proto2.EncryptedClientIdentification()
encrypted_client_id_proto.ServiceId = session.service_certificate._DeviceCertificate.ServiceId
encrypted_client_id_proto.ServiceCertificateSerialNumber = session.service_certificate._DeviceCertificate.SerialNumber
encrypted_client_id_proto.EncryptedClientId = encrypted_client_id
encrypted_client_id_proto.EncryptedClientIdIv = cid_iv
encrypted_client_id_proto.EncryptedPrivacyKey = encrypted_cid_key
license_request.Msg.EncryptedClientId.CopyFrom(encrypted_client_id_proto)
else:
license_request.Msg.ClientId.CopyFrom(client_id)
if session.device_config.private_key_available:
key = RSA.importKey(open(session.device_config.device_private_key_filename).read())
session.device_key = key
else:
self.logger.error("need device private key, other methods unimplemented")
return 1
self.logger.debug("signing license request")
hash = SHA1.new(license_request.Msg.SerializeToString())
signature = pss.new(key).sign(hash)
license_request.Signature = signature
session.license_request = license_request
self.logger.debug("license request:")
for line in text_format.MessageToString(session.license_request).splitlines():
self.logger.debug(line)
self.logger.info("license request created")
self.logger.debug("license request b64: {}".format(base64.b64encode(license_request.SerializeToString())))
return license_request.SerializeToString()
def provide_license(self, session_id, license_b64):
self.logger.debug("provide_license(session_id={}, license_b64={})".format(session_id, license_b64))
self.logger.info("decrypting provided license")
if session_id not in self.sessions:
self.logger.error("session does not exist")
return 1
session = self.sessions[session_id]
if not session.license_request:
self.logger.error("generate a license request first!")
return 1
license = wv_proto2.SignedLicense()
try:
license.ParseFromString(base64.b64decode(license_b64))
except DecodeError:
self.logger.error("unable to parse license - check protobufs")
return 1
session.license = license
self.logger.debug("license:")
for line in text_format.MessageToString(license).splitlines():
self.logger.debug(line)
self.logger.debug("deriving keys from session key")
oaep_cipher = PKCS1_OAEP.new(session.device_key)
session.session_key = oaep_cipher.decrypt(license.SessionKey)
lic_req_msg = session.license_request.Msg.SerializeToString()
enc_key_base = b"ENCRYPTION\000" + lic_req_msg + b"\0\0\0\x80"
auth_key_base = b"AUTHENTICATION\0" + lic_req_msg + b"\0\0\2\0"
enc_key = b"\x01" + enc_key_base
auth_key_1 = b"\x01" + auth_key_base
auth_key_2 = b"\x02" + auth_key_base
auth_key_3 = b"\x03" + auth_key_base
auth_key_4 = b"\x04" + auth_key_base
cmac_obj = CMAC.new(session.session_key, ciphermod=AES)
cmac_obj.update(enc_key)
enc_cmac_key = cmac_obj.digest()
cmac_obj = CMAC.new(session.session_key, ciphermod=AES)
cmac_obj.update(auth_key_1)
auth_cmac_key_1 = cmac_obj.digest()
cmac_obj = CMAC.new(session.session_key, ciphermod=AES)
cmac_obj.update(auth_key_2)
auth_cmac_key_2 = cmac_obj.digest()
cmac_obj = CMAC.new(session.session_key, ciphermod=AES)
cmac_obj.update(auth_key_3)
auth_cmac_key_3 = cmac_obj.digest()
cmac_obj = CMAC.new(session.session_key, ciphermod=AES)
cmac_obj.update(auth_key_4)
auth_cmac_key_4 = cmac_obj.digest()
auth_cmac_combined_1 = auth_cmac_key_1 + auth_cmac_key_2
auth_cmac_combined_2 = auth_cmac_key_3 + auth_cmac_key_4
session.derived_keys['enc'] = enc_cmac_key
session.derived_keys['auth_1'] = auth_cmac_combined_1
session.derived_keys['auth_2'] = auth_cmac_combined_2
self.logger.debug('verifying license signature')
lic_hmac = HMAC.new(session.derived_keys['auth_1'], digestmod=SHA256)
lic_hmac.update(license.Msg.SerializeToString())
self.logger.debug("calculated sig: {} actual sig: {}".format(lic_hmac.hexdigest(), binascii.hexlify(license.Signature)))
if lic_hmac.digest() != license.Signature:
self.logger.info("license signature doesn't match - writing bin so they can be debugged")
with open("original_lic.bin", "wb") as f:
f.write(base64.b64decode(license_b64))
with open("parsed_lic.bin", "wb") as f:
f.write(license.SerializeToString())
self.logger.info("continuing anyway")
self.logger.debug("key count: {}".format(len(license.Msg.Key)))
for key in license.Msg.Key:
if key.Id:
key_id = key.Id
else:
key_id = wv_proto2.License.KeyContainer.KeyType.Name(key.Type).encode('utf-8')
encrypted_key = key.Key
iv = key.Iv
type = wv_proto2.License.KeyContainer.KeyType.Name(key.Type)
cipher = AES.new(session.derived_keys['enc'], AES.MODE_CBC, iv=iv)
decrypted_key = cipher.decrypt(encrypted_key)
self.logger.debug(Padding.unpad(decrypted_key, 16))
if type == "OPERATOR_SESSION":
permissions = []
perms = key._OperatorSessionKeyPermissions
for (descriptor, value) in perms.ListFields():
if value == 1:
permissions.append(descriptor.name)
print(permissions)
else:
permissions = []
session.keys.append(Key(key_id, type, Padding.unpad(decrypted_key, 16), permissions))
self.logger.info("decrypted all keys")
return 0
def get_keys(self, session_id):
if session_id in self.sessions:
return self.sessions[session_id].keys
else:
self.logger.error("session not found")
return 1
| 13,315 | Python | .py | 301 | 40.458472 | 122 | 0.749884 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,324 | key.py | Bbalduzz_phantomplus/pywidevine/cdm/key.py | import binascii
class Key:
def __init__(self, kid, type, key, permissions=[]):
self.kid = kid
self.type = type
self.key = key
self.permissions = permissions
def __repr__(self):
if self.type == "OPERATOR_SESSION":
return "key(kid={}, type={}, key={}, permissions={})".format(self.kid, self.type, binascii.hexlify(self.key), self.permissions)
else:
return "key(kid={}, type={}, key={})".format(self.kid, self.type, binascii.hexlify(self.key))
| 521 | Python | .py | 12 | 35.75 | 138 | 0.595661 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,325 | vmp.py | Bbalduzz_phantomplus/pywidevine/cdm/vmp.py | try:
from google.protobuf.internal.decoder import _DecodeVarint as _di # this was tested to work with protobuf 3, but it's an internal API (any varint decoder might work)
except ImportError:
# this is generic and does not depend on pb internals, however it will decode "larger" possible numbers than pb decoder which has them fixed
def LEB128_decode(buffer, pos, limit = 64):
result = 0
shift = 0
while True:
b = buffer[pos]
pos += 1
result |= ((b & 0x7F) << shift)
if not (b & 0x80):
return (result, pos)
shift += 7
if shift > limit:
raise Exception("integer too large, shift: {}".format(shift))
_di = LEB128_decode
class FromFileMixin:
@classmethod
def from_file(cls, filename):
"""Load given a filename"""
with open(filename,"rb") as f:
return cls(f.read())
# the signatures use a format internally similar to
# protobuf's encoding, but without wire types
class VariableReader(FromFileMixin):
"""Protobuf-like encoding reader"""
def __init__(self, buf):
self.buf = buf
self.pos = 0
self.size = len(buf)
def read_int(self):
"""Read a variable length integer"""
# _DecodeVarint will take care of out of range errors
(val, nextpos) = _di(self.buf, self.pos)
self.pos = nextpos
return val
def read_bytes_raw(self, size):
"""Read size bytes"""
b = self.buf[self.pos:self.pos+size]
self.pos += size
return b
def read_bytes(self):
"""Read a bytes object"""
size = self.read_int()
return self.read_bytes_raw(size)
def is_end(self):
return (self.size == self.pos)
class TaggedReader(VariableReader):
"""Tagged reader, needed for implementing a WideVine signature reader"""
def read_tag(self):
"""Read a tagged buffer"""
return (self.read_int(), self.read_bytes())
def read_all_tags(self, max_tag=3):
tags = {}
while (not self.is_end()):
(tag, bytes) = self.read_tag()
if (tag > max_tag):
raise IndexError("tag out of bound: got {}, max {}".format(tag, max_tag))
tags[tag] = bytes
return tags
class WideVineSignatureReader(FromFileMixin):
"""Parses a widevine .sig signature file."""
SIGNER_TAG = 1
SIGNATURE_TAG = 2
ISMAINEXE_TAG = 3
def __init__(self, buf):
reader = TaggedReader(buf)
self.version = reader.read_int()
if (self.version != 0):
raise Exception("Unsupported signature format version {}".format(self.version))
self.tags = reader.read_all_tags()
self.signer = self.tags[self.SIGNER_TAG]
self.signature = self.tags[self.SIGNATURE_TAG]
extra = self.tags[self.ISMAINEXE_TAG]
if (len(extra) != 1 or (extra[0] > 1)):
raise Exception("Unexpected 'ismainexe' field value (not '\\x00' or '\\x01'), please check: {0}".format(extra))
self.mainexe = bool(extra[0])
@classmethod
def get_tags(cls, filename):
"""Return a dictionary of each tag in the signature file"""
return cls.from_file(filename).tags
| 3,075 | Python | .py | 82 | 31.902439 | 167 | 0.653729 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,326 | session.py | Bbalduzz_phantomplus/pywidevine/cdm/session.py | class Session:
def __init__(self, session_id, init_data, device_config, offline):
self.session_id = session_id
self.init_data = init_data
self.offline = offline
self.device_config = device_config
self.device_key = None
self.session_key = None
self.derived_keys = {
'enc': None,
'auth_1': None,
'auth_2': None
}
self.license_request = None
self.license = None
self.service_certificate = None
self.privacy_mode = False
self.keys = []
| 576 | Python | .py | 18 | 23 | 70 | 0.560932 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,327 | deviceconfig.py | Bbalduzz_phantomplus/pywidevine/cdm/deviceconfig.py | import os
private_l3_cdm = {
'name': 'private_l3_cdm',
'description': 'Pixel 6 firmware Pie',
'security_level': 3,
'session_id_type': 'android',
'private_key_available': True,
'vmp': False,
'send_key_control_nonce': True,
}
devices_available = [private_l3_cdm]
FILES_FOLDER = 'devices'
class DeviceConfig:
def __init__(self, device):
self.parent_dir = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'])
self.device_name = device['name']
self.description = device['description']
self.security_level = device['security_level']
self.session_id_type = device['session_id_type']
self.private_key_available = device['private_key_available']
self.vmp = device['vmp']
self.send_key_control_nonce = device['send_key_control_nonce']
if 'keybox_filename' in device:
self.keybox_filename = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'], device['keybox_filename'])
else:
self.keybox_filename = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'], 'keybox')
if 'device_cert_filename' in device:
self.device_cert_filename = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'], device['device_cert_filename'])
else:
self.device_cert_filename = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'], 'device_cert')
if 'device_private_key_filename' in device:
self.device_private_key_filename = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'], device['device_private_key_filename'])
else:
self.device_private_key_filename = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'], 'device_private_key')
if 'device_client_id_blob_filename' in device:
self.device_client_id_blob_filename = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'], device['device_client_id_blob_filename'])
else:
self.device_client_id_blob_filename = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'], 'device_client_id_blob')
if 'device_vmp_blob_filename' in device:
self.device_vmp_blob_filename = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'], device['device_vmp_blob_filename'])
else:
self.device_vmp_blob_filename = os.path.join(os.path.dirname(__file__), FILES_FOLDER, device['name'], 'device_vmp_blob')
def __repr__(self):
return "DeviceConfig(name={}, description={}, security_level={}, session_id_type={}, private_key_available={}, vmp={})".format(self.device_name, self.description, self.security_level, self.session_id_type, self.private_key_available, self.vmp)
| 2,834 | Python | .py | 44 | 56.181818 | 251 | 0.654317 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,328 | wv_proto2_pb2.py | Bbalduzz_phantomplus/pywidevine/cdm/formats/wv_proto2_pb2.py | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pywidevine/cdm/formats/wv_proto2.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='pywidevine/cdm/formats/wv_proto2.proto',
package='',
syntax='proto2',
serialized_pb=_b('\n&pywidevine/cdm/formats/wv_proto2.proto\"\xe7\x05\n\x14\x43lientIdentification\x12-\n\x04Type\x18\x01 \x02(\x0e\x32\x1f.ClientIdentification.TokenType\x12\'\n\x05Token\x18\x02 \x01(\x0b\x32\x18.SignedDeviceCertificate\x12\x33\n\nClientInfo\x18\x03 \x03(\x0b\x32\x1f.ClientIdentification.NameValue\x12\x1b\n\x13ProviderClientToken\x18\x04 \x01(\x0c\x12\x16\n\x0eLicenseCounter\x18\x05 \x01(\r\x12\x45\n\x13_ClientCapabilities\x18\x06 \x01(\x0b\x32(.ClientIdentification.ClientCapabilities\x12 \n\x0b_FileHashes\x18\x07 \x01(\x0b\x32\x0b.FileHashes\x1a(\n\tNameValue\x12\x0c\n\x04Name\x18\x01 \x02(\t\x12\r\n\x05Value\x18\x02 \x02(\t\x1a\xa4\x02\n\x12\x43lientCapabilities\x12\x13\n\x0b\x43lientToken\x18\x01 \x01(\r\x12\x14\n\x0cSessionToken\x18\x02 \x01(\r\x12\"\n\x1aVideoResolutionConstraints\x18\x03 \x01(\r\x12L\n\x0eMaxHdcpVersion\x18\x04 \x01(\x0e\x32\x34.ClientIdentification.ClientCapabilities.HdcpVersion\x12\x1b\n\x13OemCryptoApiVersion\x18\x05 \x01(\r\"T\n\x0bHdcpVersion\x12\r\n\tHDCP_NONE\x10\x00\x12\x0b\n\x07HDCP_V1\x10\x01\x12\x0b\n\x07HDCP_V2\x10\x02\x12\r\n\tHDCP_V2_1\x10\x03\x12\r\n\tHDCP_V2_2\x10\x04\"S\n\tTokenType\x12\n\n\x06KEYBOX\x10\x00\x12\x16\n\x12\x44\x45VICE_CERTIFICATE\x10\x01\x12\"\n\x1eREMOTE_ATTESTATION_CERTIFICATE\x10\x02\"\x9b\x02\n\x11\x44\x65viceCertificate\x12\x30\n\x04Type\x18\x01 \x02(\x0e\x32\".DeviceCertificate.CertificateType\x12\x14\n\x0cSerialNumber\x18\x02 \x01(\x0c\x12\x1b\n\x13\x43reationTimeSeconds\x18\x03 \x01(\r\x12\x11\n\tPublicKey\x18\x04 \x01(\x0c\x12\x10\n\x08SystemId\x18\x05 \x01(\r\x12\x1c\n\x14TestDeviceDeprecated\x18\x06 \x01(\r\x12\x11\n\tServiceId\x18\x07 \x01(\x0c\"K\n\x0f\x43\x65rtificateType\x12\x08\n\x04ROOT\x10\x00\x12\x10\n\x0cINTERMEDIATE\x10\x01\x12\x0f\n\x0bUSER_DEVICE\x10\x02\x12\x0b\n\x07SERVICE\x10\x03\"\xc4\x01\n\x17\x44\x65viceCertificateStatus\x12\x14\n\x0cSerialNumber\x18\x01 \x01(\x0c\x12:\n\x06Status\x18\x02 \x01(\x0e\x32*.DeviceCertificateStatus.CertificateStatus\x12*\n\nDeviceInfo\x18\x04 \x01(\x0b\x32\x16.ProvisionedDeviceInfo\"+\n\x11\x43\x65rtificateStatus\x12\t\n\x05VALID\x10\x00\x12\x0b\n\x07REVOKED\x10\x01\"o\n\x1b\x44\x65viceCertificateStatusList\x12\x1b\n\x13\x43reationTimeSeconds\x18\x01 \x01(\r\x12\x33\n\x11\x43\x65rtificateStatus\x18\x02 \x03(\x0b\x32\x18.DeviceCertificateStatus\"\xaf\x01\n\x1d\x45ncryptedClientIdentification\x12\x11\n\tServiceId\x18\x01 \x02(\t\x12&\n\x1eServiceCertificateSerialNumber\x18\x02 \x01(\x0c\x12\x19\n\x11\x45ncryptedClientId\x18\x03 \x02(\x0c\x12\x1b\n\x13\x45ncryptedClientIdIv\x18\x04 \x02(\x0c\x12\x1b\n\x13\x45ncryptedPrivacyKey\x18\x05 \x02(\x0c\"\x9c\x01\n\x15LicenseIdentification\x12\x11\n\tRequestId\x18\x01 \x01(\x0c\x12\x11\n\tSessionId\x18\x02 \x01(\x0c\x12\x12\n\nPurchaseId\x18\x03 \x01(\x0c\x12\x1a\n\x04Type\x18\x04 \x01(\x0e\x32\x0c.LicenseType\x12\x0f\n\x07Version\x18\x05 \x01(\r\x12\x1c\n\x14ProviderSessionToken\x18\x06 \x01(\x0c\"\xa1\x0e\n\x07License\x12\"\n\x02Id\x18\x01 \x01(\x0b\x32\x16.LicenseIdentification\x12 \n\x07_Policy\x18\x02 \x01(\x0b\x32\x0f.License.Policy\x12\"\n\x03Key\x18\x03 \x03(\x0b\x32\x15.License.KeyContainer\x12\x18\n\x10LicenseStartTime\x18\x04 \x01(\r\x12!\n\x19RemoteAttestationVerified\x18\x05 \x01(\r\x12\x1b\n\x13ProviderClientToken\x18\x06 \x01(\x0c\x12\x18\n\x10ProtectionScheme\x18\x07 \x01(\r\x1a\xbb\x02\n\x06Policy\x12\x0f\n\x07\x43\x61nPlay\x18\x01 \x01(\x08\x12\x12\n\nCanPersist\x18\x02 \x01(\x08\x12\x10\n\x08\x43\x61nRenew\x18\x03 \x01(\x08\x12\x1d\n\x15RentalDurationSeconds\x18\x04 \x01(\r\x12\x1f\n\x17PlaybackDurationSeconds\x18\x05 \x01(\r\x12\x1e\n\x16LicenseDurationSeconds\x18\x06 \x01(\r\x12&\n\x1eRenewalRecoveryDurationSeconds\x18\x07 \x01(\r\x12\x18\n\x10RenewalServerUrl\x18\x08 \x01(\t\x12\x1b\n\x13RenewalDelaySeconds\x18\t \x01(\r\x12#\n\x1bRenewalRetryIntervalSeconds\x18\n \x01(\r\x12\x16\n\x0eRenewWithUsage\x18\x0b \x01(\x08\x1a\xf9\t\n\x0cKeyContainer\x12\n\n\x02Id\x18\x01 \x01(\x0c\x12\n\n\x02Iv\x18\x02 \x01(\x0c\x12\x0b\n\x03Key\x18\x03 \x01(\x0c\x12+\n\x04Type\x18\x04 \x01(\x0e\x32\x1d.License.KeyContainer.KeyType\x12\x32\n\x05Level\x18\x05 \x01(\x0e\x32#.License.KeyContainer.SecurityLevel\x12\x42\n\x12RequiredProtection\x18\x06 \x01(\x0b\x32&.License.KeyContainer.OutputProtection\x12\x43\n\x13RequestedProtection\x18\x07 \x01(\x0b\x32&.License.KeyContainer.OutputProtection\x12\x35\n\x0b_KeyControl\x18\x08 \x01(\x0b\x32 .License.KeyContainer.KeyControl\x12[\n\x1e_OperatorSessionKeyPermissions\x18\t \x01(\x0b\x32\x33.License.KeyContainer.OperatorSessionKeyPermissions\x12S\n\x1aVideoResolutionConstraints\x18\n \x03(\x0b\x32/.License.KeyContainer.VideoResolutionConstraint\x1a\xdb\x01\n\x10OutputProtection\x12\x42\n\x04Hdcp\x18\x01 \x01(\x0e\x32\x34.ClientIdentification.ClientCapabilities.HdcpVersion\x12>\n\tCgmsFlags\x18\x02 \x01(\x0e\x32+.License.KeyContainer.OutputProtection.CGMS\"C\n\x04\x43GMS\x12\r\n\tCOPY_FREE\x10\x00\x12\r\n\tCOPY_ONCE\x10\x02\x12\x0e\n\nCOPY_NEVER\x10\x03\x12\r\n\tCGMS_NONE\x10*\x1a\x31\n\nKeyControl\x12\x17\n\x0fKeyControlBlock\x18\x01 \x02(\x0c\x12\n\n\x02Iv\x18\x02 \x02(\x0c\x1a|\n\x1dOperatorSessionKeyPermissions\x12\x14\n\x0c\x41llowEncrypt\x18\x01 \x01(\r\x12\x14\n\x0c\x41llowDecrypt\x18\x02 \x01(\r\x12\x11\n\tAllowSign\x18\x03 \x01(\r\x12\x1c\n\x14\x41llowSignatureVerify\x18\x04 \x01(\r\x1a\x99\x01\n\x19VideoResolutionConstraint\x12\x1b\n\x13MinResolutionPixels\x18\x01 \x01(\r\x12\x1b\n\x13MaxResolutionPixels\x18\x02 \x01(\r\x12\x42\n\x12RequiredProtection\x18\x03 \x01(\x0b\x32&.License.KeyContainer.OutputProtection\"J\n\x07KeyType\x12\x0b\n\x07SIGNING\x10\x01\x12\x0b\n\x07\x43ONTENT\x10\x02\x12\x0f\n\x0bKEY_CONTROL\x10\x03\x12\x14\n\x10OPERATOR_SESSION\x10\x04\"z\n\rSecurityLevel\x12\x14\n\x10SW_SECURE_CRYPTO\x10\x01\x12\x14\n\x10SW_SECURE_DECODE\x10\x02\x12\x14\n\x10HW_SECURE_CRYPTO\x10\x03\x12\x14\n\x10HW_SECURE_DECODE\x10\x04\x12\x11\n\rHW_SECURE_ALL\x10\x05\"\x98\x01\n\x0cLicenseError\x12&\n\tErrorCode\x18\x01 \x01(\x0e\x32\x13.LicenseError.Error\"`\n\x05\x45rror\x12\x1e\n\x1aINVALID_DEVICE_CERTIFICATE\x10\x01\x12\x1e\n\x1aREVOKED_DEVICE_CERTIFICATE\x10\x02\x12\x17\n\x13SERVICE_UNAVAILABLE\x10\x03\"\xac\x07\n\x0eLicenseRequest\x12\'\n\x08\x43lientId\x18\x01 \x01(\x0b\x32\x15.ClientIdentification\x12\x38\n\tContentId\x18\x02 \x01(\x0b\x32%.LicenseRequest.ContentIdentification\x12)\n\x04Type\x18\x03 \x01(\x0e\x32\x1b.LicenseRequest.RequestType\x12\x13\n\x0bRequestTime\x18\x04 \x01(\r\x12!\n\x19KeyControlNonceDeprecated\x18\x05 \x01(\x0c\x12)\n\x0fProtocolVersion\x18\x06 \x01(\x0e\x32\x10.ProtocolVersion\x12\x17\n\x0fKeyControlNonce\x18\x07 \x01(\r\x12\x39\n\x11\x45ncryptedClientId\x18\x08 \x01(\x0b\x32\x1e.EncryptedClientIdentification\x1a\xa2\x04\n\x15\x43ontentIdentification\x12:\n\x06\x43\x65ncId\x18\x01 \x01(\x0b\x32*.LicenseRequest.ContentIdentification.CENC\x12:\n\x06WebmId\x18\x02 \x01(\x0b\x32*.LicenseRequest.ContentIdentification.WebM\x12\x46\n\x07License\x18\x03 \x01(\x0b\x32\x35.LicenseRequest.ContentIdentification.ExistingLicense\x1a_\n\x04\x43\x45NC\x12!\n\x04Pssh\x18\x01 \x01(\x0b\x32\x13.WidevineCencHeader\x12!\n\x0bLicenseType\x18\x02 \x01(\x0e\x32\x0c.LicenseType\x12\x11\n\tRequestId\x18\x03 \x01(\x0c\x1aL\n\x04WebM\x12\x0e\n\x06Header\x18\x01 \x01(\x0c\x12!\n\x0bLicenseType\x18\x02 \x01(\x0e\x32\x0c.LicenseType\x12\x11\n\tRequestId\x18\x03 \x01(\x0c\x1a\x99\x01\n\x0f\x45xistingLicense\x12)\n\tLicenseId\x18\x01 \x01(\x0b\x32\x16.LicenseIdentification\x12\x1b\n\x13SecondsSinceStarted\x18\x02 \x01(\r\x12\x1e\n\x16SecondsSinceLastPlayed\x18\x03 \x01(\r\x12\x1e\n\x16SessionUsageTableEntry\x18\x04 \x01(\x0c\"0\n\x0bRequestType\x12\x07\n\x03NEW\x10\x01\x12\x0b\n\x07RENEWAL\x10\x02\x12\x0b\n\x07RELEASE\x10\x03\"\xa9\x07\n\x11LicenseRequestRaw\x12\'\n\x08\x43lientId\x18\x01 \x01(\x0b\x32\x15.ClientIdentification\x12;\n\tContentId\x18\x02 \x01(\x0b\x32(.LicenseRequestRaw.ContentIdentification\x12,\n\x04Type\x18\x03 \x01(\x0e\x32\x1e.LicenseRequestRaw.RequestType\x12\x13\n\x0bRequestTime\x18\x04 \x01(\r\x12!\n\x19KeyControlNonceDeprecated\x18\x05 \x01(\x0c\x12)\n\x0fProtocolVersion\x18\x06 \x01(\x0e\x32\x10.ProtocolVersion\x12\x17\n\x0fKeyControlNonce\x18\x07 \x01(\r\x12\x39\n\x11\x45ncryptedClientId\x18\x08 \x01(\x0b\x32\x1e.EncryptedClientIdentification\x1a\x96\x04\n\x15\x43ontentIdentification\x12=\n\x06\x43\x65ncId\x18\x01 \x01(\x0b\x32-.LicenseRequestRaw.ContentIdentification.CENC\x12=\n\x06WebmId\x18\x02 \x01(\x0b\x32-.LicenseRequestRaw.ContentIdentification.WebM\x12I\n\x07License\x18\x03 \x01(\x0b\x32\x38.LicenseRequestRaw.ContentIdentification.ExistingLicense\x1aJ\n\x04\x43\x45NC\x12\x0c\n\x04Pssh\x18\x01 \x01(\x0c\x12!\n\x0bLicenseType\x18\x02 \x01(\x0e\x32\x0c.LicenseType\x12\x11\n\tRequestId\x18\x03 \x01(\x0c\x1aL\n\x04WebM\x12\x0e\n\x06Header\x18\x01 \x01(\x0c\x12!\n\x0bLicenseType\x18\x02 \x01(\x0e\x32\x0c.LicenseType\x12\x11\n\tRequestId\x18\x03 \x01(\x0c\x1a\x99\x01\n\x0f\x45xistingLicense\x12)\n\tLicenseId\x18\x01 \x01(\x0b\x32\x16.LicenseIdentification\x12\x1b\n\x13SecondsSinceStarted\x18\x02 \x01(\r\x12\x1e\n\x16SecondsSinceLastPlayed\x18\x03 \x01(\r\x12\x1e\n\x16SessionUsageTableEntry\x18\x04 \x01(\x0c\"0\n\x0bRequestType\x12\x07\n\x03NEW\x10\x01\x12\x0b\n\x07RENEWAL\x10\x02\x12\x0b\n\x07RELEASE\x10\x03\"\xa6\x02\n\x15ProvisionedDeviceInfo\x12\x10\n\x08SystemId\x18\x01 \x01(\r\x12\x0b\n\x03Soc\x18\x02 \x01(\t\x12\x14\n\x0cManufacturer\x18\x03 \x01(\t\x12\r\n\x05Model\x18\x04 \x01(\t\x12\x12\n\nDeviceType\x18\x05 \x01(\t\x12\x11\n\tModelYear\x18\x06 \x01(\r\x12=\n\rSecurityLevel\x18\x07 \x01(\x0e\x32&.ProvisionedDeviceInfo.WvSecurityLevel\x12\x12\n\nTestDevice\x18\x08 \x01(\r\"O\n\x0fWvSecurityLevel\x12\x15\n\x11LEVEL_UNSPECIFIED\x10\x00\x12\x0b\n\x07LEVEL_1\x10\x01\x12\x0b\n\x07LEVEL_2\x10\x02\x12\x0b\n\x07LEVEL_3\x10\x03\"\x15\n\x13ProvisioningOptions\"\x15\n\x13ProvisioningRequest\"\x16\n\x14ProvisioningResponse\"i\n\x11RemoteAttestation\x12\x33\n\x0b\x43\x65rtificate\x18\x01 \x01(\x0b\x32\x1e.EncryptedClientIdentification\x12\x0c\n\x04Salt\x18\x02 \x01(\t\x12\x11\n\tSignature\x18\x03 \x01(\t\"\r\n\x0bSessionInit\"\x0e\n\x0cSessionState\"\x1d\n\x1bSignedCertificateStatusList\"\x86\x01\n\x17SignedDeviceCertificate\x12.\n\x12_DeviceCertificate\x18\x01 \x01(\x0b\x32\x12.DeviceCertificate\x12\x11\n\tSignature\x18\x02 \x01(\x0c\x12(\n\x06Signer\x18\x03 \x01(\x0b\x32\x18.SignedDeviceCertificate\"\x1b\n\x19SignedProvisioningMessage\"\x9b\x02\n\rSignedMessage\x12(\n\x04Type\x18\x01 \x01(\x0e\x32\x1a.SignedMessage.MessageType\x12\x0b\n\x03Msg\x18\x02 \x01(\x0c\x12\x11\n\tSignature\x18\x03 \x01(\x0c\x12\x12\n\nSessionKey\x18\x04 \x01(\x0c\x12-\n\x11RemoteAttestation\x18\x05 \x01(\x0b\x32\x12.RemoteAttestation\"}\n\x0bMessageType\x12\x13\n\x0fLICENSE_REQUEST\x10\x01\x12\x0b\n\x07LICENSE\x10\x02\x12\x12\n\x0e\x45RROR_RESPONSE\x10\x03\x12\x1f\n\x1bSERVICE_CERTIFICATE_REQUEST\x10\x04\x12\x17\n\x13SERVICE_CERTIFICATE\x10\x05\"\xc5\x02\n\x12WidevineCencHeader\x12\x30\n\talgorithm\x18\x01 \x01(\x0e\x32\x1d.WidevineCencHeader.Algorithm\x12\x0e\n\x06key_id\x18\x02 \x03(\x0c\x12\x10\n\x08provider\x18\x03 \x01(\t\x12\x12\n\ncontent_id\x18\x04 \x01(\x0c\x12\x1d\n\x15track_type_deprecated\x18\x05 \x01(\t\x12\x0e\n\x06policy\x18\x06 \x01(\t\x12\x1b\n\x13\x63rypto_period_index\x18\x07 \x01(\r\x12\x17\n\x0fgrouped_license\x18\x08 \x01(\x0c\x12\x19\n\x11protection_scheme\x18\t \x01(\r\x12\x1d\n\x15\x63rypto_period_seconds\x18\n \x01(\r\"(\n\tAlgorithm\x12\x0f\n\x0bUNENCRYPTED\x10\x00\x12\n\n\x06\x41\x45SCTR\x10\x01\"\xba\x02\n\x14SignedLicenseRequest\x12/\n\x04Type\x18\x01 \x01(\x0e\x32!.SignedLicenseRequest.MessageType\x12\x1c\n\x03Msg\x18\x02 \x01(\x0b\x32\x0f.LicenseRequest\x12\x11\n\tSignature\x18\x03 \x01(\x0c\x12\x12\n\nSessionKey\x18\x04 \x01(\x0c\x12-\n\x11RemoteAttestation\x18\x05 \x01(\x0b\x32\x12.RemoteAttestation\"}\n\x0bMessageType\x12\x13\n\x0fLICENSE_REQUEST\x10\x01\x12\x0b\n\x07LICENSE\x10\x02\x12\x12\n\x0e\x45RROR_RESPONSE\x10\x03\x12\x1f\n\x1bSERVICE_CERTIFICATE_REQUEST\x10\x04\x12\x17\n\x13SERVICE_CERTIFICATE\x10\x05\"\xc3\x02\n\x17SignedLicenseRequestRaw\x12\x32\n\x04Type\x18\x01 \x01(\x0e\x32$.SignedLicenseRequestRaw.MessageType\x12\x1f\n\x03Msg\x18\x02 \x01(\x0b\x32\x12.LicenseRequestRaw\x12\x11\n\tSignature\x18\x03 \x01(\x0c\x12\x12\n\nSessionKey\x18\x04 \x01(\x0c\x12-\n\x11RemoteAttestation\x18\x05 \x01(\x0b\x32\x12.RemoteAttestation\"}\n\x0bMessageType\x12\x13\n\x0fLICENSE_REQUEST\x10\x01\x12\x0b\n\x07LICENSE\x10\x02\x12\x12\n\x0e\x45RROR_RESPONSE\x10\x03\x12\x1f\n\x1bSERVICE_CERTIFICATE_REQUEST\x10\x04\x12\x17\n\x13SERVICE_CERTIFICATE\x10\x05\"\xa5\x02\n\rSignedLicense\x12(\n\x04Type\x18\x01 \x01(\x0e\x32\x1a.SignedLicense.MessageType\x12\x15\n\x03Msg\x18\x02 \x01(\x0b\x32\x08.License\x12\x11\n\tSignature\x18\x03 \x01(\x0c\x12\x12\n\nSessionKey\x18\x04 \x01(\x0c\x12-\n\x11RemoteAttestation\x18\x05 \x01(\x0b\x32\x12.RemoteAttestation\"}\n\x0bMessageType\x12\x13\n\x0fLICENSE_REQUEST\x10\x01\x12\x0b\n\x07LICENSE\x10\x02\x12\x12\n\x0e\x45RROR_RESPONSE\x10\x03\x12\x1f\n\x1bSERVICE_CERTIFICATE_REQUEST\x10\x04\x12\x17\n\x13SERVICE_CERTIFICATE\x10\x05\"\xcb\x02\n\x18SignedServiceCertificate\x12\x33\n\x04Type\x18\x01 \x01(\x0e\x32%.SignedServiceCertificate.MessageType\x12%\n\x03Msg\x18\x02 \x01(\x0b\x32\x18.SignedDeviceCertificate\x12\x11\n\tSignature\x18\x03 \x01(\x0c\x12\x12\n\nSessionKey\x18\x04 \x01(\x0c\x12-\n\x11RemoteAttestation\x18\x05 \x01(\x0b\x32\x12.RemoteAttestation\"}\n\x0bMessageType\x12\x13\n\x0fLICENSE_REQUEST\x10\x01\x12\x0b\n\x07LICENSE\x10\x02\x12\x12\n\x0e\x45RROR_RESPONSE\x10\x03\x12\x1f\n\x1bSERVICE_CERTIFICATE_REQUEST\x10\x04\x12\x17\n\x13SERVICE_CERTIFICATE\x10\x05\"\xb5\x01\n\nFileHashes\x12\x0e\n\x06signer\x18\x01 \x01(\x0c\x12)\n\nsignatures\x18\x02 \x03(\x0b\x32\x15.FileHashes.Signature\x1al\n\tSignature\x12\x10\n\x08\x66ilename\x18\x01 \x01(\t\x12\x14\n\x0ctest_signing\x18\x02 \x01(\x08\x12\x12\n\nSHA512Hash\x18\x03 \x01(\x0c\x12\x10\n\x08main_exe\x18\x04 \x01(\x08\x12\x11\n\tsignature\x18\x05 \x01(\x0c*1\n\x0bLicenseType\x12\x08\n\x04ZERO\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02*\x1e\n\x0fProtocolVersion\x12\x0b\n\x07\x43URRENT\x10\x15')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_LICENSETYPE = _descriptor.EnumDescriptor(
name='LicenseType',
full_name='LicenseType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='ZERO', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='DEFAULT', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='OFFLINE', index=2, number=2,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=8362,
serialized_end=8411,
)
_sym_db.RegisterEnumDescriptor(_LICENSETYPE)
LicenseType = enum_type_wrapper.EnumTypeWrapper(_LICENSETYPE)
_PROTOCOLVERSION = _descriptor.EnumDescriptor(
name='ProtocolVersion',
full_name='ProtocolVersion',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='CURRENT', index=0, number=21,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=8413,
serialized_end=8443,
)
_sym_db.RegisterEnumDescriptor(_PROTOCOLVERSION)
ProtocolVersion = enum_type_wrapper.EnumTypeWrapper(_PROTOCOLVERSION)
ZERO = 0
DEFAULT = 1
OFFLINE = 2
CURRENT = 21
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION = _descriptor.EnumDescriptor(
name='HdcpVersion',
full_name='ClientIdentification.ClientCapabilities.HdcpVersion',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='HDCP_NONE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HDCP_V1', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HDCP_V2', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HDCP_V2_1', index=3, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HDCP_V2_2', index=4, number=4,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=617,
serialized_end=701,
)
_sym_db.RegisterEnumDescriptor(_CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION)
_CLIENTIDENTIFICATION_TOKENTYPE = _descriptor.EnumDescriptor(
name='TokenType',
full_name='ClientIdentification.TokenType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='KEYBOX', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='DEVICE_CERTIFICATE', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='REMOTE_ATTESTATION_CERTIFICATE', index=2, number=2,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=703,
serialized_end=786,
)
_sym_db.RegisterEnumDescriptor(_CLIENTIDENTIFICATION_TOKENTYPE)
_DEVICECERTIFICATE_CERTIFICATETYPE = _descriptor.EnumDescriptor(
name='CertificateType',
full_name='DeviceCertificate.CertificateType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='ROOT', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='INTERMEDIATE', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='USER_DEVICE', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE', index=3, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=997,
serialized_end=1072,
)
_sym_db.RegisterEnumDescriptor(_DEVICECERTIFICATE_CERTIFICATETYPE)
_DEVICECERTIFICATESTATUS_CERTIFICATESTATUS = _descriptor.EnumDescriptor(
name='CertificateStatus',
full_name='DeviceCertificateStatus.CertificateStatus',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='VALID', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='REVOKED', index=1, number=1,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=1228,
serialized_end=1271,
)
_sym_db.RegisterEnumDescriptor(_DEVICECERTIFICATESTATUS_CERTIFICATESTATUS)
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION_CGMS = _descriptor.EnumDescriptor(
name='CGMS',
full_name='License.KeyContainer.OutputProtection.CGMS',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='COPY_FREE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='COPY_ONCE', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='COPY_NEVER', index=2, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CGMS_NONE', index=3, number=42,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=2949,
serialized_end=3016,
)
_sym_db.RegisterEnumDescriptor(_LICENSE_KEYCONTAINER_OUTPUTPROTECTION_CGMS)
_LICENSE_KEYCONTAINER_KEYTYPE = _descriptor.EnumDescriptor(
name='KeyType',
full_name='License.KeyContainer.KeyType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='SIGNING', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CONTENT', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='KEY_CONTROL', index=2, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='OPERATOR_SESSION', index=3, number=4,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=3351,
serialized_end=3425,
)
_sym_db.RegisterEnumDescriptor(_LICENSE_KEYCONTAINER_KEYTYPE)
_LICENSE_KEYCONTAINER_SECURITYLEVEL = _descriptor.EnumDescriptor(
name='SecurityLevel',
full_name='License.KeyContainer.SecurityLevel',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='SW_SECURE_CRYPTO', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SW_SECURE_DECODE', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HW_SECURE_CRYPTO', index=2, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HW_SECURE_DECODE', index=3, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HW_SECURE_ALL', index=4, number=5,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=3427,
serialized_end=3549,
)
_sym_db.RegisterEnumDescriptor(_LICENSE_KEYCONTAINER_SECURITYLEVEL)
_LICENSEERROR_ERROR = _descriptor.EnumDescriptor(
name='Error',
full_name='LicenseError.Error',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='INVALID_DEVICE_CERTIFICATE', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='REVOKED_DEVICE_CERTIFICATE', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_UNAVAILABLE', index=2, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=3608,
serialized_end=3704,
)
_sym_db.RegisterEnumDescriptor(_LICENSEERROR_ERROR)
_LICENSEREQUEST_REQUESTTYPE = _descriptor.EnumDescriptor(
name='RequestType',
full_name='LicenseRequest.RequestType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='NEW', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='RENEWAL', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='RELEASE', index=2, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=4599,
serialized_end=4647,
)
_sym_db.RegisterEnumDescriptor(_LICENSEREQUEST_REQUESTTYPE)
_LICENSEREQUESTRAW_REQUESTTYPE = _descriptor.EnumDescriptor(
name='RequestType',
full_name='LicenseRequestRaw.RequestType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='NEW', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='RENEWAL', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='RELEASE', index=2, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=4599,
serialized_end=4647,
)
_sym_db.RegisterEnumDescriptor(_LICENSEREQUESTRAW_REQUESTTYPE)
_PROVISIONEDDEVICEINFO_WVSECURITYLEVEL = _descriptor.EnumDescriptor(
name='WvSecurityLevel',
full_name='ProvisionedDeviceInfo.WvSecurityLevel',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='LEVEL_UNSPECIFIED', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LEVEL_1', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LEVEL_2', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LEVEL_3', index=3, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=5805,
serialized_end=5884,
)
_sym_db.RegisterEnumDescriptor(_PROVISIONEDDEVICEINFO_WVSECURITYLEVEL)
_SIGNEDMESSAGE_MESSAGETYPE = _descriptor.EnumDescriptor(
name='MessageType',
full_name='SignedMessage.MessageType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='LICENSE_REQUEST', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ERROR_RESPONSE', index=2, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE_REQUEST', index=3, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE', index=4, number=5,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=6450,
serialized_end=6575,
)
_sym_db.RegisterEnumDescriptor(_SIGNEDMESSAGE_MESSAGETYPE)
_WIDEVINECENCHEADER_ALGORITHM = _descriptor.EnumDescriptor(
name='Algorithm',
full_name='WidevineCencHeader.Algorithm',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='UNENCRYPTED', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='AESCTR', index=1, number=1,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=6863,
serialized_end=6903,
)
_sym_db.RegisterEnumDescriptor(_WIDEVINECENCHEADER_ALGORITHM)
_SIGNEDLICENSEREQUEST_MESSAGETYPE = _descriptor.EnumDescriptor(
name='MessageType',
full_name='SignedLicenseRequest.MessageType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='LICENSE_REQUEST', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ERROR_RESPONSE', index=2, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE_REQUEST', index=3, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE', index=4, number=5,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=6450,
serialized_end=6575,
)
_sym_db.RegisterEnumDescriptor(_SIGNEDLICENSEREQUEST_MESSAGETYPE)
_SIGNEDLICENSEREQUESTRAW_MESSAGETYPE = _descriptor.EnumDescriptor(
name='MessageType',
full_name='SignedLicenseRequestRaw.MessageType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='LICENSE_REQUEST', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ERROR_RESPONSE', index=2, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE_REQUEST', index=3, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE', index=4, number=5,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=6450,
serialized_end=6575,
)
_sym_db.RegisterEnumDescriptor(_SIGNEDLICENSEREQUESTRAW_MESSAGETYPE)
_SIGNEDLICENSE_MESSAGETYPE = _descriptor.EnumDescriptor(
name='MessageType',
full_name='SignedLicense.MessageType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='LICENSE_REQUEST', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ERROR_RESPONSE', index=2, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE_REQUEST', index=3, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE', index=4, number=5,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=6450,
serialized_end=6575,
)
_sym_db.RegisterEnumDescriptor(_SIGNEDLICENSE_MESSAGETYPE)
_SIGNEDSERVICECERTIFICATE_MESSAGETYPE = _descriptor.EnumDescriptor(
name='MessageType',
full_name='SignedServiceCertificate.MessageType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='LICENSE_REQUEST', index=0, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ERROR_RESPONSE', index=2, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE_REQUEST', index=3, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE', index=4, number=5,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=6450,
serialized_end=6575,
)
_sym_db.RegisterEnumDescriptor(_SIGNEDSERVICECERTIFICATE_MESSAGETYPE)
_CLIENTIDENTIFICATION_NAMEVALUE = _descriptor.Descriptor(
name='NameValue',
full_name='ClientIdentification.NameValue',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Name', full_name='ClientIdentification.NameValue.Name', index=0,
number=1, type=9, cpp_type=9, label=2,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Value', full_name='ClientIdentification.NameValue.Value', index=1,
number=2, type=9, cpp_type=9, label=2,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=366,
serialized_end=406,
)
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES = _descriptor.Descriptor(
name='ClientCapabilities',
full_name='ClientIdentification.ClientCapabilities',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ClientToken', full_name='ClientIdentification.ClientCapabilities.ClientToken', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionToken', full_name='ClientIdentification.ClientCapabilities.SessionToken', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='VideoResolutionConstraints', full_name='ClientIdentification.ClientCapabilities.VideoResolutionConstraints', index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='MaxHdcpVersion', full_name='ClientIdentification.ClientCapabilities.MaxHdcpVersion', index=3,
number=4, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='OemCryptoApiVersion', full_name='ClientIdentification.ClientCapabilities.OemCryptoApiVersion', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=409,
serialized_end=701,
)
_CLIENTIDENTIFICATION = _descriptor.Descriptor(
name='ClientIdentification',
full_name='ClientIdentification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='ClientIdentification.Type', index=0,
number=1, type=14, cpp_type=8, label=2,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Token', full_name='ClientIdentification.Token', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ClientInfo', full_name='ClientIdentification.ClientInfo', index=2,
number=3, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProviderClientToken', full_name='ClientIdentification.ProviderClientToken', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseCounter', full_name='ClientIdentification.LicenseCounter', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='_ClientCapabilities', full_name='ClientIdentification._ClientCapabilities', index=5,
number=6, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='_FileHashes', full_name='ClientIdentification._FileHashes', index=6,
number=7, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_CLIENTIDENTIFICATION_NAMEVALUE, _CLIENTIDENTIFICATION_CLIENTCAPABILITIES, ],
enum_types=[
_CLIENTIDENTIFICATION_TOKENTYPE,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=43,
serialized_end=786,
)
_DEVICECERTIFICATE = _descriptor.Descriptor(
name='DeviceCertificate',
full_name='DeviceCertificate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='DeviceCertificate.Type', index=0,
number=1, type=14, cpp_type=8, label=2,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SerialNumber', full_name='DeviceCertificate.SerialNumber', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='CreationTimeSeconds', full_name='DeviceCertificate.CreationTimeSeconds', index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='PublicKey', full_name='DeviceCertificate.PublicKey', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SystemId', full_name='DeviceCertificate.SystemId', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='TestDeviceDeprecated', full_name='DeviceCertificate.TestDeviceDeprecated', index=5,
number=6, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ServiceId', full_name='DeviceCertificate.ServiceId', index=6,
number=7, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_DEVICECERTIFICATE_CERTIFICATETYPE,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=789,
serialized_end=1072,
)
_DEVICECERTIFICATESTATUS = _descriptor.Descriptor(
name='DeviceCertificateStatus',
full_name='DeviceCertificateStatus',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='SerialNumber', full_name='DeviceCertificateStatus.SerialNumber', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Status', full_name='DeviceCertificateStatus.Status', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='DeviceInfo', full_name='DeviceCertificateStatus.DeviceInfo', index=2,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_DEVICECERTIFICATESTATUS_CERTIFICATESTATUS,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1075,
serialized_end=1271,
)
_DEVICECERTIFICATESTATUSLIST = _descriptor.Descriptor(
name='DeviceCertificateStatusList',
full_name='DeviceCertificateStatusList',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='CreationTimeSeconds', full_name='DeviceCertificateStatusList.CreationTimeSeconds', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='CertificateStatus', full_name='DeviceCertificateStatusList.CertificateStatus', index=1,
number=2, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1273,
serialized_end=1384,
)
_ENCRYPTEDCLIENTIDENTIFICATION = _descriptor.Descriptor(
name='EncryptedClientIdentification',
full_name='EncryptedClientIdentification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ServiceId', full_name='EncryptedClientIdentification.ServiceId', index=0,
number=1, type=9, cpp_type=9, label=2,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ServiceCertificateSerialNumber', full_name='EncryptedClientIdentification.ServiceCertificateSerialNumber', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='EncryptedClientId', full_name='EncryptedClientIdentification.EncryptedClientId', index=2,
number=3, type=12, cpp_type=9, label=2,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='EncryptedClientIdIv', full_name='EncryptedClientIdentification.EncryptedClientIdIv', index=3,
number=4, type=12, cpp_type=9, label=2,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='EncryptedPrivacyKey', full_name='EncryptedClientIdentification.EncryptedPrivacyKey', index=4,
number=5, type=12, cpp_type=9, label=2,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1387,
serialized_end=1562,
)
_LICENSEIDENTIFICATION = _descriptor.Descriptor(
name='LicenseIdentification',
full_name='LicenseIdentification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='RequestId', full_name='LicenseIdentification.RequestId', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionId', full_name='LicenseIdentification.SessionId', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='PurchaseId', full_name='LicenseIdentification.PurchaseId', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Type', full_name='LicenseIdentification.Type', index=3,
number=4, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Version', full_name='LicenseIdentification.Version', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProviderSessionToken', full_name='LicenseIdentification.ProviderSessionToken', index=5,
number=6, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1565,
serialized_end=1721,
)
_LICENSE_POLICY = _descriptor.Descriptor(
name='Policy',
full_name='License.Policy',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='CanPlay', full_name='License.Policy.CanPlay', index=0,
number=1, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='CanPersist', full_name='License.Policy.CanPersist', index=1,
number=2, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='CanRenew', full_name='License.Policy.CanRenew', index=2,
number=3, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RentalDurationSeconds', full_name='License.Policy.RentalDurationSeconds', index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='PlaybackDurationSeconds', full_name='License.Policy.PlaybackDurationSeconds', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseDurationSeconds', full_name='License.Policy.LicenseDurationSeconds', index=5,
number=6, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RenewalRecoveryDurationSeconds', full_name='License.Policy.RenewalRecoveryDurationSeconds', index=6,
number=7, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RenewalServerUrl', full_name='License.Policy.RenewalServerUrl', index=7,
number=8, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RenewalDelaySeconds', full_name='License.Policy.RenewalDelaySeconds', index=8,
number=9, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RenewalRetryIntervalSeconds', full_name='License.Policy.RenewalRetryIntervalSeconds', index=9,
number=10, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RenewWithUsage', full_name='License.Policy.RenewWithUsage', index=10,
number=11, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1958,
serialized_end=2273,
)
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION = _descriptor.Descriptor(
name='OutputProtection',
full_name='License.KeyContainer.OutputProtection',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Hdcp', full_name='License.KeyContainer.OutputProtection.Hdcp', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='CgmsFlags', full_name='License.KeyContainer.OutputProtection.CgmsFlags', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION_CGMS,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=2797,
serialized_end=3016,
)
_LICENSE_KEYCONTAINER_KEYCONTROL = _descriptor.Descriptor(
name='KeyControl',
full_name='License.KeyContainer.KeyControl',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='KeyControlBlock', full_name='License.KeyContainer.KeyControl.KeyControlBlock', index=0,
number=1, type=12, cpp_type=9, label=2,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Iv', full_name='License.KeyContainer.KeyControl.Iv', index=1,
number=2, type=12, cpp_type=9, label=2,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=3018,
serialized_end=3067,
)
_LICENSE_KEYCONTAINER_OPERATORSESSIONKEYPERMISSIONS = _descriptor.Descriptor(
name='OperatorSessionKeyPermissions',
full_name='License.KeyContainer.OperatorSessionKeyPermissions',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='AllowEncrypt', full_name='License.KeyContainer.OperatorSessionKeyPermissions.AllowEncrypt', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='AllowDecrypt', full_name='License.KeyContainer.OperatorSessionKeyPermissions.AllowDecrypt', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='AllowSign', full_name='License.KeyContainer.OperatorSessionKeyPermissions.AllowSign', index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='AllowSignatureVerify', full_name='License.KeyContainer.OperatorSessionKeyPermissions.AllowSignatureVerify', index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=3069,
serialized_end=3193,
)
_LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT = _descriptor.Descriptor(
name='VideoResolutionConstraint',
full_name='License.KeyContainer.VideoResolutionConstraint',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='MinResolutionPixels', full_name='License.KeyContainer.VideoResolutionConstraint.MinResolutionPixels', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='MaxResolutionPixels', full_name='License.KeyContainer.VideoResolutionConstraint.MaxResolutionPixels', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequiredProtection', full_name='License.KeyContainer.VideoResolutionConstraint.RequiredProtection', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=3196,
serialized_end=3349,
)
_LICENSE_KEYCONTAINER = _descriptor.Descriptor(
name='KeyContainer',
full_name='License.KeyContainer',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Id', full_name='License.KeyContainer.Id', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Iv', full_name='License.KeyContainer.Iv', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Key', full_name='License.KeyContainer.Key', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Type', full_name='License.KeyContainer.Type', index=3,
number=4, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Level', full_name='License.KeyContainer.Level', index=4,
number=5, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequiredProtection', full_name='License.KeyContainer.RequiredProtection', index=5,
number=6, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestedProtection', full_name='License.KeyContainer.RequestedProtection', index=6,
number=7, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='_KeyControl', full_name='License.KeyContainer._KeyControl', index=7,
number=8, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='_OperatorSessionKeyPermissions', full_name='License.KeyContainer._OperatorSessionKeyPermissions', index=8,
number=9, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='VideoResolutionConstraints', full_name='License.KeyContainer.VideoResolutionConstraints', index=9,
number=10, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_LICENSE_KEYCONTAINER_OUTPUTPROTECTION, _LICENSE_KEYCONTAINER_KEYCONTROL, _LICENSE_KEYCONTAINER_OPERATORSESSIONKEYPERMISSIONS, _LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT, ],
enum_types=[
_LICENSE_KEYCONTAINER_KEYTYPE,
_LICENSE_KEYCONTAINER_SECURITYLEVEL,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=2276,
serialized_end=3549,
)
_LICENSE = _descriptor.Descriptor(
name='License',
full_name='License',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Id', full_name='License.Id', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='_Policy', full_name='License._Policy', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Key', full_name='License.Key', index=2,
number=3, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseStartTime', full_name='License.LicenseStartTime', index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RemoteAttestationVerified', full_name='License.RemoteAttestationVerified', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProviderClientToken', full_name='License.ProviderClientToken', index=5,
number=6, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProtectionScheme', full_name='License.ProtectionScheme', index=6,
number=7, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_LICENSE_POLICY, _LICENSE_KEYCONTAINER, ],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=1724,
serialized_end=3549,
)
_LICENSEERROR = _descriptor.Descriptor(
name='LicenseError',
full_name='LicenseError',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ErrorCode', full_name='LicenseError.ErrorCode', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_LICENSEERROR_ERROR,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=3552,
serialized_end=3704,
)
_LICENSEREQUEST_CONTENTIDENTIFICATION_CENC = _descriptor.Descriptor(
name='CENC',
full_name='LicenseRequest.ContentIdentification.CENC',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Pssh', full_name='LicenseRequest.ContentIdentification.CENC.Pssh', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseType', full_name='LicenseRequest.ContentIdentification.CENC.LicenseType', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestId', full_name='LicenseRequest.ContentIdentification.CENC.RequestId', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=4268,
serialized_end=4363,
)
_LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM = _descriptor.Descriptor(
name='WebM',
full_name='LicenseRequest.ContentIdentification.WebM',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Header', full_name='LicenseRequest.ContentIdentification.WebM.Header', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseType', full_name='LicenseRequest.ContentIdentification.WebM.LicenseType', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestId', full_name='LicenseRequest.ContentIdentification.WebM.RequestId', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=4365,
serialized_end=4441,
)
_LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE = _descriptor.Descriptor(
name='ExistingLicense',
full_name='LicenseRequest.ContentIdentification.ExistingLicense',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='LicenseId', full_name='LicenseRequest.ContentIdentification.ExistingLicense.LicenseId', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SecondsSinceStarted', full_name='LicenseRequest.ContentIdentification.ExistingLicense.SecondsSinceStarted', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SecondsSinceLastPlayed', full_name='LicenseRequest.ContentIdentification.ExistingLicense.SecondsSinceLastPlayed', index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionUsageTableEntry', full_name='LicenseRequest.ContentIdentification.ExistingLicense.SessionUsageTableEntry', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=4444,
serialized_end=4597,
)
_LICENSEREQUEST_CONTENTIDENTIFICATION = _descriptor.Descriptor(
name='ContentIdentification',
full_name='LicenseRequest.ContentIdentification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='CencId', full_name='LicenseRequest.ContentIdentification.CencId', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='WebmId', full_name='LicenseRequest.ContentIdentification.WebmId', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='License', full_name='LicenseRequest.ContentIdentification.License', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_LICENSEREQUEST_CONTENTIDENTIFICATION_CENC, _LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM, _LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE, ],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=4051,
serialized_end=4597,
)
_LICENSEREQUEST = _descriptor.Descriptor(
name='LicenseRequest',
full_name='LicenseRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ClientId', full_name='LicenseRequest.ClientId', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ContentId', full_name='LicenseRequest.ContentId', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Type', full_name='LicenseRequest.Type', index=2,
number=3, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestTime', full_name='LicenseRequest.RequestTime', index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='KeyControlNonceDeprecated', full_name='LicenseRequest.KeyControlNonceDeprecated', index=4,
number=5, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProtocolVersion', full_name='LicenseRequest.ProtocolVersion', index=5,
number=6, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=21,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='KeyControlNonce', full_name='LicenseRequest.KeyControlNonce', index=6,
number=7, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='EncryptedClientId', full_name='LicenseRequest.EncryptedClientId', index=7,
number=8, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_LICENSEREQUEST_CONTENTIDENTIFICATION, ],
enum_types=[
_LICENSEREQUEST_REQUESTTYPE,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=3707,
serialized_end=4647,
)
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION_CENC = _descriptor.Descriptor(
name='CENC',
full_name='LicenseRequestRaw.ContentIdentification.CENC',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Pssh', full_name='LicenseRequestRaw.ContentIdentification.CENC.Pssh', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseType', full_name='LicenseRequestRaw.ContentIdentification.CENC.LicenseType', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestId', full_name='LicenseRequestRaw.ContentIdentification.CENC.RequestId', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=5229,
serialized_end=5303,
)
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION_WEBM = _descriptor.Descriptor(
name='WebM',
full_name='LicenseRequestRaw.ContentIdentification.WebM',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Header', full_name='LicenseRequestRaw.ContentIdentification.WebM.Header', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseType', full_name='LicenseRequestRaw.ContentIdentification.WebM.LicenseType', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestId', full_name='LicenseRequestRaw.ContentIdentification.WebM.RequestId', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=4365,
serialized_end=4441,
)
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION_EXISTINGLICENSE = _descriptor.Descriptor(
name='ExistingLicense',
full_name='LicenseRequestRaw.ContentIdentification.ExistingLicense',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='LicenseId', full_name='LicenseRequestRaw.ContentIdentification.ExistingLicense.LicenseId', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SecondsSinceStarted', full_name='LicenseRequestRaw.ContentIdentification.ExistingLicense.SecondsSinceStarted', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SecondsSinceLastPlayed', full_name='LicenseRequestRaw.ContentIdentification.ExistingLicense.SecondsSinceLastPlayed', index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionUsageTableEntry', full_name='LicenseRequestRaw.ContentIdentification.ExistingLicense.SessionUsageTableEntry', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=4444,
serialized_end=4597,
)
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION = _descriptor.Descriptor(
name='ContentIdentification',
full_name='LicenseRequestRaw.ContentIdentification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='CencId', full_name='LicenseRequestRaw.ContentIdentification.CencId', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='WebmId', full_name='LicenseRequestRaw.ContentIdentification.WebmId', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='License', full_name='LicenseRequestRaw.ContentIdentification.License', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_LICENSEREQUESTRAW_CONTENTIDENTIFICATION_CENC, _LICENSEREQUESTRAW_CONTENTIDENTIFICATION_WEBM, _LICENSEREQUESTRAW_CONTENTIDENTIFICATION_EXISTINGLICENSE, ],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=5003,
serialized_end=5537,
)
_LICENSEREQUESTRAW = _descriptor.Descriptor(
name='LicenseRequestRaw',
full_name='LicenseRequestRaw',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ClientId', full_name='LicenseRequestRaw.ClientId', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ContentId', full_name='LicenseRequestRaw.ContentId', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Type', full_name='LicenseRequestRaw.Type', index=2,
number=3, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestTime', full_name='LicenseRequestRaw.RequestTime', index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='KeyControlNonceDeprecated', full_name='LicenseRequestRaw.KeyControlNonceDeprecated', index=4,
number=5, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProtocolVersion', full_name='LicenseRequestRaw.ProtocolVersion', index=5,
number=6, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=21,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='KeyControlNonce', full_name='LicenseRequestRaw.KeyControlNonce', index=6,
number=7, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='EncryptedClientId', full_name='LicenseRequestRaw.EncryptedClientId', index=7,
number=8, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_LICENSEREQUESTRAW_CONTENTIDENTIFICATION, ],
enum_types=[
_LICENSEREQUESTRAW_REQUESTTYPE,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=4650,
serialized_end=5587,
)
_PROVISIONEDDEVICEINFO = _descriptor.Descriptor(
name='ProvisionedDeviceInfo',
full_name='ProvisionedDeviceInfo',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='SystemId', full_name='ProvisionedDeviceInfo.SystemId', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Soc', full_name='ProvisionedDeviceInfo.Soc', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Manufacturer', full_name='ProvisionedDeviceInfo.Manufacturer', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Model', full_name='ProvisionedDeviceInfo.Model', index=3,
number=4, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='DeviceType', full_name='ProvisionedDeviceInfo.DeviceType', index=4,
number=5, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ModelYear', full_name='ProvisionedDeviceInfo.ModelYear', index=5,
number=6, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SecurityLevel', full_name='ProvisionedDeviceInfo.SecurityLevel', index=6,
number=7, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='TestDevice', full_name='ProvisionedDeviceInfo.TestDevice', index=7,
number=8, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_PROVISIONEDDEVICEINFO_WVSECURITYLEVEL,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=5590,
serialized_end=5884,
)
_PROVISIONINGOPTIONS = _descriptor.Descriptor(
name='ProvisioningOptions',
full_name='ProvisioningOptions',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=5886,
serialized_end=5907,
)
_PROVISIONINGREQUEST = _descriptor.Descriptor(
name='ProvisioningRequest',
full_name='ProvisioningRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=5909,
serialized_end=5930,
)
_PROVISIONINGRESPONSE = _descriptor.Descriptor(
name='ProvisioningResponse',
full_name='ProvisioningResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=5932,
serialized_end=5954,
)
_REMOTEATTESTATION = _descriptor.Descriptor(
name='RemoteAttestation',
full_name='RemoteAttestation',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Certificate', full_name='RemoteAttestation.Certificate', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Salt', full_name='RemoteAttestation.Salt', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='RemoteAttestation.Signature', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=5956,
serialized_end=6061,
)
_SESSIONINIT = _descriptor.Descriptor(
name='SessionInit',
full_name='SessionInit',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=6063,
serialized_end=6076,
)
_SESSIONSTATE = _descriptor.Descriptor(
name='SessionState',
full_name='SessionState',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=6078,
serialized_end=6092,
)
_SIGNEDCERTIFICATESTATUSLIST = _descriptor.Descriptor(
name='SignedCertificateStatusList',
full_name='SignedCertificateStatusList',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=6094,
serialized_end=6123,
)
_SIGNEDDEVICECERTIFICATE = _descriptor.Descriptor(
name='SignedDeviceCertificate',
full_name='SignedDeviceCertificate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='_DeviceCertificate', full_name='SignedDeviceCertificate._DeviceCertificate', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='SignedDeviceCertificate.Signature', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signer', full_name='SignedDeviceCertificate.Signer', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=6126,
serialized_end=6260,
)
_SIGNEDPROVISIONINGMESSAGE = _descriptor.Descriptor(
name='SignedProvisioningMessage',
full_name='SignedProvisioningMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=6262,
serialized_end=6289,
)
_SIGNEDMESSAGE = _descriptor.Descriptor(
name='SignedMessage',
full_name='SignedMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='SignedMessage.Type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Msg', full_name='SignedMessage.Msg', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='SignedMessage.Signature', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionKey', full_name='SignedMessage.SessionKey', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RemoteAttestation', full_name='SignedMessage.RemoteAttestation', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_SIGNEDMESSAGE_MESSAGETYPE,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=6292,
serialized_end=6575,
)
_WIDEVINECENCHEADER = _descriptor.Descriptor(
name='WidevineCencHeader',
full_name='WidevineCencHeader',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='algorithm', full_name='WidevineCencHeader.algorithm', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='key_id', full_name='WidevineCencHeader.key_id', index=1,
number=2, type=12, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='provider', full_name='WidevineCencHeader.provider', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='content_id', full_name='WidevineCencHeader.content_id', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='track_type_deprecated', full_name='WidevineCencHeader.track_type_deprecated', index=4,
number=5, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='policy', full_name='WidevineCencHeader.policy', index=5,
number=6, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='crypto_period_index', full_name='WidevineCencHeader.crypto_period_index', index=6,
number=7, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='grouped_license', full_name='WidevineCencHeader.grouped_license', index=7,
number=8, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='protection_scheme', full_name='WidevineCencHeader.protection_scheme', index=8,
number=9, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='crypto_period_seconds', full_name='WidevineCencHeader.crypto_period_seconds', index=9,
number=10, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_WIDEVINECENCHEADER_ALGORITHM,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=6578,
serialized_end=6903,
)
_SIGNEDLICENSEREQUEST = _descriptor.Descriptor(
name='SignedLicenseRequest',
full_name='SignedLicenseRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='SignedLicenseRequest.Type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Msg', full_name='SignedLicenseRequest.Msg', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='SignedLicenseRequest.Signature', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionKey', full_name='SignedLicenseRequest.SessionKey', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RemoteAttestation', full_name='SignedLicenseRequest.RemoteAttestation', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_SIGNEDLICENSEREQUEST_MESSAGETYPE,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=6906,
serialized_end=7220,
)
_SIGNEDLICENSEREQUESTRAW = _descriptor.Descriptor(
name='SignedLicenseRequestRaw',
full_name='SignedLicenseRequestRaw',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='SignedLicenseRequestRaw.Type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Msg', full_name='SignedLicenseRequestRaw.Msg', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='SignedLicenseRequestRaw.Signature', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionKey', full_name='SignedLicenseRequestRaw.SessionKey', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RemoteAttestation', full_name='SignedLicenseRequestRaw.RemoteAttestation', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_SIGNEDLICENSEREQUESTRAW_MESSAGETYPE,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=7223,
serialized_end=7546,
)
_SIGNEDLICENSE = _descriptor.Descriptor(
name='SignedLicense',
full_name='SignedLicense',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='SignedLicense.Type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Msg', full_name='SignedLicense.Msg', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='SignedLicense.Signature', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionKey', full_name='SignedLicense.SessionKey', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RemoteAttestation', full_name='SignedLicense.RemoteAttestation', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_SIGNEDLICENSE_MESSAGETYPE,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=7549,
serialized_end=7842,
)
_SIGNEDSERVICECERTIFICATE = _descriptor.Descriptor(
name='SignedServiceCertificate',
full_name='SignedServiceCertificate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='SignedServiceCertificate.Type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=1,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Msg', full_name='SignedServiceCertificate.Msg', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='SignedServiceCertificate.Signature', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionKey', full_name='SignedServiceCertificate.SessionKey', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RemoteAttestation', full_name='SignedServiceCertificate.RemoteAttestation', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_SIGNEDSERVICECERTIFICATE_MESSAGETYPE,
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=7845,
serialized_end=8176,
)
_FILEHASHES_SIGNATURE = _descriptor.Descriptor(
name='Signature',
full_name='FileHashes.Signature',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='filename', full_name='FileHashes.Signature.filename', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='test_signing', full_name='FileHashes.Signature.test_signing', index=1,
number=2, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SHA512Hash', full_name='FileHashes.Signature.SHA512Hash', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='main_exe', full_name='FileHashes.Signature.main_exe', index=3,
number=4, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='signature', full_name='FileHashes.Signature.signature', index=4,
number=5, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=8252,
serialized_end=8360,
)
_FILEHASHES = _descriptor.Descriptor(
name='FileHashes',
full_name='FileHashes',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='signer', full_name='FileHashes.signer', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='signatures', full_name='FileHashes.signatures', index=1,
number=2, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_FILEHASHES_SIGNATURE, ],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=8179,
serialized_end=8360,
)
_CLIENTIDENTIFICATION_NAMEVALUE.containing_type = _CLIENTIDENTIFICATION
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES.fields_by_name['MaxHdcpVersion'].enum_type = _CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES.containing_type = _CLIENTIDENTIFICATION
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION.containing_type = _CLIENTIDENTIFICATION_CLIENTCAPABILITIES
_CLIENTIDENTIFICATION.fields_by_name['Type'].enum_type = _CLIENTIDENTIFICATION_TOKENTYPE
_CLIENTIDENTIFICATION.fields_by_name['Token'].message_type = _SIGNEDDEVICECERTIFICATE
_CLIENTIDENTIFICATION.fields_by_name['ClientInfo'].message_type = _CLIENTIDENTIFICATION_NAMEVALUE
_CLIENTIDENTIFICATION.fields_by_name['_ClientCapabilities'].message_type = _CLIENTIDENTIFICATION_CLIENTCAPABILITIES
_CLIENTIDENTIFICATION.fields_by_name['_FileHashes'].message_type = _FILEHASHES
_CLIENTIDENTIFICATION_TOKENTYPE.containing_type = _CLIENTIDENTIFICATION
_DEVICECERTIFICATE.fields_by_name['Type'].enum_type = _DEVICECERTIFICATE_CERTIFICATETYPE
_DEVICECERTIFICATE_CERTIFICATETYPE.containing_type = _DEVICECERTIFICATE
_DEVICECERTIFICATESTATUS.fields_by_name['Status'].enum_type = _DEVICECERTIFICATESTATUS_CERTIFICATESTATUS
_DEVICECERTIFICATESTATUS.fields_by_name['DeviceInfo'].message_type = _PROVISIONEDDEVICEINFO
_DEVICECERTIFICATESTATUS_CERTIFICATESTATUS.containing_type = _DEVICECERTIFICATESTATUS
_DEVICECERTIFICATESTATUSLIST.fields_by_name['CertificateStatus'].message_type = _DEVICECERTIFICATESTATUS
_LICENSEIDENTIFICATION.fields_by_name['Type'].enum_type = _LICENSETYPE
_LICENSE_POLICY.containing_type = _LICENSE
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION.fields_by_name['Hdcp'].enum_type = _CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION.fields_by_name['CgmsFlags'].enum_type = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION_CGMS
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION.containing_type = _LICENSE_KEYCONTAINER
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION_CGMS.containing_type = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION
_LICENSE_KEYCONTAINER_KEYCONTROL.containing_type = _LICENSE_KEYCONTAINER
_LICENSE_KEYCONTAINER_OPERATORSESSIONKEYPERMISSIONS.containing_type = _LICENSE_KEYCONTAINER
_LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT.fields_by_name['RequiredProtection'].message_type = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION
_LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT.containing_type = _LICENSE_KEYCONTAINER
_LICENSE_KEYCONTAINER.fields_by_name['Type'].enum_type = _LICENSE_KEYCONTAINER_KEYTYPE
_LICENSE_KEYCONTAINER.fields_by_name['Level'].enum_type = _LICENSE_KEYCONTAINER_SECURITYLEVEL
_LICENSE_KEYCONTAINER.fields_by_name['RequiredProtection'].message_type = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION
_LICENSE_KEYCONTAINER.fields_by_name['RequestedProtection'].message_type = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION
_LICENSE_KEYCONTAINER.fields_by_name['_KeyControl'].message_type = _LICENSE_KEYCONTAINER_KEYCONTROL
_LICENSE_KEYCONTAINER.fields_by_name['_OperatorSessionKeyPermissions'].message_type = _LICENSE_KEYCONTAINER_OPERATORSESSIONKEYPERMISSIONS
_LICENSE_KEYCONTAINER.fields_by_name['VideoResolutionConstraints'].message_type = _LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT
_LICENSE_KEYCONTAINER.containing_type = _LICENSE
_LICENSE_KEYCONTAINER_KEYTYPE.containing_type = _LICENSE_KEYCONTAINER
_LICENSE_KEYCONTAINER_SECURITYLEVEL.containing_type = _LICENSE_KEYCONTAINER
_LICENSE.fields_by_name['Id'].message_type = _LICENSEIDENTIFICATION
_LICENSE.fields_by_name['_Policy'].message_type = _LICENSE_POLICY
_LICENSE.fields_by_name['Key'].message_type = _LICENSE_KEYCONTAINER
_LICENSEERROR.fields_by_name['ErrorCode'].enum_type = _LICENSEERROR_ERROR
_LICENSEERROR_ERROR.containing_type = _LICENSEERROR
_LICENSEREQUEST_CONTENTIDENTIFICATION_CENC.fields_by_name['Pssh'].message_type = _WIDEVINECENCHEADER
_LICENSEREQUEST_CONTENTIDENTIFICATION_CENC.fields_by_name['LicenseType'].enum_type = _LICENSETYPE
_LICENSEREQUEST_CONTENTIDENTIFICATION_CENC.containing_type = _LICENSEREQUEST_CONTENTIDENTIFICATION
_LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM.fields_by_name['LicenseType'].enum_type = _LICENSETYPE
_LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM.containing_type = _LICENSEREQUEST_CONTENTIDENTIFICATION
_LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE.fields_by_name['LicenseId'].message_type = _LICENSEIDENTIFICATION
_LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE.containing_type = _LICENSEREQUEST_CONTENTIDENTIFICATION
_LICENSEREQUEST_CONTENTIDENTIFICATION.fields_by_name['CencId'].message_type = _LICENSEREQUEST_CONTENTIDENTIFICATION_CENC
_LICENSEREQUEST_CONTENTIDENTIFICATION.fields_by_name['WebmId'].message_type = _LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM
_LICENSEREQUEST_CONTENTIDENTIFICATION.fields_by_name['License'].message_type = _LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE
_LICENSEREQUEST_CONTENTIDENTIFICATION.containing_type = _LICENSEREQUEST
_LICENSEREQUEST.fields_by_name['ClientId'].message_type = _CLIENTIDENTIFICATION
_LICENSEREQUEST.fields_by_name['ContentId'].message_type = _LICENSEREQUEST_CONTENTIDENTIFICATION
_LICENSEREQUEST.fields_by_name['Type'].enum_type = _LICENSEREQUEST_REQUESTTYPE
_LICENSEREQUEST.fields_by_name['ProtocolVersion'].enum_type = _PROTOCOLVERSION
_LICENSEREQUEST.fields_by_name['EncryptedClientId'].message_type = _ENCRYPTEDCLIENTIDENTIFICATION
_LICENSEREQUEST_REQUESTTYPE.containing_type = _LICENSEREQUEST
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION_CENC.fields_by_name['LicenseType'].enum_type = _LICENSETYPE
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION_CENC.containing_type = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION_WEBM.fields_by_name['LicenseType'].enum_type = _LICENSETYPE
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION_WEBM.containing_type = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION_EXISTINGLICENSE.fields_by_name['LicenseId'].message_type = _LICENSEIDENTIFICATION
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION_EXISTINGLICENSE.containing_type = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION.fields_by_name['CencId'].message_type = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION_CENC
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION.fields_by_name['WebmId'].message_type = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION_WEBM
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION.fields_by_name['License'].message_type = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION_EXISTINGLICENSE
_LICENSEREQUESTRAW_CONTENTIDENTIFICATION.containing_type = _LICENSEREQUESTRAW
_LICENSEREQUESTRAW.fields_by_name['ClientId'].message_type = _CLIENTIDENTIFICATION
_LICENSEREQUESTRAW.fields_by_name['ContentId'].message_type = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION
_LICENSEREQUESTRAW.fields_by_name['Type'].enum_type = _LICENSEREQUESTRAW_REQUESTTYPE
_LICENSEREQUESTRAW.fields_by_name['ProtocolVersion'].enum_type = _PROTOCOLVERSION
_LICENSEREQUESTRAW.fields_by_name['EncryptedClientId'].message_type = _ENCRYPTEDCLIENTIDENTIFICATION
_LICENSEREQUESTRAW_REQUESTTYPE.containing_type = _LICENSEREQUESTRAW
_PROVISIONEDDEVICEINFO.fields_by_name['SecurityLevel'].enum_type = _PROVISIONEDDEVICEINFO_WVSECURITYLEVEL
_PROVISIONEDDEVICEINFO_WVSECURITYLEVEL.containing_type = _PROVISIONEDDEVICEINFO
_REMOTEATTESTATION.fields_by_name['Certificate'].message_type = _ENCRYPTEDCLIENTIDENTIFICATION
_SIGNEDDEVICECERTIFICATE.fields_by_name['_DeviceCertificate'].message_type = _DEVICECERTIFICATE
_SIGNEDDEVICECERTIFICATE.fields_by_name['Signer'].message_type = _SIGNEDDEVICECERTIFICATE
_SIGNEDMESSAGE.fields_by_name['Type'].enum_type = _SIGNEDMESSAGE_MESSAGETYPE
_SIGNEDMESSAGE.fields_by_name['RemoteAttestation'].message_type = _REMOTEATTESTATION
_SIGNEDMESSAGE_MESSAGETYPE.containing_type = _SIGNEDMESSAGE
_WIDEVINECENCHEADER.fields_by_name['algorithm'].enum_type = _WIDEVINECENCHEADER_ALGORITHM
_WIDEVINECENCHEADER_ALGORITHM.containing_type = _WIDEVINECENCHEADER
_SIGNEDLICENSEREQUEST.fields_by_name['Type'].enum_type = _SIGNEDLICENSEREQUEST_MESSAGETYPE
_SIGNEDLICENSEREQUEST.fields_by_name['Msg'].message_type = _LICENSEREQUEST
_SIGNEDLICENSEREQUEST.fields_by_name['RemoteAttestation'].message_type = _REMOTEATTESTATION
_SIGNEDLICENSEREQUEST_MESSAGETYPE.containing_type = _SIGNEDLICENSEREQUEST
_SIGNEDLICENSEREQUESTRAW.fields_by_name['Type'].enum_type = _SIGNEDLICENSEREQUESTRAW_MESSAGETYPE
_SIGNEDLICENSEREQUESTRAW.fields_by_name['Msg'].message_type = _LICENSEREQUESTRAW
_SIGNEDLICENSEREQUESTRAW.fields_by_name['RemoteAttestation'].message_type = _REMOTEATTESTATION
_SIGNEDLICENSEREQUESTRAW_MESSAGETYPE.containing_type = _SIGNEDLICENSEREQUESTRAW
_SIGNEDLICENSE.fields_by_name['Type'].enum_type = _SIGNEDLICENSE_MESSAGETYPE
_SIGNEDLICENSE.fields_by_name['Msg'].message_type = _LICENSE
_SIGNEDLICENSE.fields_by_name['RemoteAttestation'].message_type = _REMOTEATTESTATION
_SIGNEDLICENSE_MESSAGETYPE.containing_type = _SIGNEDLICENSE
_SIGNEDSERVICECERTIFICATE.fields_by_name['Type'].enum_type = _SIGNEDSERVICECERTIFICATE_MESSAGETYPE
_SIGNEDSERVICECERTIFICATE.fields_by_name['Msg'].message_type = _SIGNEDDEVICECERTIFICATE
_SIGNEDSERVICECERTIFICATE.fields_by_name['RemoteAttestation'].message_type = _REMOTEATTESTATION
_SIGNEDSERVICECERTIFICATE_MESSAGETYPE.containing_type = _SIGNEDSERVICECERTIFICATE
_FILEHASHES_SIGNATURE.containing_type = _FILEHASHES
_FILEHASHES.fields_by_name['signatures'].message_type = _FILEHASHES_SIGNATURE
DESCRIPTOR.message_types_by_name['ClientIdentification'] = _CLIENTIDENTIFICATION
DESCRIPTOR.message_types_by_name['DeviceCertificate'] = _DEVICECERTIFICATE
DESCRIPTOR.message_types_by_name['DeviceCertificateStatus'] = _DEVICECERTIFICATESTATUS
DESCRIPTOR.message_types_by_name['DeviceCertificateStatusList'] = _DEVICECERTIFICATESTATUSLIST
DESCRIPTOR.message_types_by_name['EncryptedClientIdentification'] = _ENCRYPTEDCLIENTIDENTIFICATION
DESCRIPTOR.message_types_by_name['LicenseIdentification'] = _LICENSEIDENTIFICATION
DESCRIPTOR.message_types_by_name['License'] = _LICENSE
DESCRIPTOR.message_types_by_name['LicenseError'] = _LICENSEERROR
DESCRIPTOR.message_types_by_name['LicenseRequest'] = _LICENSEREQUEST
DESCRIPTOR.message_types_by_name['LicenseRequestRaw'] = _LICENSEREQUESTRAW
DESCRIPTOR.message_types_by_name['ProvisionedDeviceInfo'] = _PROVISIONEDDEVICEINFO
DESCRIPTOR.message_types_by_name['ProvisioningOptions'] = _PROVISIONINGOPTIONS
DESCRIPTOR.message_types_by_name['ProvisioningRequest'] = _PROVISIONINGREQUEST
DESCRIPTOR.message_types_by_name['ProvisioningResponse'] = _PROVISIONINGRESPONSE
DESCRIPTOR.message_types_by_name['RemoteAttestation'] = _REMOTEATTESTATION
DESCRIPTOR.message_types_by_name['SessionInit'] = _SESSIONINIT
DESCRIPTOR.message_types_by_name['SessionState'] = _SESSIONSTATE
DESCRIPTOR.message_types_by_name['SignedCertificateStatusList'] = _SIGNEDCERTIFICATESTATUSLIST
DESCRIPTOR.message_types_by_name['SignedDeviceCertificate'] = _SIGNEDDEVICECERTIFICATE
DESCRIPTOR.message_types_by_name['SignedProvisioningMessage'] = _SIGNEDPROVISIONINGMESSAGE
DESCRIPTOR.message_types_by_name['SignedMessage'] = _SIGNEDMESSAGE
DESCRIPTOR.message_types_by_name['WidevineCencHeader'] = _WIDEVINECENCHEADER
DESCRIPTOR.message_types_by_name['SignedLicenseRequest'] = _SIGNEDLICENSEREQUEST
DESCRIPTOR.message_types_by_name['SignedLicenseRequestRaw'] = _SIGNEDLICENSEREQUESTRAW
DESCRIPTOR.message_types_by_name['SignedLicense'] = _SIGNEDLICENSE
DESCRIPTOR.message_types_by_name['SignedServiceCertificate'] = _SIGNEDSERVICECERTIFICATE
DESCRIPTOR.message_types_by_name['FileHashes'] = _FILEHASHES
DESCRIPTOR.enum_types_by_name['LicenseType'] = _LICENSETYPE
DESCRIPTOR.enum_types_by_name['ProtocolVersion'] = _PROTOCOLVERSION
ClientIdentification = _reflection.GeneratedProtocolMessageType('ClientIdentification', (_message.Message,), dict(
NameValue = _reflection.GeneratedProtocolMessageType('NameValue', (_message.Message,), dict(
DESCRIPTOR = _CLIENTIDENTIFICATION_NAMEVALUE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:ClientIdentification.NameValue)
))
,
ClientCapabilities = _reflection.GeneratedProtocolMessageType('ClientCapabilities', (_message.Message,), dict(
DESCRIPTOR = _CLIENTIDENTIFICATION_CLIENTCAPABILITIES,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:ClientIdentification.ClientCapabilities)
))
,
DESCRIPTOR = _CLIENTIDENTIFICATION,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:ClientIdentification)
))
_sym_db.RegisterMessage(ClientIdentification)
_sym_db.RegisterMessage(ClientIdentification.NameValue)
_sym_db.RegisterMessage(ClientIdentification.ClientCapabilities)
DeviceCertificate = _reflection.GeneratedProtocolMessageType('DeviceCertificate', (_message.Message,), dict(
DESCRIPTOR = _DEVICECERTIFICATE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:DeviceCertificate)
))
_sym_db.RegisterMessage(DeviceCertificate)
DeviceCertificateStatus = _reflection.GeneratedProtocolMessageType('DeviceCertificateStatus', (_message.Message,), dict(
DESCRIPTOR = _DEVICECERTIFICATESTATUS,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:DeviceCertificateStatus)
))
_sym_db.RegisterMessage(DeviceCertificateStatus)
DeviceCertificateStatusList = _reflection.GeneratedProtocolMessageType('DeviceCertificateStatusList', (_message.Message,), dict(
DESCRIPTOR = _DEVICECERTIFICATESTATUSLIST,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:DeviceCertificateStatusList)
))
_sym_db.RegisterMessage(DeviceCertificateStatusList)
EncryptedClientIdentification = _reflection.GeneratedProtocolMessageType('EncryptedClientIdentification', (_message.Message,), dict(
DESCRIPTOR = _ENCRYPTEDCLIENTIDENTIFICATION,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:EncryptedClientIdentification)
))
_sym_db.RegisterMessage(EncryptedClientIdentification)
LicenseIdentification = _reflection.GeneratedProtocolMessageType('LicenseIdentification', (_message.Message,), dict(
DESCRIPTOR = _LICENSEIDENTIFICATION,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseIdentification)
))
_sym_db.RegisterMessage(LicenseIdentification)
License = _reflection.GeneratedProtocolMessageType('License', (_message.Message,), dict(
Policy = _reflection.GeneratedProtocolMessageType('Policy', (_message.Message,), dict(
DESCRIPTOR = _LICENSE_POLICY,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:License.Policy)
))
,
KeyContainer = _reflection.GeneratedProtocolMessageType('KeyContainer', (_message.Message,), dict(
OutputProtection = _reflection.GeneratedProtocolMessageType('OutputProtection', (_message.Message,), dict(
DESCRIPTOR = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:License.KeyContainer.OutputProtection)
))
,
KeyControl = _reflection.GeneratedProtocolMessageType('KeyControl', (_message.Message,), dict(
DESCRIPTOR = _LICENSE_KEYCONTAINER_KEYCONTROL,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:License.KeyContainer.KeyControl)
))
,
OperatorSessionKeyPermissions = _reflection.GeneratedProtocolMessageType('OperatorSessionKeyPermissions', (_message.Message,), dict(
DESCRIPTOR = _LICENSE_KEYCONTAINER_OPERATORSESSIONKEYPERMISSIONS,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:License.KeyContainer.OperatorSessionKeyPermissions)
))
,
VideoResolutionConstraint = _reflection.GeneratedProtocolMessageType('VideoResolutionConstraint', (_message.Message,), dict(
DESCRIPTOR = _LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:License.KeyContainer.VideoResolutionConstraint)
))
,
DESCRIPTOR = _LICENSE_KEYCONTAINER,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:License.KeyContainer)
))
,
DESCRIPTOR = _LICENSE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:License)
))
_sym_db.RegisterMessage(License)
_sym_db.RegisterMessage(License.Policy)
_sym_db.RegisterMessage(License.KeyContainer)
_sym_db.RegisterMessage(License.KeyContainer.OutputProtection)
_sym_db.RegisterMessage(License.KeyContainer.KeyControl)
_sym_db.RegisterMessage(License.KeyContainer.OperatorSessionKeyPermissions)
_sym_db.RegisterMessage(License.KeyContainer.VideoResolutionConstraint)
LicenseError = _reflection.GeneratedProtocolMessageType('LicenseError', (_message.Message,), dict(
DESCRIPTOR = _LICENSEERROR,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseError)
))
_sym_db.RegisterMessage(LicenseError)
LicenseRequest = _reflection.GeneratedProtocolMessageType('LicenseRequest', (_message.Message,), dict(
ContentIdentification = _reflection.GeneratedProtocolMessageType('ContentIdentification', (_message.Message,), dict(
CENC = _reflection.GeneratedProtocolMessageType('CENC', (_message.Message,), dict(
DESCRIPTOR = _LICENSEREQUEST_CONTENTIDENTIFICATION_CENC,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequest.ContentIdentification.CENC)
))
,
WebM = _reflection.GeneratedProtocolMessageType('WebM', (_message.Message,), dict(
DESCRIPTOR = _LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequest.ContentIdentification.WebM)
))
,
ExistingLicense = _reflection.GeneratedProtocolMessageType('ExistingLicense', (_message.Message,), dict(
DESCRIPTOR = _LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequest.ContentIdentification.ExistingLicense)
))
,
DESCRIPTOR = _LICENSEREQUEST_CONTENTIDENTIFICATION,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequest.ContentIdentification)
))
,
DESCRIPTOR = _LICENSEREQUEST,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequest)
))
_sym_db.RegisterMessage(LicenseRequest)
_sym_db.RegisterMessage(LicenseRequest.ContentIdentification)
_sym_db.RegisterMessage(LicenseRequest.ContentIdentification.CENC)
_sym_db.RegisterMessage(LicenseRequest.ContentIdentification.WebM)
_sym_db.RegisterMessage(LicenseRequest.ContentIdentification.ExistingLicense)
LicenseRequestRaw = _reflection.GeneratedProtocolMessageType('LicenseRequestRaw', (_message.Message,), dict(
ContentIdentification = _reflection.GeneratedProtocolMessageType('ContentIdentification', (_message.Message,), dict(
CENC = _reflection.GeneratedProtocolMessageType('CENC', (_message.Message,), dict(
DESCRIPTOR = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION_CENC,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequestRaw.ContentIdentification.CENC)
))
,
WebM = _reflection.GeneratedProtocolMessageType('WebM', (_message.Message,), dict(
DESCRIPTOR = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION_WEBM,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequestRaw.ContentIdentification.WebM)
))
,
ExistingLicense = _reflection.GeneratedProtocolMessageType('ExistingLicense', (_message.Message,), dict(
DESCRIPTOR = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION_EXISTINGLICENSE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequestRaw.ContentIdentification.ExistingLicense)
))
,
DESCRIPTOR = _LICENSEREQUESTRAW_CONTENTIDENTIFICATION,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequestRaw.ContentIdentification)
))
,
DESCRIPTOR = _LICENSEREQUESTRAW,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequestRaw)
))
_sym_db.RegisterMessage(LicenseRequestRaw)
_sym_db.RegisterMessage(LicenseRequestRaw.ContentIdentification)
_sym_db.RegisterMessage(LicenseRequestRaw.ContentIdentification.CENC)
_sym_db.RegisterMessage(LicenseRequestRaw.ContentIdentification.WebM)
_sym_db.RegisterMessage(LicenseRequestRaw.ContentIdentification.ExistingLicense)
ProvisionedDeviceInfo = _reflection.GeneratedProtocolMessageType('ProvisionedDeviceInfo', (_message.Message,), dict(
DESCRIPTOR = _PROVISIONEDDEVICEINFO,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:ProvisionedDeviceInfo)
))
_sym_db.RegisterMessage(ProvisionedDeviceInfo)
ProvisioningOptions = _reflection.GeneratedProtocolMessageType('ProvisioningOptions', (_message.Message,), dict(
DESCRIPTOR = _PROVISIONINGOPTIONS,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:ProvisioningOptions)
))
_sym_db.RegisterMessage(ProvisioningOptions)
ProvisioningRequest = _reflection.GeneratedProtocolMessageType('ProvisioningRequest', (_message.Message,), dict(
DESCRIPTOR = _PROVISIONINGREQUEST,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:ProvisioningRequest)
))
_sym_db.RegisterMessage(ProvisioningRequest)
ProvisioningResponse = _reflection.GeneratedProtocolMessageType('ProvisioningResponse', (_message.Message,), dict(
DESCRIPTOR = _PROVISIONINGRESPONSE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:ProvisioningResponse)
))
_sym_db.RegisterMessage(ProvisioningResponse)
RemoteAttestation = _reflection.GeneratedProtocolMessageType('RemoteAttestation', (_message.Message,), dict(
DESCRIPTOR = _REMOTEATTESTATION,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:RemoteAttestation)
))
_sym_db.RegisterMessage(RemoteAttestation)
SessionInit = _reflection.GeneratedProtocolMessageType('SessionInit', (_message.Message,), dict(
DESCRIPTOR = _SESSIONINIT,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:SessionInit)
))
_sym_db.RegisterMessage(SessionInit)
SessionState = _reflection.GeneratedProtocolMessageType('SessionState', (_message.Message,), dict(
DESCRIPTOR = _SESSIONSTATE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:SessionState)
))
_sym_db.RegisterMessage(SessionState)
SignedCertificateStatusList = _reflection.GeneratedProtocolMessageType('SignedCertificateStatusList', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDCERTIFICATESTATUSLIST,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:SignedCertificateStatusList)
))
_sym_db.RegisterMessage(SignedCertificateStatusList)
SignedDeviceCertificate = _reflection.GeneratedProtocolMessageType('SignedDeviceCertificate', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDDEVICECERTIFICATE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:SignedDeviceCertificate)
))
_sym_db.RegisterMessage(SignedDeviceCertificate)
SignedProvisioningMessage = _reflection.GeneratedProtocolMessageType('SignedProvisioningMessage', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDPROVISIONINGMESSAGE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:SignedProvisioningMessage)
))
_sym_db.RegisterMessage(SignedProvisioningMessage)
SignedMessage = _reflection.GeneratedProtocolMessageType('SignedMessage', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDMESSAGE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:SignedMessage)
))
_sym_db.RegisterMessage(SignedMessage)
WidevineCencHeader = _reflection.GeneratedProtocolMessageType('WidevineCencHeader', (_message.Message,), dict(
DESCRIPTOR = _WIDEVINECENCHEADER,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:WidevineCencHeader)
))
_sym_db.RegisterMessage(WidevineCencHeader)
SignedLicenseRequest = _reflection.GeneratedProtocolMessageType('SignedLicenseRequest', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDLICENSEREQUEST,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:SignedLicenseRequest)
))
_sym_db.RegisterMessage(SignedLicenseRequest)
SignedLicenseRequestRaw = _reflection.GeneratedProtocolMessageType('SignedLicenseRequestRaw', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDLICENSEREQUESTRAW,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:SignedLicenseRequestRaw)
))
_sym_db.RegisterMessage(SignedLicenseRequestRaw)
SignedLicense = _reflection.GeneratedProtocolMessageType('SignedLicense', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDLICENSE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:SignedLicense)
))
_sym_db.RegisterMessage(SignedLicense)
SignedServiceCertificate = _reflection.GeneratedProtocolMessageType('SignedServiceCertificate', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDSERVICECERTIFICATE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:SignedServiceCertificate)
))
_sym_db.RegisterMessage(SignedServiceCertificate)
FileHashes = _reflection.GeneratedProtocolMessageType('FileHashes', (_message.Message,), dict(
Signature = _reflection.GeneratedProtocolMessageType('Signature', (_message.Message,), dict(
DESCRIPTOR = _FILEHASHES_SIGNATURE,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:FileHashes.Signature)
))
,
DESCRIPTOR = _FILEHASHES,
__module__ = 'pywidevine.cdm.formats.wv_proto2_pb2'
# @@protoc_insertion_point(class_scope:FileHashes)
))
_sym_db.RegisterMessage(FileHashes)
_sym_db.RegisterMessage(FileHashes.Signature)
# @@protoc_insertion_point(module_scope)
| 137,199 | Python | .py | 3,179 | 38.50928 | 14,111 | 0.740885 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,329 | wv_proto3_pb2.py | Bbalduzz_phantomplus/pywidevine/cdm/formats/wv_proto3_pb2.py | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: wv_proto3.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='wv_proto3.proto',
package='',
syntax='proto3',
serialized_pb=_b('\n\x0fwv_proto3.proto\"\xc5\x05\n\x14\x43lientIdentification\x12-\n\x04Type\x18\x01 \x01(\x0e\x32\x1f.ClientIdentification.TokenType\x12\'\n\x05Token\x18\x02 \x01(\x0b\x32\x18.SignedDeviceCertificate\x12\x33\n\nClientInfo\x18\x03 \x03(\x0b\x32\x1f.ClientIdentification.NameValue\x12\x1b\n\x13ProviderClientToken\x18\x04 \x01(\x0c\x12\x16\n\x0eLicenseCounter\x18\x05 \x01(\r\x12\x45\n\x13_ClientCapabilities\x18\x06 \x01(\x0b\x32(.ClientIdentification.ClientCapabilities\x1a(\n\tNameValue\x12\x0c\n\x04Name\x18\x01 \x01(\t\x12\r\n\x05Value\x18\x02 \x01(\t\x1a\xa4\x02\n\x12\x43lientCapabilities\x12\x13\n\x0b\x43lientToken\x18\x01 \x01(\r\x12\x14\n\x0cSessionToken\x18\x02 \x01(\r\x12\"\n\x1aVideoResolutionConstraints\x18\x03 \x01(\r\x12L\n\x0eMaxHdcpVersion\x18\x04 \x01(\x0e\x32\x34.ClientIdentification.ClientCapabilities.HdcpVersion\x12\x1b\n\x13OemCryptoApiVersion\x18\x05 \x01(\r\"T\n\x0bHdcpVersion\x12\r\n\tHDCP_NONE\x10\x00\x12\x0b\n\x07HDCP_V1\x10\x01\x12\x0b\n\x07HDCP_V2\x10\x02\x12\r\n\tHDCP_V2_1\x10\x03\x12\r\n\tHDCP_V2_2\x10\x04\"S\n\tTokenType\x12\n\n\x06KEYBOX\x10\x00\x12\x16\n\x12\x44\x45VICE_CERTIFICATE\x10\x01\x12\"\n\x1eREMOTE_ATTESTATION_CERTIFICATE\x10\x02\"\x9b\x02\n\x11\x44\x65viceCertificate\x12\x30\n\x04Type\x18\x01 \x01(\x0e\x32\".DeviceCertificate.CertificateType\x12\x14\n\x0cSerialNumber\x18\x02 \x01(\x0c\x12\x1b\n\x13\x43reationTimeSeconds\x18\x03 \x01(\r\x12\x11\n\tPublicKey\x18\x04 \x01(\x0c\x12\x10\n\x08SystemId\x18\x05 \x01(\r\x12\x1c\n\x14TestDeviceDeprecated\x18\x06 \x01(\r\x12\x11\n\tServiceId\x18\x07 \x01(\x0c\"K\n\x0f\x43\x65rtificateType\x12\x08\n\x04ROOT\x10\x00\x12\x10\n\x0cINTERMEDIATE\x10\x01\x12\x0f\n\x0bUSER_DEVICE\x10\x02\x12\x0b\n\x07SERVICE\x10\x03\"\xc4\x01\n\x17\x44\x65viceCertificateStatus\x12\x14\n\x0cSerialNumber\x18\x01 \x01(\x0c\x12:\n\x06Status\x18\x02 \x01(\x0e\x32*.DeviceCertificateStatus.CertificateStatus\x12*\n\nDeviceInfo\x18\x04 \x01(\x0b\x32\x16.ProvisionedDeviceInfo\"+\n\x11\x43\x65rtificateStatus\x12\t\n\x05VALID\x10\x00\x12\x0b\n\x07REVOKED\x10\x01\"o\n\x1b\x44\x65viceCertificateStatusList\x12\x1b\n\x13\x43reationTimeSeconds\x18\x01 \x01(\r\x12\x33\n\x11\x43\x65rtificateStatus\x18\x02 \x03(\x0b\x32\x18.DeviceCertificateStatus\"\xaf\x01\n\x1d\x45ncryptedClientIdentification\x12\x11\n\tServiceId\x18\x01 \x01(\t\x12&\n\x1eServiceCertificateSerialNumber\x18\x02 \x01(\x0c\x12\x19\n\x11\x45ncryptedClientId\x18\x03 \x01(\x0c\x12\x1b\n\x13\x45ncryptedClientIdIv\x18\x04 \x01(\x0c\x12\x1b\n\x13\x45ncryptedPrivacyKey\x18\x05 \x01(\x0c\"\x9c\x01\n\x15LicenseIdentification\x12\x11\n\tRequestId\x18\x01 \x01(\x0c\x12\x11\n\tSessionId\x18\x02 \x01(\x0c\x12\x12\n\nPurchaseId\x18\x03 \x01(\x0c\x12\x1a\n\x04Type\x18\x04 \x01(\x0e\x32\x0c.LicenseType\x12\x0f\n\x07Version\x18\x05 \x01(\r\x12\x1c\n\x14ProviderSessionToken\x18\x06 \x01(\x0c\"\xfa\x0e\n\x07License\x12\"\n\x02Id\x18\x01 \x01(\x0b\x32\x16.LicenseIdentification\x12 \n\x07_Policy\x18\x02 \x01(\x0b\x32\x0f.License.Policy\x12\"\n\x03Key\x18\x03 \x03(\x0b\x32\x15.License.KeyContainer\x12\x18\n\x10LicenseStartTime\x18\x04 \x01(\r\x12!\n\x19RemoteAttestationVerified\x18\x05 \x01(\r\x12\x1b\n\x13ProviderClientToken\x18\x06 \x01(\x0c\x12\x18\n\x10ProtectionScheme\x18\x07 \x01(\r\x12\x1c\n\x14UnknownHdcpDataField\x18\x08 \x01(\x0c\x1a\xd4\x02\n\x06Policy\x12\x0f\n\x07\x43\x61nPlay\x18\x01 \x01(\r\x12\x12\n\nCanPersist\x18\x02 \x01(\r\x12\x10\n\x08\x43\x61nRenew\x18\x03 \x01(\r\x12\x1d\n\x15RentalDurationSeconds\x18\x04 \x01(\r\x12\x1f\n\x17PlaybackDurationSeconds\x18\x05 \x01(\r\x12\x1e\n\x16LicenseDurationSeconds\x18\x06 \x01(\r\x12&\n\x1eRenewalRecoveryDurationSeconds\x18\x07 \x01(\r\x12\x18\n\x10RenewalServerUrl\x18\x08 \x01(\t\x12\x1b\n\x13RenewalDelaySeconds\x18\t \x01(\r\x12#\n\x1bRenewalRetryIntervalSeconds\x18\n \x01(\r\x12\x16\n\x0eRenewWithUsage\x18\x0b \x01(\r\x12\x17\n\x0fUnknownPolicy12\x18\x0c \x01(\r\x1a\x9b\n\n\x0cKeyContainer\x12\n\n\x02Id\x18\x01 \x01(\x0c\x12\n\n\x02Iv\x18\x02 \x01(\x0c\x12\x0b\n\x03Key\x18\x03 \x01(\x0c\x12+\n\x04Type\x18\x04 \x01(\x0e\x32\x1d.License.KeyContainer.KeyType\x12\x32\n\x05Level\x18\x05 \x01(\x0e\x32#.License.KeyContainer.SecurityLevel\x12\x42\n\x12RequiredProtection\x18\x06 \x01(\x0b\x32&.License.KeyContainer.OutputProtection\x12\x43\n\x13RequestedProtection\x18\x07 \x01(\x0b\x32&.License.KeyContainer.OutputProtection\x12\x35\n\x0b_KeyControl\x18\x08 \x01(\x0b\x32 .License.KeyContainer.KeyControl\x12[\n\x1e_OperatorSessionKeyPermissions\x18\t \x01(\x0b\x32\x33.License.KeyContainer.OperatorSessionKeyPermissions\x12S\n\x1aVideoResolutionConstraints\x18\n \x03(\x0b\x32/.License.KeyContainer.VideoResolutionConstraint\x1a\xdb\x01\n\x10OutputProtection\x12\x42\n\x04Hdcp\x18\x01 \x01(\x0e\x32\x34.ClientIdentification.ClientCapabilities.HdcpVersion\x12>\n\tCgmsFlags\x18\x02 \x01(\x0e\x32+.License.KeyContainer.OutputProtection.CGMS\"C\n\x04\x43GMS\x12\r\n\tCOPY_FREE\x10\x00\x12\r\n\tCOPY_ONCE\x10\x02\x12\x0e\n\nCOPY_NEVER\x10\x03\x12\r\n\tCGMS_NONE\x10*\x1a\x31\n\nKeyControl\x12\x17\n\x0fKeyControlBlock\x18\x01 \x01(\x0c\x12\n\n\x02Iv\x18\x02 \x01(\x0c\x1a|\n\x1dOperatorSessionKeyPermissions\x12\x14\n\x0c\x41llowEncrypt\x18\x01 \x01(\r\x12\x14\n\x0c\x41llowDecrypt\x18\x02 \x01(\r\x12\x11\n\tAllowSign\x18\x03 \x01(\r\x12\x1c\n\x14\x41llowSignatureVerify\x18\x04 \x01(\r\x1a\x99\x01\n\x19VideoResolutionConstraint\x12\x1b\n\x13MinResolutionPixels\x18\x01 \x01(\r\x12\x1b\n\x13MaxResolutionPixels\x18\x02 \x01(\r\x12\x42\n\x12RequiredProtection\x18\x03 \x01(\x0b\x32&.License.KeyContainer.OutputProtection\"Z\n\x07KeyType\x12\x0e\n\n_NOKEYTYPE\x10\x00\x12\x0b\n\x07SIGNING\x10\x01\x12\x0b\n\x07\x43ONTENT\x10\x02\x12\x0f\n\x0bKEY_CONTROL\x10\x03\x12\x14\n\x10OPERATOR_SESSION\x10\x04\"\x8b\x01\n\rSecurityLevel\x12\x0f\n\x0b_NOSECLEVEL\x10\x00\x12\x14\n\x10SW_SECURE_CRYPTO\x10\x01\x12\x14\n\x10SW_SECURE_DECODE\x10\x02\x12\x14\n\x10HW_SECURE_CRYPTO\x10\x03\x12\x14\n\x10HW_SECURE_DECODE\x10\x04\x12\x11\n\rHW_SECURE_ALL\x10\x05\"\xac\x01\n\x0cLicenseError\x12&\n\tErrorCode\x18\x01 \x01(\x0e\x32\x13.LicenseError.Error\"t\n\x05\x45rror\x12\x12\n\x0e\x44UMMY_NO_ERROR\x10\x00\x12\x1e\n\x1aINVALID_DEVICE_CERTIFICATE\x10\x01\x12\x1e\n\x1aREVOKED_DEVICE_CERTIFICATE\x10\x02\x12\x17\n\x13SERVICE_UNAVAILABLE\x10\x03\"\xc0\x07\n\x0eLicenseRequest\x12\'\n\x08\x43lientId\x18\x01 \x01(\x0b\x32\x15.ClientIdentification\x12\x38\n\tContentId\x18\x02 \x01(\x0b\x32%.LicenseRequest.ContentIdentification\x12)\n\x04Type\x18\x03 \x01(\x0e\x32\x1b.LicenseRequest.RequestType\x12\x13\n\x0bRequestTime\x18\x04 \x01(\r\x12!\n\x19KeyControlNonceDeprecated\x18\x05 \x01(\x0c\x12)\n\x0fProtocolVersion\x18\x06 \x01(\x0e\x32\x10.ProtocolVersion\x12\x17\n\x0fKeyControlNonce\x18\x07 \x01(\r\x12\x39\n\x11\x45ncryptedClientId\x18\x08 \x01(\x0b\x32\x1e.EncryptedClientIdentification\x1a\xa2\x04\n\x15\x43ontentIdentification\x12:\n\x06\x43\x65ncId\x18\x01 \x01(\x0b\x32*.LicenseRequest.ContentIdentification.CENC\x12:\n\x06WebmId\x18\x02 \x01(\x0b\x32*.LicenseRequest.ContentIdentification.WebM\x12\x46\n\x07License\x18\x03 \x01(\x0b\x32\x35.LicenseRequest.ContentIdentification.ExistingLicense\x1a_\n\x04\x43\x45NC\x12!\n\x04Pssh\x18\x01 \x01(\x0b\x32\x13.WidevineCencHeader\x12!\n\x0bLicenseType\x18\x02 \x01(\x0e\x32\x0c.LicenseType\x12\x11\n\tRequestId\x18\x03 \x01(\x0c\x1aL\n\x04WebM\x12\x0e\n\x06Header\x18\x01 \x01(\x0c\x12!\n\x0bLicenseType\x18\x02 \x01(\x0e\x32\x0c.LicenseType\x12\x11\n\tRequestId\x18\x03 \x01(\x0c\x1a\x99\x01\n\x0f\x45xistingLicense\x12)\n\tLicenseId\x18\x01 \x01(\x0b\x32\x16.LicenseIdentification\x12\x1b\n\x13SecondsSinceStarted\x18\x02 \x01(\r\x12\x1e\n\x16SecondsSinceLastPlayed\x18\x03 \x01(\r\x12\x1e\n\x16SessionUsageTableEntry\x18\x04 \x01(\x0c\"D\n\x0bRequestType\x12\x12\n\x0e\x44UMMY_REQ_TYPE\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\x0b\n\x07RENEWAL\x10\x02\x12\x0b\n\x07RELEASE\x10\x03\"\xa6\x02\n\x15ProvisionedDeviceInfo\x12\x10\n\x08SystemId\x18\x01 \x01(\r\x12\x0b\n\x03Soc\x18\x02 \x01(\t\x12\x14\n\x0cManufacturer\x18\x03 \x01(\t\x12\r\n\x05Model\x18\x04 \x01(\t\x12\x12\n\nDeviceType\x18\x05 \x01(\t\x12\x11\n\tModelYear\x18\x06 \x01(\r\x12=\n\rSecurityLevel\x18\x07 \x01(\x0e\x32&.ProvisionedDeviceInfo.WvSecurityLevel\x12\x12\n\nTestDevice\x18\x08 \x01(\r\"O\n\x0fWvSecurityLevel\x12\x15\n\x11LEVEL_UNSPECIFIED\x10\x00\x12\x0b\n\x07LEVEL_1\x10\x01\x12\x0b\n\x07LEVEL_2\x10\x02\x12\x0b\n\x07LEVEL_3\x10\x03\"\x15\n\x13ProvisioningOptions\"\x15\n\x13ProvisioningRequest\"\x16\n\x14ProvisioningResponse\"i\n\x11RemoteAttestation\x12\x33\n\x0b\x43\x65rtificate\x18\x01 \x01(\x0b\x32\x1e.EncryptedClientIdentification\x12\x0c\n\x04Salt\x18\x02 \x01(\t\x12\x11\n\tSignature\x18\x03 \x01(\t\"\r\n\x0bSessionInit\"\x0e\n\x0cSessionState\"\x1d\n\x1bSignedCertificateStatusList\"\x86\x01\n\x17SignedDeviceCertificate\x12.\n\x12_DeviceCertificate\x18\x01 \x01(\x0b\x32\x12.DeviceCertificate\x12\x11\n\tSignature\x18\x02 \x01(\x0c\x12(\n\x06Signer\x18\x03 \x01(\x0b\x32\x18.SignedDeviceCertificate\"\x1b\n\x19SignedProvisioningMessage\"\xb0\x02\n\rSignedMessage\x12(\n\x04Type\x18\x01 \x01(\x0e\x32\x1a.SignedMessage.MessageType\x12\x0b\n\x03Msg\x18\x02 \x01(\x0c\x12\x11\n\tSignature\x18\x03 \x01(\x0c\x12\x12\n\nSessionKey\x18\x04 \x01(\x0c\x12-\n\x11RemoteAttestation\x18\x05 \x01(\x0b\x32\x12.RemoteAttestation\"\x91\x01\n\x0bMessageType\x12\x12\n\x0e\x44UMMY_MSG_TYPE\x10\x00\x12\x13\n\x0fLICENSE_REQUEST\x10\x01\x12\x0b\n\x07LICENSE\x10\x02\x12\x12\n\x0e\x45RROR_RESPONSE\x10\x03\x12\x1f\n\x1bSERVICE_CERTIFICATE_REQUEST\x10\x04\x12\x17\n\x13SERVICE_CERTIFICATE\x10\x05\"\xc5\x02\n\x12WidevineCencHeader\x12\x30\n\talgorithm\x18\x01 \x01(\x0e\x32\x1d.WidevineCencHeader.Algorithm\x12\x0e\n\x06key_id\x18\x02 \x03(\x0c\x12\x10\n\x08provider\x18\x03 \x01(\t\x12\x12\n\ncontent_id\x18\x04 \x01(\x0c\x12\x1d\n\x15track_type_deprecated\x18\x05 \x01(\t\x12\x0e\n\x06policy\x18\x06 \x01(\t\x12\x1b\n\x13\x63rypto_period_index\x18\x07 \x01(\r\x12\x17\n\x0fgrouped_license\x18\x08 \x01(\x0c\x12\x19\n\x11protection_scheme\x18\t \x01(\r\x12\x1d\n\x15\x63rypto_period_seconds\x18\n \x01(\r\"(\n\tAlgorithm\x12\x0f\n\x0bUNENCRYPTED\x10\x00\x12\n\n\x06\x41\x45SCTR\x10\x01\"\xcf\x02\n\x14SignedLicenseRequest\x12/\n\x04Type\x18\x01 \x01(\x0e\x32!.SignedLicenseRequest.MessageType\x12\x1c\n\x03Msg\x18\x02 \x01(\x0b\x32\x0f.LicenseRequest\x12\x11\n\tSignature\x18\x03 \x01(\x0c\x12\x12\n\nSessionKey\x18\x04 \x01(\x0c\x12-\n\x11RemoteAttestation\x18\x05 \x01(\x0b\x32\x12.RemoteAttestation\"\x91\x01\n\x0bMessageType\x12\x12\n\x0e\x44UMMY_MSG_TYPE\x10\x00\x12\x13\n\x0fLICENSE_REQUEST\x10\x01\x12\x0b\n\x07LICENSE\x10\x02\x12\x12\n\x0e\x45RROR_RESPONSE\x10\x03\x12\x1f\n\x1bSERVICE_CERTIFICATE_REQUEST\x10\x04\x12\x17\n\x13SERVICE_CERTIFICATE\x10\x05\"\xba\x02\n\rSignedLicense\x12(\n\x04Type\x18\x01 \x01(\x0e\x32\x1a.SignedLicense.MessageType\x12\x15\n\x03Msg\x18\x02 \x01(\x0b\x32\x08.License\x12\x11\n\tSignature\x18\x03 \x01(\x0c\x12\x12\n\nSessionKey\x18\x04 \x01(\x0c\x12-\n\x11RemoteAttestation\x18\x05 \x01(\x0b\x32\x12.RemoteAttestation\"\x91\x01\n\x0bMessageType\x12\x12\n\x0e\x44UMMY_MSG_TYPE\x10\x00\x12\x13\n\x0fLICENSE_REQUEST\x10\x01\x12\x0b\n\x07LICENSE\x10\x02\x12\x12\n\x0e\x45RROR_RESPONSE\x10\x03\x12\x1f\n\x1bSERVICE_CERTIFICATE_REQUEST\x10\x04\x12\x17\n\x13SERVICE_CERTIFICATE\x10\x05*$\n\x0bLicenseType\x12\x08\n\x04ZERO\x10\x00\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x01*)\n\x0fProtocolVersion\x12\t\n\x05\x44UMMY\x10\x00\x12\x0b\n\x07\x43URRENT\x10\x15\x62\x06proto3')
)
_LICENSETYPE = _descriptor.EnumDescriptor(
name='LicenseType',
full_name='LicenseType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='ZERO', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='DEFAULT', index=1, number=1,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=6713,
serialized_end=6749,
)
_sym_db.RegisterEnumDescriptor(_LICENSETYPE)
LicenseType = enum_type_wrapper.EnumTypeWrapper(_LICENSETYPE)
_PROTOCOLVERSION = _descriptor.EnumDescriptor(
name='ProtocolVersion',
full_name='ProtocolVersion',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='DUMMY', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CURRENT', index=1, number=21,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=6751,
serialized_end=6792,
)
_sym_db.RegisterEnumDescriptor(_PROTOCOLVERSION)
ProtocolVersion = enum_type_wrapper.EnumTypeWrapper(_PROTOCOLVERSION)
ZERO = 0
DEFAULT = 1
DUMMY = 0
CURRENT = 21
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION = _descriptor.EnumDescriptor(
name='HdcpVersion',
full_name='ClientIdentification.ClientCapabilities.HdcpVersion',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='HDCP_NONE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HDCP_V1', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HDCP_V2', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HDCP_V2_1', index=3, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HDCP_V2_2', index=4, number=4,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=560,
serialized_end=644,
)
_sym_db.RegisterEnumDescriptor(_CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION)
_CLIENTIDENTIFICATION_TOKENTYPE = _descriptor.EnumDescriptor(
name='TokenType',
full_name='ClientIdentification.TokenType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='KEYBOX', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='DEVICE_CERTIFICATE', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='REMOTE_ATTESTATION_CERTIFICATE', index=2, number=2,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=646,
serialized_end=729,
)
_sym_db.RegisterEnumDescriptor(_CLIENTIDENTIFICATION_TOKENTYPE)
_DEVICECERTIFICATE_CERTIFICATETYPE = _descriptor.EnumDescriptor(
name='CertificateType',
full_name='DeviceCertificate.CertificateType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='ROOT', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='INTERMEDIATE', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='USER_DEVICE', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE', index=3, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=940,
serialized_end=1015,
)
_sym_db.RegisterEnumDescriptor(_DEVICECERTIFICATE_CERTIFICATETYPE)
_DEVICECERTIFICATESTATUS_CERTIFICATESTATUS = _descriptor.EnumDescriptor(
name='CertificateStatus',
full_name='DeviceCertificateStatus.CertificateStatus',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='VALID', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='REVOKED', index=1, number=1,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=1171,
serialized_end=1214,
)
_sym_db.RegisterEnumDescriptor(_DEVICECERTIFICATESTATUS_CERTIFICATESTATUS)
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION_CGMS = _descriptor.EnumDescriptor(
name='CGMS',
full_name='License.KeyContainer.OutputProtection.CGMS',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='COPY_FREE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='COPY_ONCE', index=1, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='COPY_NEVER', index=2, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CGMS_NONE', index=3, number=42,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=2947,
serialized_end=3014,
)
_sym_db.RegisterEnumDescriptor(_LICENSE_KEYCONTAINER_OUTPUTPROTECTION_CGMS)
_LICENSE_KEYCONTAINER_KEYTYPE = _descriptor.EnumDescriptor(
name='KeyType',
full_name='License.KeyContainer.KeyType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='_NOKEYTYPE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SIGNING', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='CONTENT', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='KEY_CONTROL', index=3, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='OPERATOR_SESSION', index=4, number=4,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=3349,
serialized_end=3439,
)
_sym_db.RegisterEnumDescriptor(_LICENSE_KEYCONTAINER_KEYTYPE)
_LICENSE_KEYCONTAINER_SECURITYLEVEL = _descriptor.EnumDescriptor(
name='SecurityLevel',
full_name='License.KeyContainer.SecurityLevel',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='_NOSECLEVEL', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SW_SECURE_CRYPTO', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SW_SECURE_DECODE', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HW_SECURE_CRYPTO', index=3, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HW_SECURE_DECODE', index=4, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='HW_SECURE_ALL', index=5, number=5,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=3442,
serialized_end=3581,
)
_sym_db.RegisterEnumDescriptor(_LICENSE_KEYCONTAINER_SECURITYLEVEL)
_LICENSEERROR_ERROR = _descriptor.EnumDescriptor(
name='Error',
full_name='LicenseError.Error',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='DUMMY_NO_ERROR', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='INVALID_DEVICE_CERTIFICATE', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='REVOKED_DEVICE_CERTIFICATE', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_UNAVAILABLE', index=3, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=3640,
serialized_end=3756,
)
_sym_db.RegisterEnumDescriptor(_LICENSEERROR_ERROR)
_LICENSEREQUEST_REQUESTTYPE = _descriptor.EnumDescriptor(
name='RequestType',
full_name='LicenseRequest.RequestType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='DUMMY_REQ_TYPE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='NEW', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='RENEWAL', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='RELEASE', index=3, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=4651,
serialized_end=4719,
)
_sym_db.RegisterEnumDescriptor(_LICENSEREQUEST_REQUESTTYPE)
_PROVISIONEDDEVICEINFO_WVSECURITYLEVEL = _descriptor.EnumDescriptor(
name='WvSecurityLevel',
full_name='ProvisionedDeviceInfo.WvSecurityLevel',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='LEVEL_UNSPECIFIED', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LEVEL_1', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LEVEL_2', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LEVEL_3', index=3, number=3,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=4937,
serialized_end=5016,
)
_sym_db.RegisterEnumDescriptor(_PROVISIONEDDEVICEINFO_WVSECURITYLEVEL)
_SIGNEDMESSAGE_MESSAGETYPE = _descriptor.EnumDescriptor(
name='MessageType',
full_name='SignedMessage.MessageType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='DUMMY_MSG_TYPE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE_REQUEST', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ERROR_RESPONSE', index=3, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE_REQUEST', index=4, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE', index=5, number=5,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=5583,
serialized_end=5728,
)
_sym_db.RegisterEnumDescriptor(_SIGNEDMESSAGE_MESSAGETYPE)
_WIDEVINECENCHEADER_ALGORITHM = _descriptor.EnumDescriptor(
name='Algorithm',
full_name='WidevineCencHeader.Algorithm',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='UNENCRYPTED', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='AESCTR', index=1, number=1,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=6016,
serialized_end=6056,
)
_sym_db.RegisterEnumDescriptor(_WIDEVINECENCHEADER_ALGORITHM)
_SIGNEDLICENSEREQUEST_MESSAGETYPE = _descriptor.EnumDescriptor(
name='MessageType',
full_name='SignedLicenseRequest.MessageType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='DUMMY_MSG_TYPE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE_REQUEST', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ERROR_RESPONSE', index=3, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE_REQUEST', index=4, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE', index=5, number=5,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=5583,
serialized_end=5728,
)
_sym_db.RegisterEnumDescriptor(_SIGNEDLICENSEREQUEST_MESSAGETYPE)
_SIGNEDLICENSE_MESSAGETYPE = _descriptor.EnumDescriptor(
name='MessageType',
full_name='SignedLicense.MessageType',
filename=None,
file=DESCRIPTOR,
values=[
_descriptor.EnumValueDescriptor(
name='DUMMY_MSG_TYPE', index=0, number=0,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE_REQUEST', index=1, number=1,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='LICENSE', index=2, number=2,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='ERROR_RESPONSE', index=3, number=3,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE_REQUEST', index=4, number=4,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='SERVICE_CERTIFICATE', index=5, number=5,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=5583,
serialized_end=5728,
)
_sym_db.RegisterEnumDescriptor(_SIGNEDLICENSE_MESSAGETYPE)
_CLIENTIDENTIFICATION_NAMEVALUE = _descriptor.Descriptor(
name='NameValue',
full_name='ClientIdentification.NameValue',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Name', full_name='ClientIdentification.NameValue.Name', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Value', full_name='ClientIdentification.NameValue.Value', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=309,
serialized_end=349,
)
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES = _descriptor.Descriptor(
name='ClientCapabilities',
full_name='ClientIdentification.ClientCapabilities',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ClientToken', full_name='ClientIdentification.ClientCapabilities.ClientToken', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionToken', full_name='ClientIdentification.ClientCapabilities.SessionToken', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='VideoResolutionConstraints', full_name='ClientIdentification.ClientCapabilities.VideoResolutionConstraints', index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='MaxHdcpVersion', full_name='ClientIdentification.ClientCapabilities.MaxHdcpVersion', index=3,
number=4, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='OemCryptoApiVersion', full_name='ClientIdentification.ClientCapabilities.OemCryptoApiVersion', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=352,
serialized_end=644,
)
_CLIENTIDENTIFICATION = _descriptor.Descriptor(
name='ClientIdentification',
full_name='ClientIdentification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='ClientIdentification.Type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Token', full_name='ClientIdentification.Token', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ClientInfo', full_name='ClientIdentification.ClientInfo', index=2,
number=3, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProviderClientToken', full_name='ClientIdentification.ProviderClientToken', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseCounter', full_name='ClientIdentification.LicenseCounter', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='_ClientCapabilities', full_name='ClientIdentification._ClientCapabilities', index=5,
number=6, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_CLIENTIDENTIFICATION_NAMEVALUE, _CLIENTIDENTIFICATION_CLIENTCAPABILITIES, ],
enum_types=[
_CLIENTIDENTIFICATION_TOKENTYPE,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=20,
serialized_end=729,
)
_DEVICECERTIFICATE = _descriptor.Descriptor(
name='DeviceCertificate',
full_name='DeviceCertificate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='DeviceCertificate.Type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SerialNumber', full_name='DeviceCertificate.SerialNumber', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='CreationTimeSeconds', full_name='DeviceCertificate.CreationTimeSeconds', index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='PublicKey', full_name='DeviceCertificate.PublicKey', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SystemId', full_name='DeviceCertificate.SystemId', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='TestDeviceDeprecated', full_name='DeviceCertificate.TestDeviceDeprecated', index=5,
number=6, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ServiceId', full_name='DeviceCertificate.ServiceId', index=6,
number=7, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_DEVICECERTIFICATE_CERTIFICATETYPE,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=732,
serialized_end=1015,
)
_DEVICECERTIFICATESTATUS = _descriptor.Descriptor(
name='DeviceCertificateStatus',
full_name='DeviceCertificateStatus',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='SerialNumber', full_name='DeviceCertificateStatus.SerialNumber', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Status', full_name='DeviceCertificateStatus.Status', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='DeviceInfo', full_name='DeviceCertificateStatus.DeviceInfo', index=2,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_DEVICECERTIFICATESTATUS_CERTIFICATESTATUS,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1018,
serialized_end=1214,
)
_DEVICECERTIFICATESTATUSLIST = _descriptor.Descriptor(
name='DeviceCertificateStatusList',
full_name='DeviceCertificateStatusList',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='CreationTimeSeconds', full_name='DeviceCertificateStatusList.CreationTimeSeconds', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='CertificateStatus', full_name='DeviceCertificateStatusList.CertificateStatus', index=1,
number=2, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1216,
serialized_end=1327,
)
_ENCRYPTEDCLIENTIDENTIFICATION = _descriptor.Descriptor(
name='EncryptedClientIdentification',
full_name='EncryptedClientIdentification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ServiceId', full_name='EncryptedClientIdentification.ServiceId', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ServiceCertificateSerialNumber', full_name='EncryptedClientIdentification.ServiceCertificateSerialNumber', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='EncryptedClientId', full_name='EncryptedClientIdentification.EncryptedClientId', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='EncryptedClientIdIv', full_name='EncryptedClientIdentification.EncryptedClientIdIv', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='EncryptedPrivacyKey', full_name='EncryptedClientIdentification.EncryptedPrivacyKey', index=4,
number=5, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1330,
serialized_end=1505,
)
_LICENSEIDENTIFICATION = _descriptor.Descriptor(
name='LicenseIdentification',
full_name='LicenseIdentification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='RequestId', full_name='LicenseIdentification.RequestId', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionId', full_name='LicenseIdentification.SessionId', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='PurchaseId', full_name='LicenseIdentification.PurchaseId', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Type', full_name='LicenseIdentification.Type', index=3,
number=4, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Version', full_name='LicenseIdentification.Version', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProviderSessionToken', full_name='LicenseIdentification.ProviderSessionToken', index=5,
number=6, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1508,
serialized_end=1664,
)
_LICENSE_POLICY = _descriptor.Descriptor(
name='Policy',
full_name='License.Policy',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='CanPlay', full_name='License.Policy.CanPlay', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='CanPersist', full_name='License.Policy.CanPersist', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='CanRenew', full_name='License.Policy.CanRenew', index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RentalDurationSeconds', full_name='License.Policy.RentalDurationSeconds', index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='PlaybackDurationSeconds', full_name='License.Policy.PlaybackDurationSeconds', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseDurationSeconds', full_name='License.Policy.LicenseDurationSeconds', index=5,
number=6, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RenewalRecoveryDurationSeconds', full_name='License.Policy.RenewalRecoveryDurationSeconds', index=6,
number=7, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RenewalServerUrl', full_name='License.Policy.RenewalServerUrl', index=7,
number=8, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RenewalDelaySeconds', full_name='License.Policy.RenewalDelaySeconds', index=8,
number=9, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RenewalRetryIntervalSeconds', full_name='License.Policy.RenewalRetryIntervalSeconds', index=9,
number=10, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RenewWithUsage', full_name='License.Policy.RenewWithUsage', index=10,
number=11, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='UnknownPolicy12', full_name='License.Policy.UnknownPolicy12', index=11,
number=12, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1931,
serialized_end=2271,
)
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION = _descriptor.Descriptor(
name='OutputProtection',
full_name='License.KeyContainer.OutputProtection',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Hdcp', full_name='License.KeyContainer.OutputProtection.Hdcp', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='CgmsFlags', full_name='License.KeyContainer.OutputProtection.CgmsFlags', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION_CGMS,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2795,
serialized_end=3014,
)
_LICENSE_KEYCONTAINER_KEYCONTROL = _descriptor.Descriptor(
name='KeyControl',
full_name='License.KeyContainer.KeyControl',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='KeyControlBlock', full_name='License.KeyContainer.KeyControl.KeyControlBlock', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Iv', full_name='License.KeyContainer.KeyControl.Iv', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=3016,
serialized_end=3065,
)
_LICENSE_KEYCONTAINER_OPERATORSESSIONKEYPERMISSIONS = _descriptor.Descriptor(
name='OperatorSessionKeyPermissions',
full_name='License.KeyContainer.OperatorSessionKeyPermissions',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='AllowEncrypt', full_name='License.KeyContainer.OperatorSessionKeyPermissions.AllowEncrypt', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='AllowDecrypt', full_name='License.KeyContainer.OperatorSessionKeyPermissions.AllowDecrypt', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='AllowSign', full_name='License.KeyContainer.OperatorSessionKeyPermissions.AllowSign', index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='AllowSignatureVerify', full_name='License.KeyContainer.OperatorSessionKeyPermissions.AllowSignatureVerify', index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=3067,
serialized_end=3191,
)
_LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT = _descriptor.Descriptor(
name='VideoResolutionConstraint',
full_name='License.KeyContainer.VideoResolutionConstraint',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='MinResolutionPixels', full_name='License.KeyContainer.VideoResolutionConstraint.MinResolutionPixels', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='MaxResolutionPixels', full_name='License.KeyContainer.VideoResolutionConstraint.MaxResolutionPixels', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequiredProtection', full_name='License.KeyContainer.VideoResolutionConstraint.RequiredProtection', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=3194,
serialized_end=3347,
)
_LICENSE_KEYCONTAINER = _descriptor.Descriptor(
name='KeyContainer',
full_name='License.KeyContainer',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Id', full_name='License.KeyContainer.Id', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Iv', full_name='License.KeyContainer.Iv', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Key', full_name='License.KeyContainer.Key', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Type', full_name='License.KeyContainer.Type', index=3,
number=4, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Level', full_name='License.KeyContainer.Level', index=4,
number=5, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequiredProtection', full_name='License.KeyContainer.RequiredProtection', index=5,
number=6, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestedProtection', full_name='License.KeyContainer.RequestedProtection', index=6,
number=7, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='_KeyControl', full_name='License.KeyContainer._KeyControl', index=7,
number=8, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='_OperatorSessionKeyPermissions', full_name='License.KeyContainer._OperatorSessionKeyPermissions', index=8,
number=9, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='VideoResolutionConstraints', full_name='License.KeyContainer.VideoResolutionConstraints', index=9,
number=10, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_LICENSE_KEYCONTAINER_OUTPUTPROTECTION, _LICENSE_KEYCONTAINER_KEYCONTROL, _LICENSE_KEYCONTAINER_OPERATORSESSIONKEYPERMISSIONS, _LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT, ],
enum_types=[
_LICENSE_KEYCONTAINER_KEYTYPE,
_LICENSE_KEYCONTAINER_SECURITYLEVEL,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2274,
serialized_end=3581,
)
_LICENSE = _descriptor.Descriptor(
name='License',
full_name='License',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Id', full_name='License.Id', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='_Policy', full_name='License._Policy', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Key', full_name='License.Key', index=2,
number=3, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseStartTime', full_name='License.LicenseStartTime', index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RemoteAttestationVerified', full_name='License.RemoteAttestationVerified', index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProviderClientToken', full_name='License.ProviderClientToken', index=5,
number=6, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProtectionScheme', full_name='License.ProtectionScheme', index=6,
number=7, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='UnknownHdcpDataField', full_name='License.UnknownHdcpDataField', index=7,
number=8, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_LICENSE_POLICY, _LICENSE_KEYCONTAINER, ],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1667,
serialized_end=3581,
)
_LICENSEERROR = _descriptor.Descriptor(
name='LicenseError',
full_name='LicenseError',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ErrorCode', full_name='LicenseError.ErrorCode', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_LICENSEERROR_ERROR,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=3584,
serialized_end=3756,
)
_LICENSEREQUEST_CONTENTIDENTIFICATION_CENC = _descriptor.Descriptor(
name='CENC',
full_name='LicenseRequest.ContentIdentification.CENC',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Pssh', full_name='LicenseRequest.ContentIdentification.CENC.Pssh', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseType', full_name='LicenseRequest.ContentIdentification.CENC.LicenseType', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestId', full_name='LicenseRequest.ContentIdentification.CENC.RequestId', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=4320,
serialized_end=4415,
)
_LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM = _descriptor.Descriptor(
name='WebM',
full_name='LicenseRequest.ContentIdentification.WebM',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Header', full_name='LicenseRequest.ContentIdentification.WebM.Header', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='LicenseType', full_name='LicenseRequest.ContentIdentification.WebM.LicenseType', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestId', full_name='LicenseRequest.ContentIdentification.WebM.RequestId', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=4417,
serialized_end=4493,
)
_LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE = _descriptor.Descriptor(
name='ExistingLicense',
full_name='LicenseRequest.ContentIdentification.ExistingLicense',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='LicenseId', full_name='LicenseRequest.ContentIdentification.ExistingLicense.LicenseId', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SecondsSinceStarted', full_name='LicenseRequest.ContentIdentification.ExistingLicense.SecondsSinceStarted', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SecondsSinceLastPlayed', full_name='LicenseRequest.ContentIdentification.ExistingLicense.SecondsSinceLastPlayed', index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionUsageTableEntry', full_name='LicenseRequest.ContentIdentification.ExistingLicense.SessionUsageTableEntry', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=4496,
serialized_end=4649,
)
_LICENSEREQUEST_CONTENTIDENTIFICATION = _descriptor.Descriptor(
name='ContentIdentification',
full_name='LicenseRequest.ContentIdentification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='CencId', full_name='LicenseRequest.ContentIdentification.CencId', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='WebmId', full_name='LicenseRequest.ContentIdentification.WebmId', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='License', full_name='LicenseRequest.ContentIdentification.License', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_LICENSEREQUEST_CONTENTIDENTIFICATION_CENC, _LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM, _LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE, ],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=4103,
serialized_end=4649,
)
_LICENSEREQUEST = _descriptor.Descriptor(
name='LicenseRequest',
full_name='LicenseRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ClientId', full_name='LicenseRequest.ClientId', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ContentId', full_name='LicenseRequest.ContentId', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Type', full_name='LicenseRequest.Type', index=2,
number=3, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RequestTime', full_name='LicenseRequest.RequestTime', index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='KeyControlNonceDeprecated', full_name='LicenseRequest.KeyControlNonceDeprecated', index=4,
number=5, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ProtocolVersion', full_name='LicenseRequest.ProtocolVersion', index=5,
number=6, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='KeyControlNonce', full_name='LicenseRequest.KeyControlNonce', index=6,
number=7, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='EncryptedClientId', full_name='LicenseRequest.EncryptedClientId', index=7,
number=8, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[_LICENSEREQUEST_CONTENTIDENTIFICATION, ],
enum_types=[
_LICENSEREQUEST_REQUESTTYPE,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=3759,
serialized_end=4719,
)
_PROVISIONEDDEVICEINFO = _descriptor.Descriptor(
name='ProvisionedDeviceInfo',
full_name='ProvisionedDeviceInfo',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='SystemId', full_name='ProvisionedDeviceInfo.SystemId', index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Soc', full_name='ProvisionedDeviceInfo.Soc', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Manufacturer', full_name='ProvisionedDeviceInfo.Manufacturer', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Model', full_name='ProvisionedDeviceInfo.Model', index=3,
number=4, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='DeviceType', full_name='ProvisionedDeviceInfo.DeviceType', index=4,
number=5, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='ModelYear', full_name='ProvisionedDeviceInfo.ModelYear', index=5,
number=6, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SecurityLevel', full_name='ProvisionedDeviceInfo.SecurityLevel', index=6,
number=7, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='TestDevice', full_name='ProvisionedDeviceInfo.TestDevice', index=7,
number=8, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_PROVISIONEDDEVICEINFO_WVSECURITYLEVEL,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=4722,
serialized_end=5016,
)
_PROVISIONINGOPTIONS = _descriptor.Descriptor(
name='ProvisioningOptions',
full_name='ProvisioningOptions',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5018,
serialized_end=5039,
)
_PROVISIONINGREQUEST = _descriptor.Descriptor(
name='ProvisioningRequest',
full_name='ProvisioningRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5041,
serialized_end=5062,
)
_PROVISIONINGRESPONSE = _descriptor.Descriptor(
name='ProvisioningResponse',
full_name='ProvisioningResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5064,
serialized_end=5086,
)
_REMOTEATTESTATION = _descriptor.Descriptor(
name='RemoteAttestation',
full_name='RemoteAttestation',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Certificate', full_name='RemoteAttestation.Certificate', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Salt', full_name='RemoteAttestation.Salt', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='RemoteAttestation.Signature', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5088,
serialized_end=5193,
)
_SESSIONINIT = _descriptor.Descriptor(
name='SessionInit',
full_name='SessionInit',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5195,
serialized_end=5208,
)
_SESSIONSTATE = _descriptor.Descriptor(
name='SessionState',
full_name='SessionState',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5210,
serialized_end=5224,
)
_SIGNEDCERTIFICATESTATUSLIST = _descriptor.Descriptor(
name='SignedCertificateStatusList',
full_name='SignedCertificateStatusList',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5226,
serialized_end=5255,
)
_SIGNEDDEVICECERTIFICATE = _descriptor.Descriptor(
name='SignedDeviceCertificate',
full_name='SignedDeviceCertificate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='_DeviceCertificate', full_name='SignedDeviceCertificate._DeviceCertificate', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='SignedDeviceCertificate.Signature', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signer', full_name='SignedDeviceCertificate.Signer', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5258,
serialized_end=5392,
)
_SIGNEDPROVISIONINGMESSAGE = _descriptor.Descriptor(
name='SignedProvisioningMessage',
full_name='SignedProvisioningMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5394,
serialized_end=5421,
)
_SIGNEDMESSAGE = _descriptor.Descriptor(
name='SignedMessage',
full_name='SignedMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='SignedMessage.Type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Msg', full_name='SignedMessage.Msg', index=1,
number=2, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='SignedMessage.Signature', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionKey', full_name='SignedMessage.SessionKey', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RemoteAttestation', full_name='SignedMessage.RemoteAttestation', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_SIGNEDMESSAGE_MESSAGETYPE,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5424,
serialized_end=5728,
)
_WIDEVINECENCHEADER = _descriptor.Descriptor(
name='WidevineCencHeader',
full_name='WidevineCencHeader',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='algorithm', full_name='WidevineCencHeader.algorithm', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='key_id', full_name='WidevineCencHeader.key_id', index=1,
number=2, type=12, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='provider', full_name='WidevineCencHeader.provider', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='content_id', full_name='WidevineCencHeader.content_id', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='track_type_deprecated', full_name='WidevineCencHeader.track_type_deprecated', index=4,
number=5, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='policy', full_name='WidevineCencHeader.policy', index=5,
number=6, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='crypto_period_index', full_name='WidevineCencHeader.crypto_period_index', index=6,
number=7, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='grouped_license', full_name='WidevineCencHeader.grouped_license', index=7,
number=8, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='protection_scheme', full_name='WidevineCencHeader.protection_scheme', index=8,
number=9, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='crypto_period_seconds', full_name='WidevineCencHeader.crypto_period_seconds', index=9,
number=10, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_WIDEVINECENCHEADER_ALGORITHM,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=5731,
serialized_end=6056,
)
_SIGNEDLICENSEREQUEST = _descriptor.Descriptor(
name='SignedLicenseRequest',
full_name='SignedLicenseRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='SignedLicenseRequest.Type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Msg', full_name='SignedLicenseRequest.Msg', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='SignedLicenseRequest.Signature', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionKey', full_name='SignedLicenseRequest.SessionKey', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RemoteAttestation', full_name='SignedLicenseRequest.RemoteAttestation', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_SIGNEDLICENSEREQUEST_MESSAGETYPE,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=6059,
serialized_end=6394,
)
_SIGNEDLICENSE = _descriptor.Descriptor(
name='SignedLicense',
full_name='SignedLicense',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='Type', full_name='SignedLicense.Type', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Msg', full_name='SignedLicense.Msg', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='Signature', full_name='SignedLicense.Signature', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='SessionKey', full_name='SignedLicense.SessionKey', index=3,
number=4, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='RemoteAttestation', full_name='SignedLicense.RemoteAttestation', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
_SIGNEDLICENSE_MESSAGETYPE,
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=6397,
serialized_end=6711,
)
_CLIENTIDENTIFICATION_NAMEVALUE.containing_type = _CLIENTIDENTIFICATION
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES.fields_by_name['MaxHdcpVersion'].enum_type = _CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES.containing_type = _CLIENTIDENTIFICATION
_CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION.containing_type = _CLIENTIDENTIFICATION_CLIENTCAPABILITIES
_CLIENTIDENTIFICATION.fields_by_name['Type'].enum_type = _CLIENTIDENTIFICATION_TOKENTYPE
_CLIENTIDENTIFICATION.fields_by_name['Token'].message_type = _SIGNEDDEVICECERTIFICATE
_CLIENTIDENTIFICATION.fields_by_name['ClientInfo'].message_type = _CLIENTIDENTIFICATION_NAMEVALUE
_CLIENTIDENTIFICATION.fields_by_name['_ClientCapabilities'].message_type = _CLIENTIDENTIFICATION_CLIENTCAPABILITIES
_CLIENTIDENTIFICATION_TOKENTYPE.containing_type = _CLIENTIDENTIFICATION
_DEVICECERTIFICATE.fields_by_name['Type'].enum_type = _DEVICECERTIFICATE_CERTIFICATETYPE
_DEVICECERTIFICATE_CERTIFICATETYPE.containing_type = _DEVICECERTIFICATE
_DEVICECERTIFICATESTATUS.fields_by_name['Status'].enum_type = _DEVICECERTIFICATESTATUS_CERTIFICATESTATUS
_DEVICECERTIFICATESTATUS.fields_by_name['DeviceInfo'].message_type = _PROVISIONEDDEVICEINFO
_DEVICECERTIFICATESTATUS_CERTIFICATESTATUS.containing_type = _DEVICECERTIFICATESTATUS
_DEVICECERTIFICATESTATUSLIST.fields_by_name['CertificateStatus'].message_type = _DEVICECERTIFICATESTATUS
_LICENSEIDENTIFICATION.fields_by_name['Type'].enum_type = _LICENSETYPE
_LICENSE_POLICY.containing_type = _LICENSE
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION.fields_by_name['Hdcp'].enum_type = _CLIENTIDENTIFICATION_CLIENTCAPABILITIES_HDCPVERSION
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION.fields_by_name['CgmsFlags'].enum_type = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION_CGMS
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION.containing_type = _LICENSE_KEYCONTAINER
_LICENSE_KEYCONTAINER_OUTPUTPROTECTION_CGMS.containing_type = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION
_LICENSE_KEYCONTAINER_KEYCONTROL.containing_type = _LICENSE_KEYCONTAINER
_LICENSE_KEYCONTAINER_OPERATORSESSIONKEYPERMISSIONS.containing_type = _LICENSE_KEYCONTAINER
_LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT.fields_by_name['RequiredProtection'].message_type = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION
_LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT.containing_type = _LICENSE_KEYCONTAINER
_LICENSE_KEYCONTAINER.fields_by_name['Type'].enum_type = _LICENSE_KEYCONTAINER_KEYTYPE
_LICENSE_KEYCONTAINER.fields_by_name['Level'].enum_type = _LICENSE_KEYCONTAINER_SECURITYLEVEL
_LICENSE_KEYCONTAINER.fields_by_name['RequiredProtection'].message_type = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION
_LICENSE_KEYCONTAINER.fields_by_name['RequestedProtection'].message_type = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION
_LICENSE_KEYCONTAINER.fields_by_name['_KeyControl'].message_type = _LICENSE_KEYCONTAINER_KEYCONTROL
_LICENSE_KEYCONTAINER.fields_by_name['_OperatorSessionKeyPermissions'].message_type = _LICENSE_KEYCONTAINER_OPERATORSESSIONKEYPERMISSIONS
_LICENSE_KEYCONTAINER.fields_by_name['VideoResolutionConstraints'].message_type = _LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT
_LICENSE_KEYCONTAINER.containing_type = _LICENSE
_LICENSE_KEYCONTAINER_KEYTYPE.containing_type = _LICENSE_KEYCONTAINER
_LICENSE_KEYCONTAINER_SECURITYLEVEL.containing_type = _LICENSE_KEYCONTAINER
_LICENSE.fields_by_name['Id'].message_type = _LICENSEIDENTIFICATION
_LICENSE.fields_by_name['_Policy'].message_type = _LICENSE_POLICY
_LICENSE.fields_by_name['Key'].message_type = _LICENSE_KEYCONTAINER
_LICENSEERROR.fields_by_name['ErrorCode'].enum_type = _LICENSEERROR_ERROR
_LICENSEERROR_ERROR.containing_type = _LICENSEERROR
_LICENSEREQUEST_CONTENTIDENTIFICATION_CENC.fields_by_name['Pssh'].message_type = _WIDEVINECENCHEADER
_LICENSEREQUEST_CONTENTIDENTIFICATION_CENC.fields_by_name['LicenseType'].enum_type = _LICENSETYPE
_LICENSEREQUEST_CONTENTIDENTIFICATION_CENC.containing_type = _LICENSEREQUEST_CONTENTIDENTIFICATION
_LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM.fields_by_name['LicenseType'].enum_type = _LICENSETYPE
_LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM.containing_type = _LICENSEREQUEST_CONTENTIDENTIFICATION
_LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE.fields_by_name['LicenseId'].message_type = _LICENSEIDENTIFICATION
_LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE.containing_type = _LICENSEREQUEST_CONTENTIDENTIFICATION
_LICENSEREQUEST_CONTENTIDENTIFICATION.fields_by_name['CencId'].message_type = _LICENSEREQUEST_CONTENTIDENTIFICATION_CENC
_LICENSEREQUEST_CONTENTIDENTIFICATION.fields_by_name['WebmId'].message_type = _LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM
_LICENSEREQUEST_CONTENTIDENTIFICATION.fields_by_name['License'].message_type = _LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE
_LICENSEREQUEST_CONTENTIDENTIFICATION.containing_type = _LICENSEREQUEST
_LICENSEREQUEST.fields_by_name['ClientId'].message_type = _CLIENTIDENTIFICATION
_LICENSEREQUEST.fields_by_name['ContentId'].message_type = _LICENSEREQUEST_CONTENTIDENTIFICATION
_LICENSEREQUEST.fields_by_name['Type'].enum_type = _LICENSEREQUEST_REQUESTTYPE
_LICENSEREQUEST.fields_by_name['ProtocolVersion'].enum_type = _PROTOCOLVERSION
_LICENSEREQUEST.fields_by_name['EncryptedClientId'].message_type = _ENCRYPTEDCLIENTIDENTIFICATION
_LICENSEREQUEST_REQUESTTYPE.containing_type = _LICENSEREQUEST
_PROVISIONEDDEVICEINFO.fields_by_name['SecurityLevel'].enum_type = _PROVISIONEDDEVICEINFO_WVSECURITYLEVEL
_PROVISIONEDDEVICEINFO_WVSECURITYLEVEL.containing_type = _PROVISIONEDDEVICEINFO
_REMOTEATTESTATION.fields_by_name['Certificate'].message_type = _ENCRYPTEDCLIENTIDENTIFICATION
_SIGNEDDEVICECERTIFICATE.fields_by_name['_DeviceCertificate'].message_type = _DEVICECERTIFICATE
_SIGNEDDEVICECERTIFICATE.fields_by_name['Signer'].message_type = _SIGNEDDEVICECERTIFICATE
_SIGNEDMESSAGE.fields_by_name['Type'].enum_type = _SIGNEDMESSAGE_MESSAGETYPE
_SIGNEDMESSAGE.fields_by_name['RemoteAttestation'].message_type = _REMOTEATTESTATION
_SIGNEDMESSAGE_MESSAGETYPE.containing_type = _SIGNEDMESSAGE
_WIDEVINECENCHEADER.fields_by_name['algorithm'].enum_type = _WIDEVINECENCHEADER_ALGORITHM
_WIDEVINECENCHEADER_ALGORITHM.containing_type = _WIDEVINECENCHEADER
_SIGNEDLICENSEREQUEST.fields_by_name['Type'].enum_type = _SIGNEDLICENSEREQUEST_MESSAGETYPE
_SIGNEDLICENSEREQUEST.fields_by_name['Msg'].message_type = _LICENSEREQUEST
_SIGNEDLICENSEREQUEST.fields_by_name['RemoteAttestation'].message_type = _REMOTEATTESTATION
_SIGNEDLICENSEREQUEST_MESSAGETYPE.containing_type = _SIGNEDLICENSEREQUEST
_SIGNEDLICENSE.fields_by_name['Type'].enum_type = _SIGNEDLICENSE_MESSAGETYPE
_SIGNEDLICENSE.fields_by_name['Msg'].message_type = _LICENSE
_SIGNEDLICENSE.fields_by_name['RemoteAttestation'].message_type = _REMOTEATTESTATION
_SIGNEDLICENSE_MESSAGETYPE.containing_type = _SIGNEDLICENSE
DESCRIPTOR.message_types_by_name['ClientIdentification'] = _CLIENTIDENTIFICATION
DESCRIPTOR.message_types_by_name['DeviceCertificate'] = _DEVICECERTIFICATE
DESCRIPTOR.message_types_by_name['DeviceCertificateStatus'] = _DEVICECERTIFICATESTATUS
DESCRIPTOR.message_types_by_name['DeviceCertificateStatusList'] = _DEVICECERTIFICATESTATUSLIST
DESCRIPTOR.message_types_by_name['EncryptedClientIdentification'] = _ENCRYPTEDCLIENTIDENTIFICATION
DESCRIPTOR.message_types_by_name['LicenseIdentification'] = _LICENSEIDENTIFICATION
DESCRIPTOR.message_types_by_name['License'] = _LICENSE
DESCRIPTOR.message_types_by_name['LicenseError'] = _LICENSEERROR
DESCRIPTOR.message_types_by_name['LicenseRequest'] = _LICENSEREQUEST
DESCRIPTOR.message_types_by_name['ProvisionedDeviceInfo'] = _PROVISIONEDDEVICEINFO
DESCRIPTOR.message_types_by_name['ProvisioningOptions'] = _PROVISIONINGOPTIONS
DESCRIPTOR.message_types_by_name['ProvisioningRequest'] = _PROVISIONINGREQUEST
DESCRIPTOR.message_types_by_name['ProvisioningResponse'] = _PROVISIONINGRESPONSE
DESCRIPTOR.message_types_by_name['RemoteAttestation'] = _REMOTEATTESTATION
DESCRIPTOR.message_types_by_name['SessionInit'] = _SESSIONINIT
DESCRIPTOR.message_types_by_name['SessionState'] = _SESSIONSTATE
DESCRIPTOR.message_types_by_name['SignedCertificateStatusList'] = _SIGNEDCERTIFICATESTATUSLIST
DESCRIPTOR.message_types_by_name['SignedDeviceCertificate'] = _SIGNEDDEVICECERTIFICATE
DESCRIPTOR.message_types_by_name['SignedProvisioningMessage'] = _SIGNEDPROVISIONINGMESSAGE
DESCRIPTOR.message_types_by_name['SignedMessage'] = _SIGNEDMESSAGE
DESCRIPTOR.message_types_by_name['WidevineCencHeader'] = _WIDEVINECENCHEADER
DESCRIPTOR.message_types_by_name['SignedLicenseRequest'] = _SIGNEDLICENSEREQUEST
DESCRIPTOR.message_types_by_name['SignedLicense'] = _SIGNEDLICENSE
DESCRIPTOR.enum_types_by_name['LicenseType'] = _LICENSETYPE
DESCRIPTOR.enum_types_by_name['ProtocolVersion'] = _PROTOCOLVERSION
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
ClientIdentification = _reflection.GeneratedProtocolMessageType('ClientIdentification', (_message.Message,), dict(
NameValue = _reflection.GeneratedProtocolMessageType('NameValue', (_message.Message,), dict(
DESCRIPTOR = _CLIENTIDENTIFICATION_NAMEVALUE,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:ClientIdentification.NameValue)
))
,
ClientCapabilities = _reflection.GeneratedProtocolMessageType('ClientCapabilities', (_message.Message,), dict(
DESCRIPTOR = _CLIENTIDENTIFICATION_CLIENTCAPABILITIES,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:ClientIdentification.ClientCapabilities)
))
,
DESCRIPTOR = _CLIENTIDENTIFICATION,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:ClientIdentification)
))
_sym_db.RegisterMessage(ClientIdentification)
_sym_db.RegisterMessage(ClientIdentification.NameValue)
_sym_db.RegisterMessage(ClientIdentification.ClientCapabilities)
DeviceCertificate = _reflection.GeneratedProtocolMessageType('DeviceCertificate', (_message.Message,), dict(
DESCRIPTOR = _DEVICECERTIFICATE,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:DeviceCertificate)
))
_sym_db.RegisterMessage(DeviceCertificate)
DeviceCertificateStatus = _reflection.GeneratedProtocolMessageType('DeviceCertificateStatus', (_message.Message,), dict(
DESCRIPTOR = _DEVICECERTIFICATESTATUS,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:DeviceCertificateStatus)
))
_sym_db.RegisterMessage(DeviceCertificateStatus)
DeviceCertificateStatusList = _reflection.GeneratedProtocolMessageType('DeviceCertificateStatusList', (_message.Message,), dict(
DESCRIPTOR = _DEVICECERTIFICATESTATUSLIST,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:DeviceCertificateStatusList)
))
_sym_db.RegisterMessage(DeviceCertificateStatusList)
EncryptedClientIdentification = _reflection.GeneratedProtocolMessageType('EncryptedClientIdentification', (_message.Message,), dict(
DESCRIPTOR = _ENCRYPTEDCLIENTIDENTIFICATION,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:EncryptedClientIdentification)
))
_sym_db.RegisterMessage(EncryptedClientIdentification)
LicenseIdentification = _reflection.GeneratedProtocolMessageType('LicenseIdentification', (_message.Message,), dict(
DESCRIPTOR = _LICENSEIDENTIFICATION,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:LicenseIdentification)
))
_sym_db.RegisterMessage(LicenseIdentification)
License = _reflection.GeneratedProtocolMessageType('License', (_message.Message,), dict(
Policy = _reflection.GeneratedProtocolMessageType('Policy', (_message.Message,), dict(
DESCRIPTOR = _LICENSE_POLICY,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:License.Policy)
))
,
KeyContainer = _reflection.GeneratedProtocolMessageType('KeyContainer', (_message.Message,), dict(
OutputProtection = _reflection.GeneratedProtocolMessageType('OutputProtection', (_message.Message,), dict(
DESCRIPTOR = _LICENSE_KEYCONTAINER_OUTPUTPROTECTION,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:License.KeyContainer.OutputProtection)
))
,
KeyControl = _reflection.GeneratedProtocolMessageType('KeyControl', (_message.Message,), dict(
DESCRIPTOR = _LICENSE_KEYCONTAINER_KEYCONTROL,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:License.KeyContainer.KeyControl)
))
,
OperatorSessionKeyPermissions = _reflection.GeneratedProtocolMessageType('OperatorSessionKeyPermissions', (_message.Message,), dict(
DESCRIPTOR = _LICENSE_KEYCONTAINER_OPERATORSESSIONKEYPERMISSIONS,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:License.KeyContainer.OperatorSessionKeyPermissions)
))
,
VideoResolutionConstraint = _reflection.GeneratedProtocolMessageType('VideoResolutionConstraint', (_message.Message,), dict(
DESCRIPTOR = _LICENSE_KEYCONTAINER_VIDEORESOLUTIONCONSTRAINT,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:License.KeyContainer.VideoResolutionConstraint)
))
,
DESCRIPTOR = _LICENSE_KEYCONTAINER,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:License.KeyContainer)
))
,
DESCRIPTOR = _LICENSE,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:License)
))
_sym_db.RegisterMessage(License)
_sym_db.RegisterMessage(License.Policy)
_sym_db.RegisterMessage(License.KeyContainer)
_sym_db.RegisterMessage(License.KeyContainer.OutputProtection)
_sym_db.RegisterMessage(License.KeyContainer.KeyControl)
_sym_db.RegisterMessage(License.KeyContainer.OperatorSessionKeyPermissions)
_sym_db.RegisterMessage(License.KeyContainer.VideoResolutionConstraint)
LicenseError = _reflection.GeneratedProtocolMessageType('LicenseError', (_message.Message,), dict(
DESCRIPTOR = _LICENSEERROR,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:LicenseError)
))
_sym_db.RegisterMessage(LicenseError)
LicenseRequest = _reflection.GeneratedProtocolMessageType('LicenseRequest', (_message.Message,), dict(
ContentIdentification = _reflection.GeneratedProtocolMessageType('ContentIdentification', (_message.Message,), dict(
CENC = _reflection.GeneratedProtocolMessageType('CENC', (_message.Message,), dict(
DESCRIPTOR = _LICENSEREQUEST_CONTENTIDENTIFICATION_CENC,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequest.ContentIdentification.CENC)
))
,
WebM = _reflection.GeneratedProtocolMessageType('WebM', (_message.Message,), dict(
DESCRIPTOR = _LICENSEREQUEST_CONTENTIDENTIFICATION_WEBM,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequest.ContentIdentification.WebM)
))
,
ExistingLicense = _reflection.GeneratedProtocolMessageType('ExistingLicense', (_message.Message,), dict(
DESCRIPTOR = _LICENSEREQUEST_CONTENTIDENTIFICATION_EXISTINGLICENSE,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequest.ContentIdentification.ExistingLicense)
))
,
DESCRIPTOR = _LICENSEREQUEST_CONTENTIDENTIFICATION,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequest.ContentIdentification)
))
,
DESCRIPTOR = _LICENSEREQUEST,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:LicenseRequest)
))
_sym_db.RegisterMessage(LicenseRequest)
_sym_db.RegisterMessage(LicenseRequest.ContentIdentification)
_sym_db.RegisterMessage(LicenseRequest.ContentIdentification.CENC)
_sym_db.RegisterMessage(LicenseRequest.ContentIdentification.WebM)
_sym_db.RegisterMessage(LicenseRequest.ContentIdentification.ExistingLicense)
ProvisionedDeviceInfo = _reflection.GeneratedProtocolMessageType('ProvisionedDeviceInfo', (_message.Message,), dict(
DESCRIPTOR = _PROVISIONEDDEVICEINFO,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:ProvisionedDeviceInfo)
))
_sym_db.RegisterMessage(ProvisionedDeviceInfo)
ProvisioningOptions = _reflection.GeneratedProtocolMessageType('ProvisioningOptions', (_message.Message,), dict(
DESCRIPTOR = _PROVISIONINGOPTIONS,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:ProvisioningOptions)
))
_sym_db.RegisterMessage(ProvisioningOptions)
ProvisioningRequest = _reflection.GeneratedProtocolMessageType('ProvisioningRequest', (_message.Message,), dict(
DESCRIPTOR = _PROVISIONINGREQUEST,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:ProvisioningRequest)
))
_sym_db.RegisterMessage(ProvisioningRequest)
ProvisioningResponse = _reflection.GeneratedProtocolMessageType('ProvisioningResponse', (_message.Message,), dict(
DESCRIPTOR = _PROVISIONINGRESPONSE,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:ProvisioningResponse)
))
_sym_db.RegisterMessage(ProvisioningResponse)
RemoteAttestation = _reflection.GeneratedProtocolMessageType('RemoteAttestation', (_message.Message,), dict(
DESCRIPTOR = _REMOTEATTESTATION,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:RemoteAttestation)
))
_sym_db.RegisterMessage(RemoteAttestation)
SessionInit = _reflection.GeneratedProtocolMessageType('SessionInit', (_message.Message,), dict(
DESCRIPTOR = _SESSIONINIT,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:SessionInit)
))
_sym_db.RegisterMessage(SessionInit)
SessionState = _reflection.GeneratedProtocolMessageType('SessionState', (_message.Message,), dict(
DESCRIPTOR = _SESSIONSTATE,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:SessionState)
))
_sym_db.RegisterMessage(SessionState)
SignedCertificateStatusList = _reflection.GeneratedProtocolMessageType('SignedCertificateStatusList', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDCERTIFICATESTATUSLIST,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:SignedCertificateStatusList)
))
_sym_db.RegisterMessage(SignedCertificateStatusList)
SignedDeviceCertificate = _reflection.GeneratedProtocolMessageType('SignedDeviceCertificate', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDDEVICECERTIFICATE,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:SignedDeviceCertificate)
))
_sym_db.RegisterMessage(SignedDeviceCertificate)
SignedProvisioningMessage = _reflection.GeneratedProtocolMessageType('SignedProvisioningMessage', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDPROVISIONINGMESSAGE,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:SignedProvisioningMessage)
))
_sym_db.RegisterMessage(SignedProvisioningMessage)
SignedMessage = _reflection.GeneratedProtocolMessageType('SignedMessage', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDMESSAGE,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:SignedMessage)
))
_sym_db.RegisterMessage(SignedMessage)
WidevineCencHeader = _reflection.GeneratedProtocolMessageType('WidevineCencHeader', (_message.Message,), dict(
DESCRIPTOR = _WIDEVINECENCHEADER,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:WidevineCencHeader)
))
_sym_db.RegisterMessage(WidevineCencHeader)
SignedLicenseRequest = _reflection.GeneratedProtocolMessageType('SignedLicenseRequest', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDLICENSEREQUEST,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:SignedLicenseRequest)
))
_sym_db.RegisterMessage(SignedLicenseRequest)
SignedLicense = _reflection.GeneratedProtocolMessageType('SignedLicense', (_message.Message,), dict(
DESCRIPTOR = _SIGNEDLICENSE,
__module__ = 'wv_proto3_pb2'
# @@protoc_insertion_point(class_scope:SignedLicense)
))
_sym_db.RegisterMessage(SignedLicense)
# @@protoc_insertion_point(module_scope)
| 108,748 | Python | .py | 2,566 | 37.731878 | 11,437 | 0.738097 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,330 | wvdecryptconfig.py | Bbalduzz_phantomplus/pywidevine/decrypt/wvdecryptconfig.py | import pywidevine.downloader.wvdownloaderconfig as wvdl_cfg
class WvDecryptConfig(object):
def __init__(self, filename, tracktype, trackno, license, init_data_b64, cert_data_b64=None):
self.filename = filename
self.tracktype = tracktype
self.trackno = trackno
self.init_data_b64 = init_data_b64
self.license = license
if cert_data_b64 is not None:
self.server_cert_required = True
self.cert_data_b64 = cert_data_b64
else:
self.server_cert_required = False
def get_filename(self, unformatted_filename):
return unformatted_filename.format(filename=self.filename, track_type=self.tracktype, track_no=self.trackno)
def build_commandline_list(self, keys):
commandline = [wvdl_cfg.MP4DECRYPT_BINARY_PATH]
for key in keys:
if key.type == 'CONTENT':
commandline.append('--key')
commandline.append('{}:{}'.format(key.kid.hex(), key.key.hex()))
commandline.append(self.get_filename(wvdl_cfg.ENCRYPTED_FILENAME))
commandline.append(self.get_filename(wvdl_cfg.DECRYPTED_FILENAME))
return commandline
| 1,187 | Python | .py | 24 | 40.166667 | 116 | 0.664655 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,331 | wvdecrypt.py | Bbalduzz_phantomplus/pywidevine/decrypt/wvdecrypt.py | import logging
import subprocess
import re
from tqdm import tqdm
import base64
from pywidevine.cdm import cdm, deviceconfig
class WvDecrypt(object):
WV_SYSTEM_ID = [237, 239, 139, 169, 121, 214, 74, 206, 163, 200, 39, 220, 213, 29, 33, 237]
def __init__(self, PSSH):
self.logger = logging.getLogger(__name__)
self.wvdecrypt_process = None
self.pssh = PSSH
self.cdm = cdm.Cdm()
def check_pssh(pssh_b64):
pssh = base64.b64decode(pssh_b64)
if not pssh[12:28] == bytes(self.WV_SYSTEM_ID):
new_pssh = bytearray([0, 0, 0])
new_pssh.append(32 + len(pssh))
new_pssh[4:] = bytearray(b"pssh")
new_pssh[8:] = [0, 0, 0, 0]
new_pssh[13:] = self.WV_SYSTEM_ID
new_pssh[29:] = [0, 0, 0, 0]
new_pssh[31] = len(pssh)
new_pssh[32:] = pssh
return base64.b64encode(new_pssh)
else:
return pssh_b64
self.session = self.cdm.open_session(check_pssh(self.pssh), deviceconfig.DeviceConfig(deviceconfig.private_l3_cdm))
def start_process(self):
keyswvdecrypt = []
try:
for key in self.cdm.get_keys(self.session):
if key.type == "CONTENT":
keyswvdecrypt.append("{}:{}".format(key.kid.hex(), key.key.hex()))
except:
return False, keyswvdecrypt
return True, keyswvdecrypt
def get_challenge(self):
return self.cdm.get_license_request(self.session)
def update_license(self, license_b64):
self.cdm.provide_license(self.session, license_b64)
return True
| 1,720 | Python | .py | 42 | 30.404762 | 123 | 0.573929 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,332 | utils.py | Bbalduzz_phantomplus/utils/utils.py | import sys
def progress_bar(total, progress, textname):
barLength, status = 20, ""
progress = float(progress) / float(total)
if progress >= 1.:
progress, status = 1, "\r\n"
block = int(round(barLength * progress))
text = "\r[+] Merging: {} [{}] {:.0f}% {}".format(
textname, "#" * block + "-" * (barLength - block), round(progress * 100, 0),
status)
sys.stdout.write(text)
sys.stdout.flush() | 404 | Python | .py | 12 | 31.666667 | 78 | 0.641221 | Bbalduzz/phantomplus | 8 | 2 | 1 | AGPL-3.0 | 9/5/2024, 10:48:09 PM (Europe/Amsterdam) |
2,287,333 | setup.py | moyanj_AList3SDK/setup.py | from setuptools import setup, find_packages
import time
setup(
name="alist3",
version="1.1.4",
description="AListV3 PythonSDK",
author="MoYan",
packages=find_packages(),
long_description=open("readme.md").read(), # 包的详细描述
long_description_content_type="text/markdown", # 描述的内容类型
install_requires=[
# 添加你的依赖库
"requests",
],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
],
)
| 682 | Python | .py | 22 | 23.590909 | 61 | 0.628433 | moyanj/AList3SDK | 8 | 1 | 0 | LGPL-2.1 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,334 | test.py | moyanj_AList3SDK/test.py | from alist import AList, AListUser
adm = AListUser("admin", "12r5jhdgchghjkrttjnbg6gxnkuufj[p8tcr8ufyy")
print(adm.dumps(rawpwd=True)) | 135 | Python | .py | 3 | 44 | 69 | 0.825758 | moyanj/AList3SDK | 8 | 1 | 0 | LGPL-2.1 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,335 | error.py | moyanj_AList3SDK/alist/error.py | class AListError(Exception):
pass
class AuthenticationError(AListError):
pass
class ServerError(AListError):
pass
class SecurityWarning(Warning):
pass | 170 | Python | .py | 8 | 17.875 | 38 | 0.798742 | moyanj/AList3SDK | 8 | 1 | 0 | LGPL-2.1 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,336 | download.py | moyanj_AList3SDK/alist/download.py | from concurrent.futures import ThreadPoolExecutor
from requests import get, head
import time
class downloader:
def __init__(self, url, num, name):
self.url = url # url
self.num = num # 线程数量
self.name = name # 保存名称
self.getsize = 0 # 文件大小
r = head(self.url, allow_redirects=True)
self.size = int(r.headers['Content-Length'])
def down(self, start, end, chunk_size=10240):
headers = {'range': f'bytes={start}-{end}'} # 头部
r = get(self.url, headers=headers, stream=True)
with open(self.name, "rb+") as f:
f.seek(start)
for chunk in r.iter_content(chunk_size):
actual_chunk_size = len(chunk)
f.write(chunk)
self.getsize += actual_chunk_size
def main(self):
start_time = time.time()
f = open(self.name, 'wb')
f.truncate(self.size)
f.close()
tp = ThreadPoolExecutor(max_workers=self.num)
futures = []
start = 0
chunk_size = self.size // self.num
for i in range(self.num):
start = i * chunk_size
end = start + chunk_size - 1
if i == self.num - 1:
end = self.size - 1 # 调整最后一个片段以确保覆盖剩余的字节
future = tp.submit(self.down, start, end)
futures.append(future)
last_time = time.time()
last_getsize = 0
while True:
current_time = time.time()
current_getsize = self.getsize
time_elapsed = current_time - start_time
if current_getsize > self.size:
current_getsize = self.size
process = current_getsize / self.size * 100
speed = (current_getsize - last_getsize) / (current_time - last_time)
last_getsize = current_getsize
last_time = current_time
if speed >= 1024:
speed_str = f'{speed / 1024/1024:.2f}MB/s'
else:
speed_str = f'{speed / 1024:.2f}KB/s'
print(f'process: {process:.2f}% | speed: {speed_str}', end='\r')
if process >= 99.9:
print(f'process: 100.00% | speed: 00.00KB/s', end=' | ')
break
time.sleep(0.25) # Adjust the interval for smoother progress updates
tp.shutdown()
end_time = time.time()
total_time = end_time - start_time
average_speed = self.size / total_time / 1024 / 1024
print(f'total-time: {total_time:.0f}s | average-speed: {average_speed:.2f}MB/s')
if __name__ == '__main__':
url = 'https://autopatchcn.juequling.com/package_download/op/client_app/download/20240623113017_aqRjyJNQjPi1XNZN/mktbackup2/ZenlessZoneZero_1.0.apk'
down = downloader(url, 12, 'test.mp4')
down.main() | 2,908 | Python | .py | 66 | 32.090909 | 152 | 0.563277 | moyanj/AList3SDK | 8 | 1 | 0 | LGPL-2.1 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,337 | folder.py | moyanj_AList3SDK/alist/folder.py | class AListFolder:
'''
AList文件夹
'''
def __init__(self, path:str, init:dict):
'''
初始化
Args:
path (str):文件夹路径
init (dict):初始化字典
'''
self.path = path
self.provider = init["provider"]
self.size = init["size"]
self.modified = init["modified"]
self.created = init["created"]
def __str__(self):
return self.path
| 493 | Python | .py | 18 | 15.944444 | 44 | 0.49635 | moyanj/AList3SDK | 8 | 1 | 0 | LGPL-2.1 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,338 | file.py | moyanj_AList3SDK/alist/file.py | import requests as _req
class AListFile:
def __init__(self, path, init):
self.path = path
self.name = init["name"]
self.provider = init["provider"]
self.size = init["size"]
self.modified = init["modified"]
self.created = init["created"]
self.url = init["raw_url"]
self.sign = init["sign"]
self.content = None
self.position = 0 # 文件读取位置
def __len__(self):
return self.size
def __str__(self):
return self.path
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, exc_tb):
pass
def download(self):
r = _req.get(self.url)
self.content = r.content
def read(self, n=-1):
if self.content is None:
self.download()
if n == -1:
data = self.content[self.position:]
self.position = self.size # 移动到文件末尾
return data
else:
end_position = min(self.position + n, self.size)
data = self.content[self.position:end_position]
self.position = end_position
return data
def seek(self, offset, whence=0):
if whence == 0:
self.position = offset
elif whence == 1:
self.position += offset
elif whence == 2:
self.position = max(0, self.size + offset) # 防止移动到文件末尾之后
# 确保位置不会超出文件大小
self.position = min(self.position, self.size)
def save(self, path):
if self.content is None:
r = _req.get(self.url)
self.content = r.content
with open(path, "wb") as f:
f.write(self.content)
def close(self):
pass
| 1,808 | Python | .py | 53 | 23.283019 | 69 | 0.545235 | moyanj/AList3SDK | 8 | 1 | 0 | LGPL-2.1 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,339 | utils.py | moyanj_AList3SDK/alist/utils.py | from typing import Union
class ToClass:
def __init__(self, conf: dict):
self._conf_Dict = conf
self.__name__ = "<Standard Dictionary>"
self.update()
def __getattr__(self, name):
if name in self._conf_Dict:
return self._conf_Dict[name]
else:
raise AttributeError(
f"'{self.__class__.__name__}' object has no attribute '{name}'"
)
def update(self, conf: Union[dict, None] = None):
if conf:
self._conf_Dict = conf
# 更新字典
for k, v in self._conf_Dict.items():
if isinstance(v, dict):
setattr(self, k, ToClass(v))
elif isinstance(v, list):
setattr(
self,
k,
[ToClass(item) if isinstance(item, dict) else item for item in v],
)
else:
setattr(self, k, v)
def __str__(self):
return str(self._conf_Dict)
| 1,019 | Python | .py | 30 | 22.133333 | 86 | 0.485656 | moyanj/AList3SDK | 8 | 1 | 0 | LGPL-2.1 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,340 | __init__.py | moyanj_AList3SDK/alist/__init__.py | from .main import AList, AListUser, AListAdmin
from .folder import AListFolder
from .file import AListFile
from .error import *
| 128 | Python | .py | 4 | 31 | 46 | 0.830645 | moyanj/AList3SDK | 8 | 1 | 0 | LGPL-2.1 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,341 | main.py | moyanj_AList3SDK/alist/main.py | # pylint:disable=W0707
import requests
import hashlib
import json
import os.path
import sys
import pickle
import base64
import warnings
from platform import platform
from urllib.parse import quote
from typing import Union
from urllib.parse import urljoin
from . import error, file, folder, utils
class AListUser:
'''
AList用户类
'''
def __init__(self, username: str, rawpwd: str='', pwd=None):
"""
初始化
Args:
username (str):AList的用户名
rawpwd (str):AList的密码(明文)
pwd (str):AList的密码(密文)
"""
self.un = username
if pwd:
self.pwd = pwd
self.rawpwd = None
else:
self.rawpwd = rawpwd
self.pwd = ''
sha = hashlib.sha256()
sha.update(self.rawpwd.encode())
sha.update(b"-https://github.com/alist-org/alist")
self.pwd = sha.hexdigest()
def dump(self,fp, rawpwd=False):
"""
保存
Args:
fp (文件对象):将要保存的文件
rawpwd (bool):保存明文密码
"""
data = {
'username':base64.b64encode(self.un.encode()),
'pwd':base64.b64encode(self.pwd.encode())
}
if rawpwd and self.rawpwd:
warnings.warn('保存明文密码至文件是不安全的',error.SecurityWarning)
data['raw'] = base64.b64encode(self.rawpwd.encode())
pickle.dump(data,fp)
def dumps(self, rawpwd=False):
"""
保存(返回二进制)
Args:
rawpwd (bool):保存明文密码
"""
data = {
'username':base64.b64encode(self.un.encode()),
'pwd':base64.b64encode(self.pwd.encode())
}
if rawpwd and self.rawpwd:
warnings.warn('保存明文密码至文件是不安全的',error.SecurityWarning)
data['raw'] = base64.b64encode(self.rawpwd.encode())
return pickle.dumps(data)
@staticmethod
def load(fp):
"""
加载
Args:
fp (文件对象):将要加载的文件
"""
data = pickle.load(fp)
un = base64.b64decode(data['username']).decode()
pwd = base64.b64decode(data['pwd']).decode()
raw = None
if 'raw' in data:
raw = base64.b64decode(data['raw']).decode()
return AListUser(un,pwd,raw)
@staticmethod
def loads(byte):
"""
加载(从字节)
Args:
byte (bytes): 将要加载的字节
"""
data = pickle.loads(byte)
un = base64.b64decode(data['username']).decode()
pwd = base64.b64decode(data['pwd']).decode()
raw = None
if 'raw' in data:
raw = base64.b64decode(data['raw']).decode()
return AListUser(un,pwd,raw)
def __str__(self):
return f'AListUser({self.un})'
def __repr__(self):
return self.__str__()
class AList:
'''
AList的SDK,此为主类。
'''
def __init__(self, endpoint: str, test:bool=True):
"""
初始化
Args:
endpoint (str):AList地址
test (bool):是否测试服务器可用性
"""
if "http" not in endpoint:
raise ValueError(endpoint + "不是有效的uri")
self.endpoint = endpoint # alist地址
self.token = "" # JWT Token
# 构建UA
ver = [
str(sys.version_info.major),
str(sys.version_info.minor),
str(sys.version_info.micro),
]
ver = ".".join(ver)
pf = platform().split("-")
self.headers = {
"User-Agent": f"AListSDK/1.1.4 (Python{ver};{pf[3]}) {pf[0]}/{pf[1]}",
"Content-Type": "application/json",
"Authorization": "",
}
if test:
self.Test()
def _isBadRequest(self, r, msg):
# 是否为不好的请求
try:
j = json.loads(r.text)
except json.JSONDecodeError:
raise ValueError("服务器返回的数据不是JSON数据")
if j["code"] != 200:
raise error.ServerError(msg + ":" + j["message"])
def _getURL(self, path):
# 获取api端点
return urljoin(self.endpoint, path)
def _parserJson(self, js):
return utils.ToClass(json.loads(js))
def Test(self):
'''
测试服务器可用性
Returns:
(bool): 是否可用
'''
try:
res = requests.get(self._getURL('/ping'),headers=self.headers)
except:
return False
if res.text != 'pong':
return False
return True
def Login(self, user: AListUser, otp_code:str=''):
"""
登录
Args:
user (AListUser): AList用户
Returns:
(bool): 是否成功
"""
password = user.pwd
username = user.un
URL = self._getURL("/api/auth/login/hash")
# 构建json数据
data = {"username": username, "password": password, "otp_code": otp_code}
data = json.dumps(data)
r = requests.post(URL, headers=self.headers, data=data)
# 处理返回数据
self._isBadRequest(r, "账号或密码错误")
# 保存
self.token = json.loads(r.text)["data"]["token"]
self.headers["Authorization"] = self.token
return True
def UserInfo(self):
"""
获取当前登录的用户的信息
Returns:
(dict):一个字典,包含了当前用户的信息。
"""
URL = self._getURL("/api/me")
r = requests.get(URL, headers=self.headers)
return self._parserJson(r.text).data
def ListDir(
self,
path: Union[str, folder.AListFolder],
page: int = 1,
per_page: int = 50,
refresh: bool = False,
password: str = "",
):
"""
列出指定目录下的所有文件或文件夹。
Args:
path (str,AListFolder): 需要列出的目录
page (int): 页数
per_page (int): 每页的数量
refresh (bool): 是否强制刷新
password (str): 目录密码
Returns:
(generator):指定目录下的文件
"""
URL = self._getURL("/api/fs/list")
data = json.dumps(
{
"path": str(path),
"password": password,
"page": page,
"per_page": per_page,
"refresh": refresh,
}
)
r = requests.post(URL, data=data, headers=self.headers)
self._isBadRequest(r, "上传失败")
for item in json.loads(r.text)["data"]["content"]:
i = {"path": os.path.join(str(path), item["name"]), "is_dir": item["is_dir"]}
yield utils.ToClass(i)
def open(
self, path: Union[str, folder.AListFolder, file.AListFile], password: str = ""
):
"""
打开文件/文件夹
Args:
path (str, AListFolder, AListFile): 路径
password (str): 密码
Returns:
(AListFolder): AList目录对象
(AListFile): AList文件对象
"""
URL = self._getURL("/api/fs/get")
data = json.dumps({"path": str(path), "password": password})
r = requests.post(URL, headers=self.headers, data=data)
rjson = json.loads(r.text)
if rjson["data"]["is_dir"]:
return folder.AListFolder(str(path), rjson["data"])
else:
return file.AListFile(str(path), rjson["data"])
def Mkdir(self, path: str):
"""
创建文件夹
Args:
path (str): 要创建的目录
Returns:
(bool): 是否成功
"""
URL = self._getURL("/api/fs/mkdir")
data = json.dumps({"path": path})
r = requests.post(URL, data=data, headers=self.headers)
self._isBadRequest(r, "创建失败")
return True
def Upload(self, path: Union[str, file.AListFile], local: str):
"""
上传文件
Args:
path (str, AListFile): 上传的路径
local (str): 本地路径
Returns:
(bool): 是否成功
"""
URL = self._getURL("/api/fs/put")
files = open(local, "rb").read()
FilePath = quote(str(path))
headers = self.headers.copy()
headers["File-Path"] = FilePath
headers["Content-Length"] = str(len(files))
del headers["Content-Type"]
r = requests.put(URL, data=files, headers=headers)
self._isBadRequest(r, "上传失败")
return True
def Rename(self, src: Union[str, folder.AListFolder, file.AListFile], dst: str):
"""
重命名
Args:
src (str, AListFolder, AListFile): 原名
dst (str): 要更改的名字
Returns:
(bool): 是否成功
"""
URL = self._getURL("/api/fs/rename")
data = json.dumps({"path": str(src), "name": dst})
r = requests.post(URL, headers=self.headers, data=data)
self._isBadRequest(r, "重命名失败")
return True
def Remove(self, path: Union[str, file.AListFile]):
"""
删除
Args:
path (str, AListFile): 要删除的文件
Returns:
(bool): 是否成功
"""
URL = self._getURL("/api/fs/remove")
payload = json.dumps(
{"names": [str(os.path.basename(str(path)))], "dir": str(os.path.dirname(str(path)))}
)
r = requests.post(URL, data=payload, headers=self.headers)
self._isBadRequest(r, "删除失败")
return True
def RemoveFolder(self, path: Union[str, folder.AListFolder]):
"""
删除文件夹(需为空)
Args:
path (str, AListFolder): 文件夹路径
Returns:
(bool): 是否成功
"""
URL = self._getURL("/api/fs/remove_empty_directory")
data = json.dumps({"src_dir": str(path)})
r = requests.post(URL, data=data, headers=self.headers)
self._isBadRequest(r, "删除失败")
return True
def Copy(
self, src: Union[str, file.AListFile], dstDir: Union[str, folder.AListFolder]
):
"""
复制文件
Args:
src (str, AListFile): 源文件
dstDir (str): 要复制到的路径
Returns:
(bool): 是否成功
"""
URL = self._getURL("/api/fs/copy")
data = json.dumps(
{
"src_dir": os.path.dirname(str(src)),
"dst_dir": str(dstDir),
"names": [os.path.basename(str(src))],
}
)
r = requests.post(URL, data=data, headers=self.headers)
self._isBadRequest(r, "复制失败")
return True
def Move(
self, src: Union[str, file.AListFile], dstDir: Union[str, folder.AListFolder]
):
"""
移动文件
Args:
src (str, AListFile): 源文件
dstDir (str): 要移动到的路径
Returns:
(bool): 是否成功
"""
URL = self._getURL("/api/fs/move")
data = json.dumps(
{
"src_dir": os.path.dirname(str(src)),
"dst_dir": str(dstDir),
"names": [os.path.basename(str(src))],
}
)
r = requests.post(URL, data=data, headers=self.headers)
self._isBadRequest(r, "移动失败")
return True
def SiteConfig(self):
"""
获取公开站点配置
Returns:
(ToClass): 配置
"""
url = self._getURL("/api/public/settings")
r = requests.get(url, headers=self.headers)
self._isBadRequest(r, "AList配置信息获取失败")
return self._parserJson(r.text).data
class AListAdmin(AList):
'''
管理员操作
(继承于AList类)
'''
def __init__(self, user:AListUser, endpoint:str, test:bool = True):
'''
初始化
Args:
user (AListUser) : 用户
endpoint (str) : api端点
test (bool) : 是否测试服务器
'''
super().__init__(endpoint, )
self.Login(user)
if self.UserInfo().id != 1:
raise error.AuthenticationError("无权限")
def ListMeta(self, page:int=None, per_page=None):
'''
列出元数据
Args:
page (int) : 页数
per_page (int) : 每页的数量
Return:
(ToClass) 数据
'''
url = self._getURL("/api/admin/meta/list")
prams = {"page": page, "per_page": per_page}
r = requests.get(url, params=prams, headers=self.headers)
self._isBadRequest(r, "无法列出元数据")
return self._parserJson(r.text).data
def GetMeta(self, idx):
'''
获取元数据
Args:
idx (int) : 元数据id
Return:
(ToClass) 数据
'''
url = self._getURL('/api/admin/meta/get')
r = requests.get(url, params={'id':idx},headers=self.headers)
self._isBadRequest(r, '无法找到该元数据')
return self._parserJson(r.text).data
| 13,962 | Python | .py | 409 | 20.958435 | 97 | 0.51866 | moyanj/AList3SDK | 8 | 1 | 0 | LGPL-2.1 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,342 | main.py | holgerson97_pr-labeler/main.py | import os
from pydriller.metrics.process.lines_count import LinesCount
def get_diff_stats(repo_path: str, base: str, head: str) -> int:
metric = LinesCount(path_to_repo=repo_path,
from_commit=base,
to_commit=head)
changed_lines = 0
for lines in metric.count().values():
changed_lines += lines
return changed_lines
def add_label_to_pr(line_count: int):
session = requests.Session()
session.auth = (os.getenv("GITHUB_ACTOR"), os.getenv("GITHUB_API_TOKEN"))
pr_number = os.getenv("GITHUB_REPOSITORY").split('/', 1)[0]
url = os.getenv("GITHUB_API_URL") + "/repos/" + os.getenv("GITHUB_REPOSITORY") + "/issues/" + pr_number + "/labels"
def main():
lines_changed = get_diff_stats("./", os.getenv("GITHUB_BASE_REF"), os.getenv("GITHUB_HEAD_REF"))
print(lines_changed)
if __name__ == "__main__" :
main()
| 909 | Python | .py | 20 | 38.85 | 120 | 0.632839 | holgerson97/pr-labeler | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,343 | runserver.py | calhacks_hammer/runserver.py | # Forked from Gavel by HackMIT / Anish Athalye ([email protected])
#
# This software and Gavel are both released under AGPLv3.
# See the included LICENSE.txt for details.
if __name__ == '__main__':
from hammer import app
import os
extra_files = []
if os.environ.get('DEBUG', False):
app.debug = True
extra_files.append('./config.yaml')
app.run(
host='0.0.0.0',
port=os.environ.get('PORT', 5000),
extra_files=extra_files
)
| 492 | Python | .py | 16 | 25.5 | 68 | 0.634249 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,344 | initialize.py | calhacks_hammer/initialize.py | # Forked from Gavel by HackMIT / Anish Athalye ([email protected])
#
# This software and Gavel are both released under AGPLv3.
# See the included LICENSE.txt for details.
if __name__ == '__main__':
from hammer.models import db
db.create_all()
| 255 | Python | .py | 7 | 34 | 68 | 0.720648 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,345 | crowd_bt.py | calhacks_hammer/hammer/crowd_bt.py | from numpy import (
exp,
log,
)
from scipy.special import (
betaln,
psi,
)
# See this paper for more information:
# http://people.stern.nyu.edu/xchen3/images/crowd_pairwise.pdf
# parameters chosen according to experiments in paper
GAMMA = float(0.1) # tradeoff parameter
LAMBDA = float(1) # regularization parameter
KAPPA = float(0.0001) # to ensure positivity of variance
MU_PRIOR = float(0)
SIGMA_SQ_PRIOR = float(1)
ALPHA_PRIOR = float(10)
BETA_PRIOR = float(1)
EPSILON = 0.25 # epsilon-greedy
def argmax(f, xs):
return max(xs, key=f)
# via https://en.wikipedia.org/wiki/Normal_distribution
def divergence_gaussian(mu_1, sigma_sq_1, mu_2, sigma_sq_2):
ratio = (sigma_sq_1 / sigma_sq_2)
return (mu_1 - mu_2) ** 2 / (2 * sigma_sq_2) + \
(ratio - 1 - log(ratio)) / 2
# via https://en.wikipedia.org/wiki/Beta_distribution
def divergence_beta(alpha_1, beta_1, alpha_2, beta_2):
return betaln(alpha_2, beta_2) - betaln(alpha_1, beta_1) + \
(alpha_1 - alpha_2) * psi(alpha_1) + \
(beta_1 - beta_2) * psi(beta_1) + \
(alpha_2 - alpha_1 + beta_2 - beta_1) * psi(alpha_1 + beta_1)
# returns new (alpha, beta, mu_winner, sigma_sq_winner, mu_loser, sigma_sq_loser)
def update(alpha, beta, mu_winner, sigma_sq_winner, mu_loser, sigma_sq_loser):
(updated_alpha, updated_beta, _) = _updated_annotator(alpha, beta, mu_winner, sigma_sq_winner, mu_loser, sigma_sq_loser)
(updated_mu_winner, updated_mu_loser) = _updated_mus(alpha, beta, mu_winner, sigma_sq_winner, mu_loser, sigma_sq_loser)
(updated_sigma_sq_winner, updated_sigma_sq_loser) = _updated_sigma_sqs(alpha, beta, mu_winner, sigma_sq_winner, mu_loser, sigma_sq_loser)
return (updated_alpha, updated_beta, updated_mu_winner, updated_sigma_sq_winner, updated_mu_loser, updated_sigma_sq_loser)
def expected_information_gain(alpha, beta, mu_a, sigma_sq_a, mu_b, sigma_sq_b):
(alpha_1, beta_1, c) = _updated_annotator(alpha, beta, mu_a, sigma_sq_a, mu_b, sigma_sq_b)
(mu_a_1, mu_b_1) = _updated_mus(alpha, beta, mu_a, sigma_sq_a, mu_b, sigma_sq_b)
(sigma_sq_a_1, sigma_sq_b_1) = _updated_sigma_sqs(alpha, beta, mu_a, sigma_sq_a, mu_b, sigma_sq_b)
prob_a_ranked_above = c
(alpha_2, beta_2, _) = _updated_annotator(alpha, beta, mu_b, sigma_sq_b, mu_a, sigma_sq_a)
(mu_b_2, mu_a_2) = _updated_mus(alpha, beta, mu_b, sigma_sq_b, mu_a, sigma_sq_a)
(sigma_sq_b_2, sigma_sq_a_2) = _updated_sigma_sqs(alpha, beta, mu_b, sigma_sq_b, mu_a, sigma_sq_a)
return \
prob_a_ranked_above * (
divergence_gaussian(mu_a_1, sigma_sq_a_1, mu_a, sigma_sq_a) +
divergence_gaussian(mu_b_1, sigma_sq_b_1, mu_b, sigma_sq_b) +
GAMMA * divergence_beta(alpha_1, beta_1, alpha, beta)) + \
(1 - prob_a_ranked_above) * (
divergence_gaussian(mu_a_2, sigma_sq_a_2, mu_a, sigma_sq_a) +
divergence_gaussian(mu_b_2, sigma_sq_b_2, mu_b, sigma_sq_b) +
GAMMA * divergence_beta(alpha_2, beta_2, alpha, beta))
# returns (updated mu of winner, updated mu of loser)
def _updated_mus(alpha, beta, mu_winner, sigma_sq_winner, mu_loser, sigma_sq_loser):
mult = (alpha * exp(mu_winner)) / (alpha * exp(mu_winner) + beta * exp(mu_loser)) - \
(exp(mu_winner)) / (exp(mu_winner) + exp(mu_loser))
updated_mu_winner = mu_winner + sigma_sq_winner * mult
updated_mu_loser = mu_loser - sigma_sq_loser * mult
return (updated_mu_winner, updated_mu_loser)
# returns (updated sigma squared of winner, updated sigma squared of loser)
def _updated_sigma_sqs(alpha, beta, mu_winner, sigma_sq_winner, mu_loser, sigma_sq_loser):
mult = (alpha * exp(mu_winner) * beta * exp(mu_loser)) / \
((alpha * exp(mu_winner) + beta * exp(mu_loser)) ** 2) - \
(exp(mu_winner) * exp(mu_loser)) / ((exp(mu_winner) + exp(mu_loser)) ** 2)
updated_sigma_sq_winner = sigma_sq_winner * max(1 + sigma_sq_winner * mult, KAPPA)
updated_sigma_sq_loser = sigma_sq_loser * max(1 + sigma_sq_loser * mult, KAPPA)
return (updated_sigma_sq_winner, updated_sigma_sq_loser)
# returns (updated alpha, updated beta, pr i >k j which is c)
def _updated_annotator(alpha, beta, mu_winner, sigma_sq_winner, mu_loser, sigma_sq_loser):
c_1 = exp(mu_winner) / (exp(mu_winner) + exp(mu_loser)) + 0.5 * \
(sigma_sq_winner + sigma_sq_loser) * \
(exp(mu_winner) * exp(mu_loser) * (exp(mu_loser) - exp(mu_winner))) / \
((exp(mu_winner) + exp(mu_loser)) ** 3)
c_2 = 1 - c_1
c = (c_1 * alpha + c_2 * beta) / (alpha + beta)
expt = (c_1 * (alpha + 1) * alpha + c_2 * alpha * beta) / \
(c * (alpha + beta + 1) * (alpha + beta))
expt_sq = (c_1 * (alpha + 2) * (alpha + 1) * alpha + c_2 * (alpha + 1) * alpha * beta) / \
(c * (alpha + beta + 2) * (alpha + beta + 1) * (alpha + beta))
variance = (expt_sq - expt ** 2)
updated_alpha = ((expt - expt_sq) * expt) / variance
updated_beta = (expt - expt_sq) * (1 - expt) / variance
return (updated_alpha, updated_beta, c)
| 5,140 | Python | .py | 86 | 53.5 | 141 | 0.62021 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,346 | settings.py | calhacks_hammer/hammer/settings.py | import hammer.constants as constants
import os
import yaml
BASE_DIR = os.path.dirname(__file__)
CONFIG_FILE = os.path.join(BASE_DIR, '..', 'config.yaml')
NONE_SENTINEL = object() # because default may be None
class Config(object):
def __init__(self, config_file):
if not _bool(os.environ.get('IGNORE_CONFIG_FILE', False)):
with open(config_file) as f:
self._config = yaml.safe_load(f)
else:
self._config = {}
# checks for an environment variable first, then an entry in the config file,
# and then falls back to default
def get(self, name, env_names=None, default=NONE_SENTINEL):
setting = None
if env_names is not None:
if not isinstance(env_names, list):
env_names = [env_names]
for env_name in env_names:
setting = os.environ.get(env_name, None)
if setting is not None:
break
if setting is None:
setting = self._config.get(name, None)
if setting is None:
if default is not NONE_SENTINEL:
return default
else:
raise LookupError('Cannot find value for setting %s' % name)
return setting
def _bool(truth_value):
if isinstance(truth_value, bool):
return truth_value
if isinstance(truth_value, int):
return bool(truth_value)
if isinstance(truth_value, str):
if truth_value.isnumeric():
return bool(int(truth_value))
lower = truth_value.lower()
return lower.startswith('t') or lower.startswith('y') # accepts things like 'yes', 'True', ...
raise ValueError('invalid type for bool coercion')
def _list(item):
if isinstance(item, list):
return item
return [item]
# SQLAlchemy used to support URIs starting with 'postgres://', but it now
# requires that they start with 'postgresql://'. Heroku sets the environment
# variable 'DATABASE_URL' to 'postgres://...', so this breaks our app. This
# function fixes the DB URI.
def _postgres_uri(uri):
if uri.startswith('postgres://'):
return uri.replace('postgres://', 'postgresql://', 1)
return uri
c = Config(CONFIG_FILE)
# note: this should be kept in sync with 'config.template.yaml' and
# 'config.vagrant.yaml'
SERVER_NAME = c.get('server_name', 'SERVER_NAME', default=None)
PROXY = _bool(c.get('proxy', 'PROXY', default=False))
ADMIN_PASSWORD = c.get('admin_password', 'ADMIN_PASSWORD')
DB_URI = _postgres_uri(c.get('db_uri', ['DATABASE_URL', 'DB_URI'], default='postgresql://localhost/hammer'))
BROKER_URI = c.get('broker_uri', ['REDIS_URL', 'BROKER_URI'], default='redis://localhost:6379/0')
SECRET_KEY = c.get('secret_key', 'SECRET_KEY')
MIN_VIEWS = int(c.get('min_views', 'MIN_VIEWS', default=2))
TIMEOUT = float(c.get('timeout', 'TIMEOUT', default=5.0)) # in minutes
WELCOME_MESSAGE = c.get('welcome_message', default=constants.DEFAULT_WELCOME_MESSAGE)
CLOSED_MESSAGE = c.get('closed_message', default=constants.DEFAULT_CLOSED_MESSAGE)
PRESENTING_MESSAGE = c.get('presenting_message', default=constants.DEFAULT_PRESENTING_MESSAGE)
DISABLED_MESSAGE = c.get('disabled_message', default=constants.DEFAULT_DISABLED_MESSAGE)
LOGGED_OUT_MESSAGE = c.get('logged_out_message', default=constants.DEFAULT_LOGGED_OUT_MESSAGE)
WAIT_MESSAGE = c.get('wait_message', default=constants.DEFAULT_WAIT_MESSAGE)
DISABLE_EMAIL = _bool(c.get('disable_email', 'DISABLE_EMAIL', default=False))
EMAIL_HOST = c.get('email_host', 'EMAIL_HOST', default='smtp.gmail.com')
EMAIL_PORT = int(c.get('email_port', 'EMAIL_PORT', default=587))
EMAIL_FROM = c.get('email_from', 'EMAIL_FROM')
EMAIL_USER = c.get('email_user', 'EMAIL_USER')
EMAIL_PASSWORD = c.get('email_password', 'EMAIL_PASSWORD')
EMAIL_AUTH_MODE = c.get('email_auth_mode', 'EMAIL_AUTH_MODE', default='tls').lower()
EMAIL_CC = _list(c.get('email_cc', 'EMAIL_CC', default=[]))
EMAIL_SUBJECT = c.get('email_subject', default=constants.DEFAULT_EMAIL_SUBJECT)
EMAIL_BODY = c.get('email_body', default=constants.DEFAULT_EMAIL_BODY)
USE_SENDGRID = _bool(c.get('use_sendgrid', 'USE_SENDGRID', default=False))
SENDGRID_API_KEY = c.get('sendgrid_api_key', 'SENDGRID_API_KEY', default=None)
| 4,880 | Python | .py | 84 | 52.547619 | 122 | 0.586293 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,347 | constants.py | calhacks_hammer/hammer/constants.py | ANNOTATOR_ID = 'annotator_id'
SENDGRID_URL = "https://api.sendgrid.com/v3/mail/send"
# Setting
# keys
SETTING_WAVE = '0' # boolean
# values
SETTING_TRUE = 'true'
SETTING_FALSE = 'false'
# Defaults
# these can be overridden via the config file
DEFAULT_WELCOME_MESSAGE = '''
Welcome to the judging portion of Hack The Impact. Remember that
for your project to be eligble for prizes, you must judge at least
five of your fellow participants' projects.
**Please read this important message carefully before continuing.**
Hammer is a fully automated peer-to-peer expo judging system that both
tells you where to go and collects your votes.
You will be able to judge projects on Hammer during your wave (see the top
of the page). Organizers will announce the start of each wave, please listen
carefully for your wave's announcement. At all other times, you should be
demo-ing your projects to your peers and sponsors at your table.
The system is based on the model of pairwise comparison. You'll start off by
looking at a single submission, and then for every submission after that,
you'll decide whether it's better or worse than the one you looked at
**immediately beforehand**.
If at any point, you can't find a particular submission, you can click the
'Skip' button and you will be assigned a new project. **Please don't skip
unless absolutely necessary.**
Hammer makes it really simple for you to submit votes, but please think hard
before you vote. **Once you make a decision, you can't take it back**.
'''.strip()
DEFAULT_EMAIL_SUBJECT = '[IMPORTANT] Hack for Impact Judging Information'
DEFAULT_EMAIL_BODY = '''
Hi {name},
Thanks for submitting to Hack for Impact! We're doing judging a little
different this year. We'll be having participants judge each others projects.
To be eligble for prizes, you must judge at least five of your fellow participants'
projects.
Judging will be done using Hammer, an online platform for expo judging built
by the Cal Hacks team.
To access the system, visit {link}.
DO NOT SHARE this email with others, as it contains your personal magic link.
Once you're in, please take the time to read the welcome message and
instructions before continuing.
'''.strip()
DEFAULT_CLOSED_MESSAGE = '''
The judging system is currently closed. Reload the page to try again.
'''.strip()
DEFAULT_PRESENTING_MESSAGE = '''
At the moment, your wave is presenting their projects.
Please head to your table to demo your projects to other hackers.
(Remember, to win prizes, you need to be judged!)
'''.strip()
DEFAULT_DISABLED_MESSAGE = '''
Your account is currently disabled. Reload the page to try again.
'''.strip()
DEFAULT_LOGGED_OUT_MESSAGE = '''
You are currently logged out. Open the magic link emailed to you to get started.
'''.strip()
DEFAULT_WAIT_MESSAGE = '''
We couldn't find a project for you to judge.
Wait for a little bit and reload the page to try again.
If you've looked at all the projects already, then you're done.
'''.strip()
| 2,992 | Python | .py | 64 | 45.265625 | 83 | 0.780572 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,348 | utils.py | calhacks_hammer/hammer/utils.py | from hammer import celery
import hammer.settings as settings
import hammer.crowd_bt as crowd_bt
import hammer.constants as constants
from flask import Markup, Response, request, render_template
import markdown
import requests
from functools import wraps
import base64
import os
import csv
import io
import re
import smtplib
import email
import email.mime.multipart
import email.mime.text
import json
def gen_secret(length):
return base64.b32encode(os.urandom(length))[:length].decode('utf8').lower()
def check_auth(username, password):
return username == 'admin' and password == settings.ADMIN_PASSWORD
def authenticate():
return Response('Access denied.', 401,
{'WWW-Authenticate': 'Basic realm="Login Required"'})
def requires_auth(f):
@wraps(f)
def decorated(*args, **kwargs):
auth = request.authorization
if not auth or not check_auth(auth.username, auth.password):
return authenticate()
return f(*args, **kwargs)
return decorated
def data_to_csv_string(data):
output = io.StringIO()
writer = csv.writer(output)
writer.writerows(data)
return output.getvalue()
def data_from_csv_string(string):
data_input = io.StringIO(string)
reader = csv.reader(data_input)
return list(reader)
def get_paragraphs(message):
paragraphs = re.split(r'\n\n+', message)
paragraphs = [i.replace('\n', ' ') for i in paragraphs if i]
return paragraphs
@celery.task
def send_emails(emails):
'''
Send a batch of emails.
This function takes a list [(to_address, subject, body)].
'''
if settings.EMAIL_AUTH_MODE == 'tls':
server = smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT)
server.ehlo()
server.starttls()
server.ehlo()
elif settings.EMAIL_AUTH_MODE == 'ssl':
server = smtplib.SMTP_SSL(settings.EMAIL_HOST, settings.EMAIL_PORT)
elif settings.EMAIL_AUTH_MODE == 'none':
server = smtplib.SMTP(settings.EMAIL_HOST, settings.EMAIL_PORT)
server.ehlo()
else:
raise ValueError('unsupported auth mode: %s' % settings.EMAIL_AUTH_MODE)
server.login(settings.EMAIL_USER, settings.EMAIL_PASSWORD)
exceptions = []
for e in emails:
try:
to_address, subject, body = e
msg = email.mime.multipart.MIMEMultipart()
msg['From'] = settings.EMAIL_FROM
msg['To'] = to_address
recipients = [to_address]
if settings.EMAIL_CC:
msg['Cc'] = ', '.join(settings.EMAIL_CC)
recipients.extend(settings.EMAIL_CC)
msg['Subject'] = subject
msg.attach(email.mime.text.MIMEText(body, 'plain'))
server.sendmail(settings.EMAIL_FROM, recipients, msg.as_string())
except Exception as e:
exceptions.append(e) # XXX is there a cleaner way to handle this?
server.quit()
if exceptions:
raise Exception('Error sending some emails: %s' % exceptions)
def send_sendgrid_emails(emails):
exceptions = []
for e in emails:
to_address, subject, body = e
response = sendgrid_send_email(to_address, subject, body)
if not (response.status_code == requests.codes.ok or response.status_code == requests.codes.accepted):
all_errors = [error_obj['message'] for error_obj in response.json()['errors']]
error_msg = '%s (error %s)' % (to_address, str(all_errors))
exceptions.append(error_msg)
if exceptions:
raise Exception('Error sending some emails: %s' % exceptions)
def sendgrid_send_email(to_address, subject, body):
payload = {
'personalizations': [{'to': [{'email': to_address}], 'subject': subject}],
'from': {'email': settings.EMAIL_FROM},
'subject': subject,
'content': [{'type': 'text/plain', 'value': body}]
}
headers = {
'authorization': 'Bearer %s' % settings.SENDGRID_API_KEY,
'content-type': 'application/json',
}
response = requests.request('POST', constants.SENDGRID_URL, data=json.dumps(payload), headers=headers)
return response
def render_markdown(content):
return Markup(markdown.markdown(content))
def user_error(message):
return render_template('error.html', message=message), 400
def server_error(message):
return render_template('error.html', message=message), 500
def cast_row(row):
'''
Convert workbook sheet cells into integers if they are equal to integer
values and convert everything to a string.
The xlrd library seems to import cells as float values if the cell had a
numeric value, so this method is needed to correct that.
'''
for i, item in enumerate(row):
if isinstance(item, (float, int)) and int(item) == item:
row[i] = str(int(item))
else:
row[i] = str(item)
return row
| 4,891 | Python | .py | 127 | 32.338583 | 110 | 0.667299 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,349 | __init__.py | calhacks_hammer/hammer/__init__.py | # Forked from Gavel by HackMIT / Anish Athalye ([email protected])
#
# This software and Gavel are both released under AGPLv3.
# See the included LICENSE.txt for details.
from flask import Flask
app = Flask(__name__)
import hammer.settings as settings
app.config['SQLALCHEMY_DATABASE_URI'] = settings.DB_URI
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SECRET_KEY'] = settings.SECRET_KEY
app.config['SERVER_NAME'] = settings.SERVER_NAME
if settings.PROXY:
from werkzeug.middleware.proxy_fix import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app)
from flask_assets import Environment, Bundle
assets = Environment(app)
assets.config['pyscss_style'] = 'expanded'
scss = Bundle(
'css/style.scss',
depends='**/*.scss',
filters=('pyscss',),
output='all.css'
)
assets.register('scss_all', scss)
from celery import Celery
app.config['CELERY_BROKER_URL'] = settings.BROKER_URI
celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL'])
celery.conf.update(app.config)
from hammer.models import db
db.app = app
db.init_app(app)
import hammer.template_filters # registers template filters
import hammer.controllers # registers controllers
| 1,188 | Python | .py | 33 | 34 | 68 | 0.77245 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,350 | template_filters.py | calhacks_hammer/hammer/template_filters.py | from hammer import app
from humanize import naturaltime
@app.template_filter('utcdatetime_local')
def _jinja2_filter_datetime_local(datetime):
if datetime is None:
return 'None'
return naturaltime(datetime)
@app.template_filter('utcdatetime_epoch')
def _jinja2_filter_datetime_epoch(datetime):
if datetime is None:
return 0
return datetime.strftime('%s')
| 389 | Python | .py | 12 | 28.583333 | 44 | 0.754667 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,351 | item.py | calhacks_hammer/hammer/models/item.py | from hammer.models import db
import hammer.crowd_bt as crowd_bt
from sqlalchemy.orm.exc import NoResultFound
view_table = db.Table('view',
db.Column('item_id', db.Integer, db.ForeignKey('item.id')),
db.Column('annotator_id', db.Integer, db.ForeignKey('annotator.id'))
)
class Item(db.Model):
id = db.Column(db.Integer, primary_key=True, nullable=False)
name = db.Column(db.Text, nullable=False)
location = db.Column(db.Text, nullable=False)
description = db.Column(db.Text, nullable=False)
wave = db.Column(db.Integer, nullable=False)
active = db.Column(db.Boolean, default=True, nullable=False)
viewed = db.relationship('Annotator', secondary=view_table)
prioritized = db.Column(db.Boolean, default=False, nullable=False)
mu = db.Column(db.Float)
sigma_sq = db.Column(db.Float)
def __init__(self, name, wave, location, description):
self.name = name
self.location = location
self.wave = int(wave)
self.description = description
self.mu = crowd_bt.MU_PRIOR
self.sigma_sq = crowd_bt.SIGMA_SQ_PRIOR
@classmethod
def by_id(cls, uid):
if uid is None:
return None
try:
item = cls.query.get(uid)
except NoResultFound:
item = None
return item
| 1,317 | Python | .py | 34 | 32.411765 | 72 | 0.667449 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,352 | decision.py | calhacks_hammer/hammer/models/decision.py | from hammer.models import db
from datetime import datetime
class Decision(db.Model):
id = db.Column(db.Integer, primary_key=True, nullable=False)
annotator_id = db.Column(db.Integer, db.ForeignKey('annotator.id'))
annotator = db.relationship('Annotator', foreign_keys=[annotator_id], uselist=False)
winner_id = db.Column(db.Integer, db.ForeignKey('item.id'))
winner = db.relationship('Item', foreign_keys=[winner_id], uselist=False)
loser_id = db.Column(db.Integer, db.ForeignKey('item.id'))
loser = db.relationship('Item', foreign_keys=[loser_id], uselist=False)
time = db.Column(db.DateTime, default=datetime.utcnow, nullable=False)
def __init__(self, annotator, winner, loser):
self.annotator = annotator
self.winner = winner
self.loser = loser
| 810 | Python | .py | 15 | 48.866667 | 88 | 0.712484 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,353 | setting.py | calhacks_hammer/hammer/models/setting.py | from hammer.models import db
from sqlalchemy.orm.exc import NoResultFound
class Setting(db.Model):
key = db.Column(db.Text, unique=True, nullable=False, primary_key=True)
value = db.Column(db.Text, nullable=False)
def __init__(self, key, value):
self.key = key
self.value = value
@classmethod
def by_key(cls, key):
try:
setting = cls.query.filter(cls.key == key).one()
except NoResultFound:
setting = None
return setting
@classmethod
def value_of(cls, key):
setting = cls.by_key(key)
if setting:
return int(setting.value)
else:
return None
@classmethod
def set(cls, key, value):
setting = cls.by_key(key)
if setting:
setting.value = value
else:
setting = cls(key, value)
db.session.add(setting)
| 908 | Python | .py | 30 | 22.166667 | 75 | 0.592211 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,354 | annotator.py | calhacks_hammer/hammer/models/annotator.py | from hammer.models import db
import hammer.utils as utils
import hammer.crowd_bt as crowd_bt
from sqlalchemy.orm.exc import NoResultFound
from datetime import datetime
ignore_table = db.Table('ignore',
db.Column('annotator_id', db.Integer, db.ForeignKey('annotator.id')),
db.Column('item_id', db.Integer, db.ForeignKey('item.id'))
)
class Annotator(db.Model):
id = db.Column(db.Integer, primary_key=True, nullable=False)
name = db.Column(db.String(120), nullable=False)
email = db.Column(db.String(120), nullable=False)
wave = db.Column(db.Integer, nullable=False)
active = db.Column(db.Boolean, default=True, nullable=False)
read_welcome = db.Column(db.Boolean, default=False, nullable=False)
description = db.Column(db.Text, nullable=False)
secret = db.Column(db.String(32), unique=True, nullable=False)
next_id = db.Column(db.Integer, db.ForeignKey('item.id'))
next = db.relationship('Item', foreign_keys=[next_id], uselist=False)
updated = db.Column(db.DateTime)
prev_id = db.Column(db.Integer, db.ForeignKey('item.id'))
prev = db.relationship('Item', foreign_keys=[prev_id], uselist=False)
ignore = db.relationship('Item', secondary=ignore_table)
alpha = db.Column(db.Float)
beta = db.Column(db.Float)
def __init__(self, name, wave, email, description):
self.name = name
self.email = email
self.description = description
self.wave = int(wave)
self.alpha = crowd_bt.ALPHA_PRIOR
self.beta = crowd_bt.BETA_PRIOR
self.secret = utils.gen_secret(32)
def update_next(self, new_next):
if new_next is not None:
new_next.prioritized = False # it's now assigned, so cancel the prioritization
# it could happen that the judge skips the project, but that
# doesn't re-prioritize the project
self.updated = datetime.utcnow()
self.next = new_next
@classmethod
def by_secret(cls, secret):
try:
annotator = cls.query.filter(cls.secret == secret).one()
except NoResultFound:
annotator = None
return annotator
@classmethod
def by_id(cls, uid):
if uid is None:
return None
try:
annotator = cls.query.with_for_update().get(uid)
except NoResultFound:
annotator = None
return annotator
| 2,407 | Python | .py | 57 | 35.280702 | 90 | 0.664959 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,355 | __init__.py | calhacks_hammer/hammer/models/__init__.py | import hammer.crowd_bt as crowd_bt
from flask_sqlalchemy import SQLAlchemy
import sqlalchemy.exc
import psycopg2.errors
class SerializableAlchemy(SQLAlchemy):
def apply_driver_hacks(self, app, info, options):
if not 'isolation_level' in options:
# XXX is this slow? are there better ways?
options['isolation_level'] = 'SERIALIZABLE'
return super(SerializableAlchemy, self).apply_driver_hacks(app, info, options)
db = SerializableAlchemy()
from hammer.models.annotator import Annotator, ignore_table
from hammer.models.item import Item, view_table
from hammer.models.decision import Decision
from hammer.models.setting import Setting
from sqlalchemy.exc import IntegrityError
from sqlalchemy.sql.expression import desc
def with_retries(tx_func):
'''
Keep retrying a function that involves a database transaction until it
succeeds.
This only retries due to serialization failures; all other types of
exceptions are re-raised.
'''
while True:
try:
tx_func()
except sqlalchemy.exc.OperationalError as err:
if not isinstance(err.orig, psycopg2.errors.SerializationFailure):
raise
db.session.rollback()
else:
break
| 1,274 | Python | .py | 33 | 32.606061 | 86 | 0.726537 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,356 | error.py | calhacks_hammer/hammer/controllers/error.py | from hammer import app
from flask import render_template
@app.errorhandler(404)
def error_404(e):
return (
render_template('error.html', message='Page not found.'),
404
)
@app.errorhandler(403)
def error_403(e):
return (
render_template('error.html', message='Forbidden. Go back, refresh the page, and try again.'),
403
)
@app.errorhandler(500)
def error_500(e):
return (
render_template('error.html', message='Internal server error. Go back and try again.'),
500
)
| 541 | Python | .py | 20 | 22.3 | 102 | 0.662162 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,357 | default.py | calhacks_hammer/hammer/controllers/default.py | from hammer import app
from flask import send_from_directory
import os
@app.route('/favicon.ico')
def favicon():
return send_from_directory(
os.path.join(app.root_path, 'static'),
'favicon.ico',
mimetype='image/vnd.microsoft.icon'
)
| 266 | Python | .py | 10 | 22.3 | 46 | 0.690196 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,358 | api.py | calhacks_hammer/hammer/controllers/api.py | from hammer import app
from hammer.models import *
import hammer.utils as utils
from flask import Response
@app.route('/api/items.csv')
@app.route('/api/projects.csv')
@utils.requires_auth
def item_dump():
items = Item.query.order_by(desc(Item.mu)).all()
data = [['Mu', 'Sigma Squared', 'Name', 'Location', 'Description', 'Active']]
data += [[
str(item.mu),
str(item.sigma_sq),
item.name,
item.location,
item.description,
item.active
] for item in items]
return Response(utils.data_to_csv_string(data), mimetype='text/csv')
@app.route('/api/annotators.csv')
@app.route('/api/judges.csv')
@utils.requires_auth
def annotator_dump():
annotators = Annotator.query.all()
data = [['Name', 'Email', 'Description', 'Secret']]
data += [[
str(a.name),
a.email,
a.description,
a.secret
] for a in annotators]
return Response(utils.data_to_csv_string(data), mimetype='text/csv')
@app.route('/api/decisions.csv')
@utils.requires_auth
def decisions_dump():
decisions = Decision.query.all()
data = [['Annotator ID', 'Winner ID', 'Loser ID', 'Time']]
data += [[
str(d.annotator.id),
str(d.winner.id),
str(d.loser.id),
str(d.time)
] for d in decisions]
return Response(utils.data_to_csv_string(data), mimetype='text/csv')
| 1,380 | Python | .py | 44 | 26.386364 | 81 | 0.637659 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,359 | csrf_protection.py | calhacks_hammer/hammer/controllers/csrf_protection.py | from hammer import app
import hammer.utils as utils
from flask import abort, request, session
@app.before_request
def csrf_protect():
if request.method == "POST":
token = session.get('_csrf_token', None)
if not token or token != request.form.get('_csrf_token'):
abort(403)
def generate_csrf_token():
if '_csrf_token' not in session:
session['_csrf_token'] = utils.gen_secret(32)
return session['_csrf_token']
app.jinja_env.globals['csrf_token'] = generate_csrf_token
| 518 | Python | .py | 14 | 32.357143 | 65 | 0.684631 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,360 | __init__.py | calhacks_hammer/hammer/controllers/__init__.py | import hammer.controllers.default
import hammer.controllers.csrf_protection
import hammer.controllers.admin
import hammer.controllers.api
import hammer.controllers.judge
import hammer.controllers.error
| 202 | Python | .py | 6 | 32.666667 | 41 | 0.903061 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,361 | admin.py | calhacks_hammer/hammer/controllers/admin.py | from hammer import app
from hammer.models import *
from hammer.constants import *
import hammer.settings as settings
import hammer.utils as utils
from flask import (
redirect,
render_template,
request,
url_for,
)
import urllib.parse
import xlrd
ALLOWED_EXTENSIONS = set(['csv', 'xlsx', 'xls'])
@app.route('/admin/')
@utils.requires_auth
def admin():
annotators = Annotator.query.order_by(Annotator.id).all()
items = Item.query.order_by(Item.id).all()
decisions = Decision.query.all()
counts = {}
item_counts = {}
for d in decisions:
a = d.annotator_id
w = d.winner_id
l = d.loser_id
counts[a] = counts.get(a, 0) + 1
item_counts[w] = item_counts.get(w, 0) + 1
item_counts[l] = item_counts.get(l, 0) + 1
viewed = {i.id: {a.id for a in i.viewed} for i in items}
skipped = {}
for a in annotators:
for i in a.ignore:
if a.id not in viewed[i.id]:
skipped[i.id] = skipped.get(i.id, 0) + 1
# settings
setting_wave = Setting.value_of(SETTING_WAVE)
return render_template(
'admin.html',
annotators=annotators,
counts=counts,
item_counts=item_counts,
skipped=skipped,
items=items,
votes=len(decisions),
setting_wave=setting_wave,
)
@app.route('/admin/item', methods=['POST'])
@utils.requires_auth
def item():
action = request.form['action']
if action == 'Submit':
data = parse_upload_form()
if data:
# validate data
for index, row in enumerate(data):
if len(row) != 4:
return utils.user_error('Bad data: row %d has %d elements (expecting 4)' % (index + 1, len(row)))
def tx():
for row in data:
_item = Item(*row)
db.session.add(_item)
db.session.commit()
with_retries(tx)
elif action == 'Prioritize' or action == 'Cancel':
item_id = request.form['item_id']
target_state = action == 'Prioritize'
def tx():
Item.by_id(item_id).prioritized = target_state
db.session.commit()
with_retries(tx)
elif action == 'Disable' or action == 'Enable':
item_id = request.form['item_id']
target_state = action == 'Enable'
def tx():
Item.by_id(item_id).active = target_state
db.session.commit()
with_retries(tx)
elif action == 'Delete':
item_id = request.form['item_id']
try:
def tx():
db.session.execute(ignore_table.delete(ignore_table.c.item_id == item_id))
Item.query.filter_by(id=item_id).delete()
db.session.commit()
with_retries(tx)
except IntegrityError as e:
if isinstance(e.orig, psycopg2.errors.ForeignKeyViolation):
return utils.server_error("Projects can't be deleted once they have been voted on by a judge. You can use the 'disable' functionality instead, which has a similar effect, preventing the project from being shown to judges.")
else:
return utils.server_error(str(e))
return redirect(url_for('admin'))
def allowed_file(filename):
return '.' in filename and \
filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
def parse_upload_form():
f = request.files.get('file')
data = []
if f and allowed_file(f.filename):
extension = str(f.filename.rsplit('.', 1)[1].lower())
if extension == "xlsx" or extension == "xls":
workbook = xlrd.open_workbook(file_contents=f.read())
worksheet = workbook.sheet_by_index(0)
data = list(utils.cast_row(worksheet.row_values(rx, 0, 3)) for rx in range(worksheet.nrows) if worksheet.row_len(rx) == 3)
elif extension == "csv":
data = utils.data_from_csv_string(f.read().decode("utf-8"))
else:
csv = request.form['data']
data = utils.data_from_csv_string(csv)
return data
@app.route('/admin/item_patch', methods=['POST'])
@utils.requires_auth
def item_patch():
def tx():
item = Item.by_id(request.form['item_id'])
if not item:
return utils.user_error('Item %s not found ' % request.form['item_id'])
if 'location' in request.form:
item.location = request.form['location']
if 'name' in request.form:
item.name = request.form['name']
if 'description' in request.form:
item.description = request.form['description']
db.session.commit()
with_retries(tx)
return redirect(url_for('item_detail', item_id=item.id))
@app.route('/admin/annotator', methods=['POST'])
@utils.requires_auth
def annotator():
action = request.form['action']
if action == 'Submit':
data = parse_upload_form()
added = []
if data:
# validate data
for index, row in enumerate(data):
if len(row) != 4:
return utils.user_error('Bad data: row %d has %d elements (expecting 4)' % (index + 1, len(row)))
def tx():
for row in data:
annotator = Annotator(*row)
added.append(annotator)
db.session.add(annotator)
db.session.commit()
with_retries(tx)
try:
email_invite_links(added)
except Exception as e:
return utils.server_error(str(e))
elif action == 'Email':
annotator_id = request.form['annotator_id']
try:
email_invite_links(Annotator.by_id(annotator_id))
except Exception as e:
return utils.server_error(str(e))
elif action == 'Disable' or action == 'Enable':
annotator_id = request.form['annotator_id']
target_state = action == 'Enable'
def tx():
Annotator.by_id(annotator_id).active = target_state
db.session.commit()
with_retries(tx)
elif action == 'Delete':
annotator_id = request.form['annotator_id']
try:
def tx():
db.session.execute(ignore_table.delete(ignore_table.c.annotator_id == annotator_id))
Annotator.query.filter_by(id=annotator_id).delete()
db.session.commit()
with_retries(tx)
except IntegrityError as e:
if isinstance(e.orig, psycopg2.errors.ForeignKeyViolation):
return utils.server_error("Judges can't be deleted once they have voted on a project. You can use the 'disable' functionality instead, which has a similar effect, locking out the judge and preventing them from voting on any other projects.")
else:
return utils.server_error(str(e))
return redirect(url_for('admin'))
@app.route('/admin/setting', methods=['POST'])
@utils.requires_auth
def setting():
key = request.form['key']
if key == 'wave':
new_value = request.form['value']
Setting.set(SETTING_WAVE, int(new_value))
db.session.commit()
return redirect(url_for('admin'))
@app.route('/admin/item/<item_id>/')
@utils.requires_auth
def item_detail(item_id):
item = Item.by_id(item_id)
if not item:
return utils.user_error('Item %s not found ' % item_id)
else:
assigned = Annotator.query.filter(Annotator.next == item).all()
viewed_ids = {i.id for i in item.viewed}
if viewed_ids:
skipped = Annotator.query.filter(
Annotator.ignore.contains(item) & ~Annotator.id.in_(viewed_ids)
)
else:
skipped = Annotator.query.filter(Annotator.ignore.contains(item))
return render_template(
'admin_item.html',
item=item,
assigned=assigned,
skipped=skipped
)
@app.route('/admin/annotator/<annotator_id>/')
@utils.requires_auth
def annotator_detail(annotator_id):
annotator = Annotator.by_id(annotator_id)
if not annotator:
return utils.user_error('Annotator %s not found ' % annotator_id)
else:
seen = Item.query.filter(Item.viewed.contains(annotator)).all()
ignored_ids = {i.id for i in annotator.ignore}
if ignored_ids:
skipped = Item.query.filter(
Item.id.in_(ignored_ids) & ~Item.viewed.contains(annotator)
)
else:
skipped = []
return render_template(
'admin_annotator.html',
annotator=annotator,
login_link=annotator_link(annotator),
seen=seen,
skipped=skipped
)
def annotator_link(annotator):
return url_for('login', secret=annotator.secret, _external=True)
def email_invite_links(annotators):
if settings.DISABLE_EMAIL or annotators is None:
return
if not isinstance(annotators, list):
annotators = [annotators]
emails = []
for annotator in annotators:
link = annotator_link(annotator)
raw_body = settings.EMAIL_BODY.format(name=annotator.name, link=link)
body = '\n\n'.join(utils.get_paragraphs(raw_body))
emails.append((annotator.email, settings.EMAIL_SUBJECT, body))
if settings.USE_SENDGRID and settings.SENDGRID_API_KEY != None:
utils.send_sendgrid_emails(emails)
else:
utils.send_emails.delay(emails)
| 9,504 | Python | .py | 245 | 29.873469 | 257 | 0.598247 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,362 | judge.py | calhacks_hammer/hammer/controllers/judge.py | from hammer import app
from hammer.models import *
from hammer.constants import *
import hammer.settings as settings
import hammer.utils as utils
import hammer.crowd_bt as crowd_bt
from flask import (
redirect,
render_template,
request,
session,
url_for,
)
from numpy.random import choice, random, shuffle
from functools import wraps
from datetime import datetime
def requires_open(redirect_to):
def decorator(f):
@wraps(f)
def decorated(*args, **kwargs):
annotator = get_current_annotator()
if Setting.value_of(SETTING_WAVE) != annotator.wave or Setting.value_of(SETTING_WAVE) == 0:
return redirect(url_for(redirect_to))
else:
return f(*args, **kwargs)
return decorated
return decorator
def requires_active_annotator(redirect_to):
def decorator(f):
@wraps(f)
def decorated(*args, **kwargs):
annotator = get_current_annotator()
if annotator is None or not annotator.active:
return redirect(url_for(redirect_to))
else:
return f(*args, **kwargs)
return decorated
return decorator
@app.route('/')
def index():
annotator = get_current_annotator()
if annotator is None:
return render_template(
'logged_out.html',
content=utils.render_markdown(settings.LOGGED_OUT_MESSAGE)
)
else:
if Setting.value_of(SETTING_WAVE) == 0:
return render_template(
'closed.html',
content=utils.render_markdown(settings.CLOSED_MESSAGE)
)
if Setting.value_of(SETTING_WAVE) != annotator.wave:
return render_template(
'presenting.html',
content=utils.render_markdown(settings.PRESENTING_MESSAGE or constants.DEFAULT_PRESENTING_MESSAGE),
annotator=get_current_annotator()
)
if not annotator.active:
return render_template(
'disabled.html',
content=utils.render_markdown(settings.DISABLED_MESSAGE)
)
if not annotator.read_welcome:
return redirect(url_for('welcome'))
maybe_init_annotator()
if annotator.next is None:
return render_template(
'wait.html',
content=utils.render_markdown(settings.WAIT_MESSAGE)
)
elif annotator.prev is None:
return render_template('begin.html', item=annotator.next)
else:
return render_template('vote.html', prev=annotator.prev, next=annotator.next)
@app.route('/vote', methods=['POST'])
@requires_active_annotator(redirect_to='index')
@requires_open(redirect_to='index')
def vote():
def tx():
annotator = get_current_annotator()
if annotator.prev.id == int(request.form['prev_id']) and annotator.next.id == int(request.form['next_id']):
if request.form['action'] == 'Skip':
annotator.ignore.append(annotator.next)
else:
# ignore things that were deactivated in the middle of judging
if annotator.prev.active and annotator.next.active:
if request.form['action'] == 'Previous':
perform_vote(annotator, next_won=False)
decision = Decision(annotator, winner=annotator.prev, loser=annotator.next)
elif request.form['action'] == 'Current':
perform_vote(annotator, next_won=True)
decision = Decision(annotator, winner=annotator.next, loser=annotator.prev)
db.session.add(decision)
annotator.next.viewed.append(annotator) # counted as viewed even if deactivated
annotator.prev = annotator.next
annotator.ignore.append(annotator.prev)
annotator.update_next(choose_next(annotator))
db.session.commit()
with_retries(tx)
return redirect(url_for('index'))
@app.route('/begin', methods=['POST'])
@requires_active_annotator(redirect_to='index')
@requires_open(redirect_to='index')
def begin():
def tx():
annotator = get_current_annotator()
if annotator.next.id == int(request.form['item_id']):
annotator.ignore.append(annotator.next)
if request.form['action'] == 'Continue':
annotator.next.viewed.append(annotator)
annotator.prev = annotator.next
annotator.update_next(choose_next(annotator))
elif request.form['action'] == 'Skip':
annotator.next = None # will be reset in index
db.session.commit()
with_retries(tx)
return redirect(url_for('index'))
@app.route('/logout')
def logout():
session.pop(ANNOTATOR_ID, None)
return redirect(url_for('index'))
@app.route('/login/<secret>/')
def login(secret):
annotator = Annotator.by_secret(secret)
if annotator is None:
session.pop(ANNOTATOR_ID, None)
session.modified = True
else:
session[ANNOTATOR_ID] = annotator.id
return redirect(url_for('index'))
@app.route('/welcome/')
@requires_active_annotator(redirect_to='index')
@requires_open(redirect_to='index')
def welcome():
return render_template(
'welcome.html',
content=utils.render_markdown(settings.WELCOME_MESSAGE),
annotator=get_current_annotator()
)
@app.route('/welcome/done', methods=['POST'])
@requires_active_annotator(redirect_to='index')
@requires_open(redirect_to='index')
def welcome_done():
def tx():
annotator = get_current_annotator()
if request.form['action'] == 'Continue':
annotator.read_welcome = True
db.session.commit()
with_retries(tx)
return redirect(url_for('index'))
def get_current_annotator():
return Annotator.by_id(session.get(ANNOTATOR_ID, None))
def preferred_items(annotator):
'''
Return a list of preferred items for the given annotator to look at next.
This method uses a variety of strategies to try to select good candidate
projects.
'''
items = []
ignored_ids = {i.id for i in annotator.ignore}
if ignored_ids:
available_items = Item.query.filter(
(Item.active == True) & (Item.wave != Setting.value_of(SETTING_WAVE)) & (~Item.id.in_(ignored_ids))
).all()
else:
available_items = Item.query.filter((Item.active == True) & (Item.wave != Setting.value_of(SETTING_WAVE))).all()
prioritized_items = [i for i in available_items if i.prioritized]
items = prioritized_items if prioritized_items else available_items
annotators = Annotator.query.filter(
(Annotator.active == True) & (Annotator.next != None) & (Annotator.updated != None)
).all()
busy = {i.next.id for i in annotators if \
(datetime.utcnow() - i.updated).total_seconds() < settings.TIMEOUT * 60}
nonbusy = [i for i in items if i.id not in busy]
preferred = nonbusy if nonbusy else items
less_seen = [i for i in preferred if len(i.viewed) < settings.MIN_VIEWS]
return less_seen if less_seen else preferred
def maybe_init_annotator():
def tx():
annotator = get_current_annotator()
if annotator.next is None:
items = preferred_items(annotator)
if items:
annotator.update_next(choice(items))
db.session.commit()
with_retries(tx)
def choose_next(annotator):
items = preferred_items(annotator)
shuffle(items) # useful for argmax case as well in the case of ties
if items:
if random() < crowd_bt.EPSILON:
return items[0]
else:
return crowd_bt.argmax(lambda i: crowd_bt.expected_information_gain(
annotator.alpha,
annotator.beta,
annotator.prev.mu,
annotator.prev.sigma_sq,
i.mu,
i.sigma_sq), items)
else:
return None
def perform_vote(annotator, next_won):
if next_won:
winner = annotator.next
loser = annotator.prev
else:
winner = annotator.prev
loser = annotator.next
u_alpha, u_beta, u_winner_mu, u_winner_sigma_sq, u_loser_mu, u_loser_sigma_sq = crowd_bt.update(
annotator.alpha,
annotator.beta,
winner.mu,
winner.sigma_sq,
loser.mu,
loser.sigma_sq
)
annotator.alpha = u_alpha
annotator.beta = u_beta
winner.mu = u_winner_mu
winner.sigma_sq = u_winner_sigma_sq
loser.mu = u_loser_mu
loser.sigma_sq = u_loser_sigma_sq
| 8,710 | Python | .py | 224 | 30.209821 | 120 | 0.626019 | calhacks/hammer | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,363 | prestartup_script.py | sdfxai_SDFXBridgeForComfyUI/prestartup_script.py | import argparse
import os
import sys
import json
# Hack to pass extra args to main.py
def parse_args_override(self, args=None, namespace=None):
namespace, _ = self.parse_known_args(args, namespace)
return namespace
argparse.ArgumentParser.parse_args = parse_args_override
parser = argparse.ArgumentParser()
parser.add_argument("--sdfx-config-file", type=str, default=None, help="Path for sdfx config file")
args = parser.parse_args()
sdfx_config_file_name = 'sdfx.config.json'
#=== Best effort to find sdfx_config_file_path ===
def find_sdfx_config_path():
if args.sdfx_config_file is not None:
if os.path.exists(args.sdfx_config_file):
return args.sdfx_config_file
path = os.path.abspath(os.path.dirname(__file__))
config_path_found = None
try:
for _ in range(6):
config_path = os.path.join(path, sdfx_config_file_name)
if os.path.exists(config_path):
config_path_found = config_path
path = os.path.dirname(path)
except Exception as e:
print(f"Error File access : {e}")
if config_path_found is not None:
return config_path_found
raise FileNotFoundError()
def load_boot_config():
try:
sdfx_config_file = find_sdfx_config_path()
with open(sdfx_config_file, 'r') as json_file:
data = json.load(json_file)
#=== load port from config file ===
port = data.get('args', {}).get('port', None)
if isinstance(port, int):
sys.argv.append("--port=" + str(port))
#=== load listen from config file ===
listen = data.get('args', {}).get('listen', None)
if isinstance(listen, str):
sys.argv.append("--listen=" + listen)
#=== load disable-xformers from config file ===
dx = data.get('args', {}).get('disable-xformers', None)
if isinstance(dx, bool) and dx == True:
sys.argv.append("--disable-xformers")
#=== load preview-method from config file ===
pm = data.get('args', {}).get('preview-method', None)
if isinstance(pm, str):
sys.argv.append("--preview-method=" + pm)
#=== load enable-cors-header from config file ===
ch = data.get('args', {}).get('enable-cors-header', None)
if isinstance(ch, bool) and ch == True:
sys.argv.append("--enable-cors-header")
except json.JSONDecodeError as e:
print(f"[SDFXBridgeForComfyUI] FATAL -> {sdfx_config_file_name} is not valid, it will not be loaded !")
except FileNotFoundError:
print(f"[SDFXBridgeForComfyUI] FATAL -> {sdfx_config_file_name} not found and not specified")
except Exception as e:
print(f"[SDFXBridgeForComfyUI] FATAL -> : {e}")
load_boot_config() | 2,631 | Python | .py | 63 | 36.904762 | 107 | 0.66927 | sdfxai/SDFXBridgeForComfyUI | 8 | 2 | 4 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,364 | __init__.py | sdfxai_SDFXBridgeForComfyUI/__init__.py | from functools import reduce
from .libs.prompt_parser import get_learned_conditioning_prompt_schedules,conditioning_set_timeset_range_prompt_mapper
from .sdfx_path import load_sdfx_extra_path_config
load_sdfx_extra_path_config()
from .server import add_sdfx_routes
add_sdfx_routes()
class SDFXClipTextEncode:
@classmethod
def INPUT_TYPES(s):
return {"required": {"text": ("STRING", {"multiline": True}), "clip": ("CLIP", )}}
RETURN_TYPES = ("CONDITIONING",)
FUNCTION = "encode"
CATEGORY = "conditioning"
def encode(self, clip, text):
mapped_conditionings = list(map(conditioning_set_timeset_range_prompt_mapper(clip), (lambda p: get_learned_conditioning_prompt_schedules([text])[0])(text)))
return (reduce(lambda a,b: a+b, mapped_conditionings), )
from nodes import SaveImage
def INPUT_TYPES(s):
return {"required":
{"images": ("IMAGE", ),
"filename_prefix": ("STRING", {"default": "SDFX"})},
"hidden": {"prompt": "PROMPT", "extra_pnginfo": "EXTRA_PNGINFO"},
}
SaveImage.INPUT_TYPES = classmethod(INPUT_TYPES)
# NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = {
"SDFXClipTextEncode": SDFXClipTextEncode
}
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"SDFXClipTextEncode": "SDFX Clip TextEncode (Prompt)"
} | 1,409 | Python | .py | 32 | 39.125 | 164 | 0.700292 | sdfxai/SDFXBridgeForComfyUI | 8 | 2 | 4 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,365 | sdfx_path.py | sdfxai_SDFXBridgeForComfyUI/sdfx_path.py | import os
import argparse
import json
import folder_paths
parser = argparse.ArgumentParser()
parser.add_argument("--sdfx-config-file", type=str, default=None, help="Path for sdfx config file")
args = parser.parse_args()
sdfx_config_file_name = 'sdfx.config.json'
#=== Best effort to find sdfx_config_file_path ===
def find_sdfx_config_path():
if args.sdfx_config_file is not None:
if os.path.exists(args.sdfx_config_file):
return args.sdfx_config_file
path = os.path.abspath(os.path.dirname(__file__))
config_path_found = None
try:
for _ in range(6):
config_path = os.path.join(path, sdfx_config_file_name)
if os.path.exists(config_path):
config_path_found = config_path
path = os.path.dirname(path)
except Exception as e:
print(f"Error File access : {e}")
if config_path_found is not None:
return config_path_found
raise FileNotFoundError()
#=== if path is relative return absolute ===
def get_sdfx_absolute_path(path):
path = os.path.normpath(path)
if path is None:
return None
elif os.path.isabs(path):
return path
else:
sdfx_config_path = None
try:
sdfx_config_path = find_sdfx_config_path()
except FileNotFoundError:
sdfx_config_path = os.path.abspath(os.path.dirname(__file__))
return os.path.join(sdfx_config_path, path)
parent_path = os.path.dirname(sdfx_config_path)
return os.path.join(parent_path, path)
gallery_path = get_sdfx_absolute_path('data/media/gallery')
workflows_path = get_sdfx_absolute_path('data/media/workflows')
templates_path = get_sdfx_absolute_path('data/media/templates')
#=== add all sdfx path to comfy folder_paths ===
def load_sdfx_extra_path_config():
global gallery_path, workflows_path, templates_path
try:
sdfx_config_file = find_sdfx_config_path()
with open(sdfx_config_file, 'r') as json_file:
data = json.load(json_file)
#=== load sdfx models ===
models = data.get('paths', {}).get('models', None)
if isinstance(models, dict):
for m in models:
for x in models[m]:
full_path = get_sdfx_absolute_path(x)
print("Adding sdfx extra search path", m, full_path)
folder_paths.add_model_folder_path(m, full_path)
#=== load sdfx medias ===
media = data.get('paths', {}).get('media', {})
o = media.get('output', None)
if isinstance(o, str):
output_dir = get_sdfx_absolute_path(o)
print("Setting sdfx output path", output_dir)
folder_paths.set_output_directory(output_dir)
i = media.get('input', None)
if isinstance(i, str):
input_dir = get_sdfx_absolute_path(i)
print("Setting sdfx input path", input_dir)
folder_paths.set_input_directory(input_dir)
t = media.get('temp', None)
if isinstance(t, str):
temp_dir = get_sdfx_absolute_path(t)
print("Setting sdfx temp path", temp_dir)
folder_paths.set_temp_directory(temp_dir)
g = media.get('gallery', None)
if isinstance(g, str):
gallery_path = get_sdfx_absolute_path(g)
print("Setting sdfx gallery path", gallery_path)
w = media.get('workflows', None)
if isinstance(w, str):
workflows_path = get_sdfx_absolute_path(w)
print("Setting sdfx workflows path", workflows_path)
te = media.get('templates', None)
if isinstance(te, str):
templates_path = get_sdfx_absolute_path(te)
print("Setting sdfx templates path", templates_path)
except json.JSONDecodeError as e:
print(f"[SDFXBridgeForComfyUI] FATAL -> {sdfx_config_file_name} is not valid, it will not be loaded !")
except FileNotFoundError:
print(f"[SDFXBridgeForComfyUI] FATAL -> {sdfx_config_file_name} not found and not specified")
except Exception as e:
print(f"[SDFXBridgeForComfyUI] FATAL -> : {e}")
def get_gallery_path():
return gallery_path
def get_workflows_path():
return workflows_path
def get_templates_path():
return templates_path | 4,028 | Python | .py | 101 | 34.366337 | 107 | 0.676312 | sdfxai/SDFXBridgeForComfyUI | 8 | 2 | 4 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,366 | server.py | sdfxai_SDFXBridgeForComfyUI/server.py | import os
from aiohttp import web
import server
import hashlib
import folder_paths
import uuid
import time
import json
from .libs.prompt_parser import get_learned_conditioning_prompt_schedules
from .sdfx_path import get_gallery_path, get_workflows_path, get_templates_path
gallery_path = get_gallery_path()
workflows_path = get_workflows_path()
templates_path = get_templates_path()
def get_media_url_from_params(url_path, filename, type, gallery):
return url_path + '/sdfx/media?filename=' + filename + '&type=' + type + '&gallery=' + gallery
def get_dir_by_model_id_and_type(model_id, dir_type):
# === Todo handle other media types ===
if dir_type is None or dir_type not in ["image"]:
dir_type = "image"
if dir_type == "image":
type_dir = os.path.join(gallery_path, model_id, "image")
return type_dir, dir_type
def media_upload(post, url_path):
image = post.get("file")
overwrite = post.get("overwrite")
model_id = post.get("modelId")
image_upload_type = post.get("type")
upload_dir, image_upload_type = get_dir_by_model_id_and_type(model_id, image_upload_type)
if image and image.file:
filename = image.filename
if not filename:
return web.Response(status=400)
filepath = os.path.abspath(os.path.join(upload_dir, filename))
if os.path.commonpath((upload_dir, filepath)) != upload_dir:
return web.Response(status=400)
if not os.path.exists(upload_dir):
os.makedirs(upload_dir)
split = os.path.splitext(filename)
if overwrite is not None and (overwrite == "true" or overwrite == "1"):
pass
else:
i = 1
while os.path.exists(filepath):
filename = f"{split[0]} ({i}){split[1]}"
filepath = os.path.join(upload_dir, filename)
i += 1
with open(filepath, "wb") as f:
f.write(image.file.read())
return web.json_response({"name" : filename, "type": image_upload_type, "path": get_media_url_from_params(url_path, filename, image_upload_type, model_id)})
else:
return web.Response(status=400)
def get_domain_from_request(request):
return request.scheme + '://' + request.host
def get_medias_from_model_id(media_id, url_path):
media_type = 'image'
# === Todo handle other media types ===
media_folder = os.path.join(gallery_path, media_id, media_type)
if os.path.exists(media_folder) and os.path.isdir(media_folder):
return [{"name": image, "type": media_type, "path": get_media_url_from_params(url_path, image, media_type, media_id)} for image in os.listdir(media_folder)]
return []
def add_sdfx_routes():
# === Comfy determines the path of a checkpoint by its name ===
# === If two different paths contain two checkpoints with the same name, there is an arbitration done to choose the appropriate path ===
@server.PromptServer.instance.routes.get("/sdfx/model/list")
def get_models(request):
url_path = get_domain_from_request(request)
models = []
cns = folder_paths.get_filename_list('checkpoints')
print(cns)
for cn in cns:
fp = folder_paths.get_full_path("checkpoints", cn)
media_id = hashlib.md5(fp.encode()).hexdigest()
models.append({
"modelId": media_id,
"name": cn,
"type": "checkpoint",
"gallery": get_medias_from_model_id(media_id, url_path)
})
return web.json_response(models)
# === Single API to upload all kind of assets ===
@server.PromptServer.instance.routes.post("/sdfx/media")
async def upload_media(request):
post = await request.post()
url_path = get_domain_from_request(request)
return media_upload(post, url_path)
@server.PromptServer.instance.routes.get("/sdfx/media")
async def view_media(request):
if "filename" not in request.rel_url.query:
return web.Response(status=400)
if "type" not in request.rel_url.query:
return web.Response(status=400)
if "gallery" not in request.rel_url.query:
return web.Response(status=400)
filename = request.rel_url.query["filename"]
type = request.rel_url.query["type"]
gallery = request.rel_url.query["gallery"]
if filename[0] == '/' or '..' in filename:
return web.Response(status=400)
if type[0] == '/' or '..' in type:
return web.Response(status=400)
if gallery[0] == '/' or '..' in gallery:
return web.Response(status=400)
file = os.path.join(gallery_path, gallery, type, filename)
if os.path.isfile(file):
if 'preview' in request.rel_url.query:
with Image.open(file) as img:
preview_info = request.rel_url.query['preview'].split(';')
image_format = preview_info[0]
if image_format not in ['webp', 'jpeg'] or 'a' in request.rel_url.query.get('channel', ''):
image_format = 'webp'
quality = 90
if preview_info[-1].isdigit():
quality = int(preview_info[-1])
buffer = BytesIO()
if image_format in ['jpeg'] or request.rel_url.query.get('channel', '') == 'rgb':
img = img.convert("RGB")
img.save(buffer, format=image_format, quality=quality)
buffer.seek(0)
return web.Response(body=buffer.read(), content_type=f'image/{image_format}',
headers={"Content-Disposition": f"filename=\"{filename}\""})
if 'channel' not in request.rel_url.query:
channel = 'rgba'
else:
channel = request.rel_url.query["channel"]
if channel == 'rgb':
with Image.open(file) as img:
if img.mode == "RGBA":
r, g, b, a = img.split()
new_img = Image.merge('RGB', (r, g, b))
else:
new_img = img.convert("RGB")
buffer = BytesIO()
new_img.save(buffer, format='PNG')
buffer.seek(0)
return web.Response(body=buffer.read(), content_type='image/png', headers={"Content-Disposition": f"filename=\"{filename}\""})
elif channel == 'a':
with Image.open(file) as img:
if img.mode == "RGBA":
_, _, _, a = img.split()
else:
a = Image.new('L', img.size, 255)
# alpha img
alpha_img = Image.new('RGBA', img.size)
alpha_img.putalpha(a)
alpha_buffer = BytesIO()
alpha_img.save(alpha_buffer, format='PNG')
alpha_buffer.seek(0)
return web.Response(body=alpha_buffer.read(), content_type='image/png', headers={"Content-Disposition": f"filename=\"{filename}\""})
else:
return web.FileResponse(file, headers={"Content-Disposition": f"filename=\"{filename}\""})
return web.Response(status=400)
@server.PromptServer.instance.routes.get("/sdfx/prompt_parser")
async def prompt_parser(request):
if "prompt" in request.rel_url.query:
prompt = request.rel_url.query["prompt"]
env = request.rel_url.query['env'] if 'env' in request.rel_url.query else 'prod'
g = lambda p: get_learned_conditioning_prompt_schedules([p], env)[0]
return web.json_response({'prompt' : prompt, 'data' : g(prompt)})
return web.Response(status=404)
@server.PromptServer.instance.routes.get("/sdfx/workflow/list")
@server.PromptServer.instance.routes.get("/sdfx/template/list")
async def workflows_templates(request):
list = []
path = request.url.path
if path == "/sdfx/workflow/list":
working_dir = workflows_path
elif path == "/sdfx/template/list":
working_dir = templates_path
for filename in os.listdir(working_dir):
if filename.endswith(".json"):
file_path = os.path.join(working_dir, filename)
with open(file_path, 'r') as file:
try:
data = json.load(file)
uid = data.get('uid')
name = data.get('name')
dateCreated = data.get('dateCreated')
meta = data.get('meta')
list.append({ 'uid': uid, 'name': name, 'meta': meta, 'dateCreated': dateCreated})
except json.JSONDecodeError as e:
return web.json_response({'error': 'invalid Json'}, status=400)
return web.json_response(list)
@server.PromptServer.instance.routes.get("/sdfx/workflow")
@server.PromptServer.instance.routes.post("/sdfx/workflow")
@server.PromptServer.instance.routes.put("/sdfx/workflow")
@server.PromptServer.instance.routes.delete("/sdfx/workflow")
@server.PromptServer.instance.routes.get("/sdfx/template")
@server.PromptServer.instance.routes.post("/sdfx/template")
@server.PromptServer.instance.routes.put("/sdfx/template")
@server.PromptServer.instance.routes.delete("/sdfx/template")
async def workflow_template(request):
method = request.method
path = request.url.path
if method == 'GET':
uid = request.query.get('uid')
if not uid:
return web.json_response({'error': 'uid missing'}, status=400)
if path == "/sdfx/workflow":
filename = os.path.join(workflows_path, f"{uid}.json")
elif path == "/sdfx/template":
filename = os.path.join(templates_path, f"{uid}.json")
if not os.path.isfile(filename):
return web.json_response({'error': 'file missing'}, status=404)
with open(filename, 'r') as file:
file_content = json.load(file)
return web.json_response(file_content)
elif method == 'POST' or method == 'PUT':
try:
data = await request.json()
data['dateCreated'] = int(time.time())
if(method == 'POST'):
hash = str(uuid.uuid4())
else:
hash = request.query.get('uid')
if not hash:
return web.json_response({'error': 'uid missing'}, status=400)
data['uid'] = hash
if path == "/sdfx/workflow":
filename = os.path.join(workflows_path, f"{hash}.json")
elif path == "/sdfx/template":
filename = os.path.join(templates_path, f"{hash}.json")
with open(filename, 'w') as file:
json.dump(data, file)
response = {'uid': data.get('uid'), 'name': data.get('name'), 'meta': data.get('meta'), 'dateCreated': data.get('dateCreated')}
return web.json_response(response)
except json.JSONDecodeError:
return web.json_response({'error': 'invalid Json'}, status=400)
elif method == 'DELETE':
uid = request.query.get('uid')
if not uid:
return web.json_response({'error': "Fatal: Parameter 'uid' missing"}, status=400)
if path == "/sdfx/workflow":
filename = os.path.join(workflows_path, f"{uid}.json")
elif path == "/sdfx/template":
filename = os.path.join(templates_path, f"{uid}.json")
if os.path.isfile(filename):
os.remove(filename)
return web.json_response({'uid': uid, 'status':'deleted'})
else:
return web.Response(status=404)
@server.PromptServer.instance.routes.get("/sdfx/input")
@server.PromptServer.instance.routes.delete("/sdfx/input")
@server.PromptServer.instance.routes.get("/sdfx/output")
@server.PromptServer.instance.routes.delete("/sdfx/output")
async def input_output(request):
method = request.method
path = request.url.path
if method == 'GET':
name = request.query.get('name')
if not name:
return web.json_response({'error': 'name missing'}, status=400)
if path == '/sdfx/input':
filename = os.path.join(folder_paths.get_input_directory(), name)
elif path == '/sdfx/output':
filename = os.path.join(folder_paths.get_output_directory(), name)
if not os.path.isfile(filename):
return web.json_response({'error': 'file missing'}, status=404)
return web.json_response({'name': name})
if method == 'DELETE':
name = request.query.get('name')
if not name:
return web.json_response({'error': 'name missing'}, status=400)
if path == '/sdfx/input':
filename = os.path.join(folder_paths.get_input_directory(), name)
elif path == '/sdfx/output':
filename = os.path.join(folder_paths.get_output_directory(), name)
if os.path.isfile(filename):
os.remove(filename)
return web.json_response({'name': name, 'status':'deleted'})
@server.PromptServer.instance.routes.get("/sdfx/input/list")
@server.PromptServer.instance.routes.get("/sdfx/output/list")
async def inputs_outputs(request):
list = []
path = request.url.path
if path == '/sdfx/input/list':
working_dir = folder_paths.get_input_directory()
elif path == '/sdfx/output/list':
working_dir = folder_paths.get_output_directory()
for filename in os.listdir(working_dir):
if '.' in filename:
list.append({'name': filename})
return web.json_response(list) | 12,729 | Python | .py | 282 | 38.12766 | 160 | 0.64333 | sdfxai/SDFXBridgeForComfyUI | 8 | 2 | 4 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,367 | prompt_parser.py | sdfxai_SDFXBridgeForComfyUI/libs/prompt_parser.py | from __future__ import annotations
import re
from collections import namedtuple
from typing import List
import lark
schedule_parser = lark.Lark(r"""
!start: (prompt | /[][():]/+)*
prompt: (emphasized | scheduled | plain | WHITESPACE)*
!emphasized: "(" prompt ")"
| "(" prompt ":" prompt ")"
| "[" prompt "]"
| "{" prompt "}"
| "{" (prompt "|" prompt)* "}"
scheduled: "[" [prompt ":"] prompt ":" [WHITESPACE] NUMBER "]"
WHITESPACE: /\s+/
plain: /([^\\\[\]():|{}]|\\.)+/
%import common.SIGNED_NUMBER -> NUMBER
""")
def conditioning_set_timeset_range_prompt_mapper(clip):
previous_step = [0]
def wrapped(prompt):
start = previous_step[0]
end = prompt[0]
previous_step[0] = end
tokens = clip.tokenize(prompt[1])
cond, pooled = clip.encode_from_tokens(tokens, return_pooled=True)
conditioning = [[cond, {"pooled_output": pooled}]]
return set_range(conditioning, start, end)
def set_range(conditioning, start, end):
c = []
for t in conditioning:
d = t[1].copy()
d['start_percent'] = start
d['end_percent'] = end
n = [t[0], d]
c.append(n)
return c
return wrapped
def get_learned_conditioning_prompt_schedules(prompts, env='prod'):
"""
>>> g = lambda p: get_learned_conditioning_prompt_schedules([p], 10)[0]
>>> g("test")
[[10, 'test']]
>>> g("a [b:3]")
[[3, 'a '], [10, 'a b']]
>>> g("a [b: 3]")
[[3, 'a '], [10, 'a b']]
>>> g("a [[[b]]:2]")
[[2, 'a '], [10, 'a [[b]]']]
>>> g("[(a:2):3]")
[[3, ''], [10, '(a:2)']]
>>> g("a [b : c : 1] d")
[[1, 'a b d'], [10, 'a c d']]
>>> g("a[b:[c:d:2]:1]e")
[[1, 'abe'], [2, 'ace'], [10, 'ade']]
>>> g("a [unbalanced")
[[10, 'a [unbalanced']]
>>> g("a [b:.5] c")
[[5, 'a c'], [10, 'a b c']]
>>> g("a [{b|d{:.5] c") # not handling this right now
[[5, 'a c'], [10, 'a {b|d{ c']]
>>> g("((a][:b:c [d:3]")
[[3, '((a][:b:c '], [10, '((a][:b:c d']]
>>> g("[a|(b:1.1)]")
[[1, 'a'], [2, '(b:1.1)'], [3, 'a'], [4, '(b:1.1)'], [5, 'a'], [6, '(b:1.1)'], [7, 'a'], [8, '(b:1.1)'], [9, 'a'], [10, '(b:1.1)']]
"""
def collect_steps(tree):
res = [1]
class CollectSteps(lark.Visitor):
def scheduled(self, tree):
tree.children[-1] = float(tree.children[-1])
res.append(tree.children[-1])
CollectSteps().visit(tree)
return sorted(set(res))
def at_step(step, tree):
class AtStep(lark.Transformer):
def scheduled(self, args):
before, after, _, when = args
yield before or () if step <= when else after
def start(self, args):
def flatten(x):
if type(x) == str:
yield x
else:
for gen in x:
yield from flatten(gen)
return ''.join(flatten(args))
def plain(self, args):
yield args[0].value
def __default__(self, data, children, meta):
for child in children:
yield child
return AtStep().transform(tree)
def get_schedule(prompt):
try:
tree = schedule_parser.parse(prompt)
except lark.exceptions.LarkError as e:
if 0:
import traceback
traceback.print_exc()
if(env != 'prod'):
return {"error": "Illegal characters", "logs": str(e), "prompt": prompt}
else:
return [[1, prompt]]
return [[t, at_step(t, tree)] for t in collect_steps(tree)]
promptdict = {prompt: get_schedule(prompt) for prompt in set(prompts)}
return [promptdict[prompt] for prompt in prompts]
if __name__ == "__main__":
import doctest
doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE)
else:
import torch # doctest faster | 4,051 | Python | .py | 112 | 27.589286 | 135 | 0.489812 | sdfxai/SDFXBridgeForComfyUI | 8 | 2 | 4 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,368 | char_recognizer_scripts_fake_actuator_server.py.sisc | cyiyang_miniros/drug-deliverer.si4project/cache/parse/char_recognizer_scripts_fake_actuator_server.py.sisc | 0 T ) ê Õµ Õµ Öµ Öµ ¥ÜÕÕµ ¥Ä©
Õµ T ” œ
Ø �S ` — ¨ P} ÿÿÿÿÿÿÿÿ¨j? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ \ �A"ÿÿÿÿ ÿÿ char_recognizer
˜
ðV X d Ø
`”; °| ¨j? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ T 5"ÿÿÿÿ ÿÿ scripts
hÐU e — È
°:" �A" ¨j? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ a pH"ÿÿÿÿ fake_actuator_server
8
U Æ )
€8 5" ¨j? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ \ X Ð8"ÿÿÿÿ ÿÿ doSomethingf °?" ÿÿ if __name__ == "__main__"
ÀS Î µ P¢> pH" ¨j? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ w T P ÿÿÿÿ ÿÿ reqU
D" ÿÿ responseb PE" ÿÿ if req request == 0`
ÿÿ responsepermissionS 0G" ÿÿ else :
¸
ðS f ™ ¸ bE Ð8" ¨j? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ b 4 ÿÿÿÿ ÿÿ PermissionMsgResponse
H
PT d X
À‘; Ð8" ¨j?ÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ
h
`V d ð“; Ð8" ÿÿÿÿÿÿÿÿ¨j?ÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ
(àT e — x
:" pH" ¨j? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ a ð6"ÿÿÿÿ ÿÿ fake_actuator_server
XU ^ d ˆ
–; °?" ¨j? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ Z 4 ÿÿÿÿ ÿÿ
rospyService$ è
È È pó> 8@ð> | 3,586 | Python | .py | 27 | 131.851852 | 536 | 0.145787 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,369 | deliver_scheduler_scripts_examples_StateMachineTest.py.sisc | cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_examples_StateMachineTest.py.sisc | 0 T ) ë Õµ Õµ Öµ Öµ ¥ÜÕÕµ ¥Ä©
Õµ T ” œ
È$ Ì b d ˆ#à+9 ÿÿÿÿÿÿÿÿHe? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ ^ xtÿÿÿÿ ÿÿ deliver_scheduler
x&`Ì X d (&À‘; P} He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ T ˜mÿÿÿÿ ÿÿ scripts
'ÀÌ Y d ø%0™; xt He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ U uÿÿÿÿ ÿÿ examples
'0Ì a d h&`”; ˜m He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ ] Øsÿÿÿÿ StateMachineTest
Ø$ÐË Ç ª x$ÀÀ" u He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ t V ³ R 6 Xqÿÿÿÿ ÿÿ StateY 6 Ø} ÿÿ StateMachinea $ $ $ 6 Øx ÿÿ TransitionNotAllowedX
¸z ÿÿ CoolingTimeO p ÿÿ sm
X$ÀÉ c d % 29 Øs He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ _ 7 ÿÿÿÿ ÿÿ statemachineState
è$ Ê j Ÿ h$ÐÚ# Øs He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ f 7 ÿÿÿÿ ÿÿ statemachineStateMachine
Ø#0É } » ø$È% Øs He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ y $ $ $ 7 ÿÿÿÿ ÿÿ, ,statemachineexceptionsTransitionNotAllowed
X%€Í ' ( (%P¢> Øs He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ » ] p Ê Y 8}ÿÿÿÿ ÿÿ speedUpStateZ ø{ ÿÿ
slowDownStateX
8s ÿÿ normalStateU
8x ÿÿ SPEED_UPV øq ÿÿ SLOW_DOWNY ÿÿ StateMachine
h%PÊ V d 8$�19 ¸z He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ R 4 ÿÿÿÿ ÿÿ State
x%`É V d 8%ð.9 ¸z He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ R 4 ÿÿÿÿ ÿÿ State
($àÊ V d %P,9 ¸z He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ R
4 ÿÿÿÿ ÿÿ State
˜#°Í a d È# -9 ¸z He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ ]
4 ÿÿÿÿ ÿÿ slowDownStateto
¸#Î ` d ¨#.9 ¸z He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ \ 4 ÿÿÿÿ ÿÿ speedUpStateto
è#�Ì \ d $€.9 Øs He? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ X 4 ÿÿÿÿ ÿÿ CoolingTime$ H%H ˆ$@ð> H$pó>
| 5,339 | Python | .py | 24 | 221.5 | 536 | 0.164033 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,370 | deliver_scheduler_scripts_scheduler_server.py.sisc | cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_scheduler_server.py.sisc | 0 T ) 5 Õµ Õµ Öµ Öµ ¥ÜÕÕµ ¥Ä©
Õµ T ” œ
¸€Í b d XÀ‘; ÿÿÿÿÿÿÿÿøg? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ ^ K K (-Dÿÿÿÿ ÿÿ deliver_scheduler
H 0É X d À˜; ˆ1D øg? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ T K K è+Dÿÿÿÿ ÿÿ scripts
x!pÎ a d H!P˜; (-D øg? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ ] K K È#Dÿÿÿÿ scheduler_server
¨ Ì Ä h˜z! è+D øg? ÿÿÿÿ
ÿÿÿÿÿÿÿÿÿÿÿÿ Á ï . Z ‹ r Í ] Y 6 ¨/Dÿÿÿÿ ÿÿ SchedulerROS` 6 *D ÿÿ SocketServiceMasterR ÿÿ DEBUGW ÿÿ
SLAVE_ADDRW ÿÿ
SLAVE_PORT] ÿÿ SLAVE_READY_PORTY
ÿÿ FIXED_PERIOD` (2D ÿÿ SchedulerServerMaing < |