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
0T)ê ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ Ø �S`—¨ P}ÿÿÿÿÿÿÿÿ¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\�A"ÿÿÿÿÿÿchar_recognizer ˜ ðVXdØ `”;°|¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT5"ÿÿÿÿÿÿscripts h ÐUe—È °:"�A"¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿapH"ÿÿÿÿfake_actuator_server 8  UÆ) €85"¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\XÐ8"ÿÿÿÿÿÿ  doSomethingf°?"ÿÿif __name__ == "__main__"  ÀSε P¢>pH"¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿw­TP ÿÿÿÿÿÿreqU D"ÿÿresponseb   PE"ÿÿif req  request == 0`   ÿÿresponsepermissionS  0G"ÿÿelse : ¸ ðSf™¸  bEÐ8"¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿb4ÿÿÿÿÿÿPermissionMsgResponse H PTdX À‘;Ð8"¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ h `Vd ð“;Ð8"ÿÿÿÿÿÿÿÿ¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ( àTe—x :"pH"¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿað6"ÿÿÿÿÿÿfake_actuator_server X U^dˆ  –;°?"¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿZ4ÿÿÿÿÿÿ  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
0T)ëÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ È$Ìbdˆ#à+9ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^xtÿÿÿÿÿÿdeliver_scheduler x&`ÌXd(&À‘;P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT˜mÿÿÿÿÿÿscripts 'ÀÌYdø%0™;xtHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUuÿÿÿÿÿÿexamples '0Ìadh&`”;˜mHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]ØsÿÿÿÿStateMachineTest Ø$ÐËǪx$ÀÀ"uHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿtV³R6XqÿÿÿÿÿÿStateY   6Ø}ÿÿ  StateMachinea$$$6ØxÿÿTransitionNotAllowedX  ¸zÿÿ  CoolingTimeOpÿÿsm X$ÀÉcd%29ØsHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ_7ÿÿÿÿÿÿstatemachineState è$ ÊjŸh$ÐÚ#ØsHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿf   7ÿÿÿÿÿÿstatemachineStateMachine Ø#0É}»ø$È%ØsHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿy$$$7ÿÿÿÿÿÿ,,statemachineexceptionsTransitionNotAllowed X%€Í'((%P¢>ØsHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ»]pÊY8}ÿÿÿÿÿÿ  speedUpStateZ   ø{ÿÿ  slowDownStateX   8sÿÿ  normalStateU   8xÿÿSPEED_UPVøqÿÿ  SLOW_DOWNYÿÿ  StateMachine h%PÊVd8$�19¸zHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR4ÿÿÿÿÿÿState x%`ÉVd8%ð.9¸zHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR   4ÿÿÿÿÿÿState ($àÊVd%P,9¸zHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR   4ÿÿÿÿÿÿState ˜#°ÍadÈ# -9¸zHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]   4ÿÿÿÿÿÿslowDownStateto ¸#Î`d¨#.9¸zHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\4ÿÿÿÿÿÿspeedUpStateto è#�Ì\d$€.9ØsHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿX4ÿÿÿÿÿÿ  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
0T)5ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ ¸€ÍbdXÀ‘;ÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^KK(-Dÿÿÿÿÿÿdeliver_scheduler H 0ÉXd À˜;ˆ1Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTKKè+Dÿÿÿÿÿÿscripts x!pÎadH!P˜;(-Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]KKÈ#Dÿÿÿÿscheduler_server ¨ÌÄh˜z!è+Døg?ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÁï.Z‹rÍ]Y6¨/Dÿÿÿÿÿÿ  SchedulerROS`6*DÿÿSocketServiceMasterRÿÿDEBUGW ÿÿ  SLAVE_ADDRW ÿÿ  SLAVE_PORT]ÿÿSLAVE_READY_PORTY ÿÿ  FIXED_PERIOD`(2DÿÿSchedulerServerMaing <"%DÿÿDrugCoolingTimeHandlerMainf >K >ˆ,Dÿÿif __name__ == "__main__" (pËk (@Ô#È#D øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿg7ÿÿÿÿÿÿscheduler_rosSchedulerROS €Êr«øø%"È#D øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿn7ÿÿÿÿÿÿ!!SocketServiceSocketServiceMaster ÈÎdxð“;È#D øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ˆ�ÌŠO˜P¢>È#D  øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ+Öd`   È(DÿÿÿÿÿÿneedToChangeServicen'<'H!Dÿÿ!!while not rospy  is_shutdown ( )Q(( (¨ Dÿÿneed[/ // H&Dÿÿchange_success HÀÉddÈ`”;%Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ`   4ÿÿÿÿÿÿSocketServiceMaster X Í„ÆhpP?%Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€)<)¨%Dÿÿÿÿÿÿ33if need != NeedToChangeStatus  DONT_CHANGE  value °ÍíP˜ ÀÀ"H!Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹�}* ,* h$Dÿÿÿÿÿÿ00if need == NeedToChangeStatus  SPEED_UP  value~, ., è!Dÿÿ11if need == NeedToChangeStatus  SLOW_DOWN  value„0 60 ˆ"Dÿÿ77if need != deliverScheduler  GetNeedToChangeStatus ( )^6 <6 è&Dÿÿif change_success ( @Îdˆp—;¨%Dÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 8!`ÌdèД;¨%Dÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ˜ÀÌdø –;¨%Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ x Ëd¸à—;¨%Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Ø0Ìw²ð U%Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿs(((4ÿÿÿÿÿÿ&&deliverSchedulerGetNeedToChangeStatus X  Ëi�(!ØØ#%Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿe/ / / 4ÿÿÿÿÿÿneedToChangeServicecall ˆ PÍÁ!¨ H8È#D  øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿa]???hDÿÿÿÿÿÿdeliverScheduler\BFBÈ2Dÿÿif FIXED_PERIOD h!ðÌ]dh —;ˆ,Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿY???4ÿÿÿÿÿÿ  SchedulerROS ¸  Êd!�–;ˆ,Døg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$KKˆ`#8øpó>Ø @ð><'<)<6<06>KBF
7,305
Python
.py
34
213.882353
739
0.185644
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,371
actuator_scripts_actuator_points.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/actuator_scripts_actuator_points.py.sisc
0T)ÕÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ Ø�SYdHð“;ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUIIxoÿÿÿÿÿÿactuator xðVXd(`”;ÐzHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTIIøqÿÿÿÿÿÿscripts h�V`dø�–;xoHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\II°|ÿÿÿÿactuator_pointshë$•Ÿx JAøqHe? ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿxlCjâ ¥Ë/V«¿R6P}ÿÿÿÿÿÿPointQ%%%60ÿÿPoseW+++6x~ÿÿ  Quaternionb6Øxÿÿquaternion_from_eulerO68xÿÿpiX Xqÿÿ  quaternionsY  ÿÿ  euler_anglesfxyÿÿfor angle in euler_angles] ÿÿpoint_ABC_master^ !!!ÿÿpoint_1234_mastera (((ÿÿpoint_special_master\ ///ÿÿpoint_ABC_slave] 444ÿÿpoint_1234_slave`;;;ÿÿpoint_special_slavebCCC ÿÿpoint_special_watcher ˆðShœ˜0^E°|He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿd7ÿÿÿÿÿÿgeometry_msgsmsgPoint ÈPTgšØ(`E°| He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿc%%%7ÿÿÿÿÿÿgeometry_msgsmsgPose è°Tm£ø(m>°| He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿi+++7ÿÿÿÿÿÿgeometry_msgsmsgQuaternion ˆ Uyµ˜&?°|He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿu7ÿÿÿÿÿÿ((tftransformationsquaternion_from_euler ¨àTXd˜à—;°|He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT7ÿÿÿÿÿÿmathpi hUUd¸À‘;°| He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQ4ÿÿÿÿÿÿlist ÐU€ø å>°|He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªXT kÿÿÿÿÿÿq_angleN˜rÿÿqR ÿÿangle (ÀVf™èÈbExyHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿb4ÿÿÿÿÿÿquaternion_from_euler X`V[d8 ™;xyHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿW4ÿÿÿÿÿÿ  Quaternion$II8˜$8¸pó>@ð>
5,781
Python
.py
20
288.1
593
0.156716
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,372
deliver_scheduler_scripts_SocketService.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_SocketService.py.sisc
0T)Ç ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ x"ÐËbdX#À‘;ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^``Ønÿÿÿÿÿÿdeliver_scheduler h%°ÍXd$29P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT``ølÿÿÿÿÿÿscripts h$€Í^dØ#`›;ØnHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿZ``¸zÿÿÿÿ  SocketService (#0Ìh#¨aEølHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿºYU˜wÿÿÿÿÿÿ__init__]B%˜mÿÿwait_for_serviceQC`CØsÿÿcall È!°Ê‚²x#P¢>¸zHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU° +ÌlQ    ÿÿÿÿÿÿselfW    ÿÿ  slave_addrW    ÿÿ  slave_port]    ÿÿslave_ready_port\    ÿÿuse_full_socket[ ÿÿtime_to_returnSÿÿsocket ˆ!ÌE]˜"ðó¸zHe?ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ”U:Ü"é¿�Q ÿÿÿÿÿÿselff!Xvÿÿif self  use_full_socket_%%%øqÿÿslave_ready_socket[&&&ÿÿserver_addressW(0(Xqÿÿ  while TrueZ444kÿÿ  received_dataV777¸uÿÿ  json_dataQ88 88nÿÿdataX ;;;øvÿÿ  slave_ready Ø! ÎWd"ð“;˜m He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿS  xyÿÿÿÿÿÿsocket 8#Î^d" –;XvHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿZ   4ÿÿÿÿÿÿ  socketsocket 8" Ë^d˜!`”;˜m He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿZ%%%4ÿÿÿÿÿÿ  socketsocket ("`ÌVd#0™;˜m He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR) ,) 8sÿÿÿÿÿÿtry : Ø"ÀÌd¨!Д;XqHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ¸!�ÌhœX"PÐ#˜m He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿd4444ÿÿÿÿÿÿslave_ready_socketrecv ˆ"àÊe—¨"˜r˜m He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿa7774ÿÿÿÿÿÿreceived_datadecode ø"Ë[d¸"�–;˜m He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿW8884ÿÿÿÿÿÿ  jsonloads #ðÌYd8%—;˜m  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU;;;4ÿÿÿÿÿÿdataget x%à¶E4tH$˜z!¸zHe?ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÝQª‚Uç?ø›QC CC ÿÿÿÿÿÿselfQCCC ÿÿneedfDFDzÿÿif not self  slave_readyjGJGØxÿÿif not self  use_full_socketaLNLxtÿÿif not self  socketTPPPÿÿrequestXQQQx~ÿÿ  request_strYVVV8xÿÿ  response_strU YYY¸kÿÿresponseˆ \^\uÿÿ;;if "Success" in response and response [ "Success" ] == TrueS ^`^Xlÿÿelse : è$@Îd˜$p—;ØsÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ X$0ÉdH%à—;Øs He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ¨$@Ëd%P˜;ØsÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ˆ$ÀÉ[d($À˜;Øs He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWQQQ4ÿÿÿÿÿÿ  jsondumps ¸$`ÉadÈ$ ™;Øs He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]VVV4ÿÿÿÿÿÿselfsocketrecv Ø$PÍ[dø$Œ;Øs  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWYYY4ÿÿÿÿÿÿ  jsonloads ˜#pËd%ðš;Øs ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ (% ÍdX%š;Øs ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$``H#%"h"pó>8$@ð>C`GJB!(0),
9,051
Python
.py
42
214.52381
1,281
0.163485
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,373
deliver_scheduler_scripts_examples_regressionTests.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_examples_regressionTests.py.sisc
0T)ÍÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ ¸ 0Ébdˆ À˜;ÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^))°ø ÿÿÿÿÿÿdeliver_scheduler ˜ pÎXdè À‘;°|øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT))0!ÿÿÿÿÿÿscripts ( pËYdø 0™;°ø øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU))ø ÿÿÿÿÿÿexamples X �Ì`dX —;0!øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\))P}ÿÿÿÿregressionTests ( ðÉjŸ8 p+!ø øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿf)Pþ ÿÿÿÿÿÿif __name__ == "__main__" ˜ ÀÉZdè ð“;P}øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVp÷ ÿÿÿÿÿÿ  scheduler ø  ÊZd `”;Pþ øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿV4ÿÿÿÿÿÿ  Scheduler$))ˆ (m> pó>H Hè>)
2,573
Python
.py
8
320.75
557
0.129384
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,374
deliver_scheduler_scripts_examples_CoolingTimeRefreshTest.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_examples_CoolingTimeRefreshTest.py.sisc
0T)ÔÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ ( �Sbš ÀdEÿÿÿÿÿÿÿÿ8]?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^rr0B"ÿÿÿÿÿÿdeliver_scheduler ø ğSXdØ  –;Ğz8]?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTrr�F"ÿÿÿÿÿÿscripts 8 PTYdè ğ“;0B"8]?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUrr°:"ÿÿÿÿÿÿexamples Ø `Vgšè heE�F"8]?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿcrr°|ÿÿÿÿCoolingTimeRefreshTest x ĞUjŸ¨ dE°:"8]?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿfrcP}ÿÿÿÿÿÿif __name__ == "__main__" ˆ  UZd˜ À‘;°|8]?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿV�<"ÿÿÿÿÿÿ  scheduler È ÀSZd˜ à—;P}8]?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿV4ÿÿÿÿÿÿ  Scheduler$rrx ØÃ#¸ pó>h Hè>r
2,872
Python
.py
13
220
536
0.122727
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,375
deliver_scheduler_scripts_scheduler.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_scheduler.py.sisc
0T)V}ΥµΥµΦµΦµ¥άΥ Υµ¥Δ© ΥµT”� (ΜbdΘ`”;��������He?����������������^ll@ή!������deliver_scheduler XpΧXd¨ Ϊ#°|He?����������������Tll Σ!������scripts xΰΩZdΘ0Ϊ#@ή!He?����������������VllP}����  schedulerΨHΉE~HN Σ!He?����������������¬Ώ.μΟ\�W£I· �jUQ6pς ������EnumS6σ ��uniqueQ6�π ��ceilR6Πη ��floor\6pγ ��ReloadableTimerR60ρ ��StateY   6Pο ��  StateMachinea$$$6δ ��TransitionNotAllowed[  0η ��LitterStrategy\  ι ��CoolingTimePlanZ Πρ ��  NeedToSeePlanY  ��  LANDFILL_DSTV N: °σ ��  SchedulerXQVQ `Ν!��  RequestTypeYXX X έ!��  TargetStatus_^^^ΐΫ! ��NeedToChangeStatusXcl c ΰΩ!��  CoolingTime ��ΙZdθΐ‘;P}He?����������������V7������  enumEnum �@Λ\dΈπ“;P}He?����������������X7������  enumunique ΠΞZd�Π”;P}He?����������������V7������  mathceil (pΛ[dΘ –;P}He?����������������W7������  mathfloor Ψ Λq©ψ%"P} He?����������������m7������  reloadable_timerReloadableTimer 80Μcd�;P} He?����������������_7������statemachineState 80Ιj�h0!P} He?����������������f   7������statemachineStateMachine xΛ}»H�%P}He?����������������y$$$7������,,statemachineexceptionsTransitionNotAllowed �°ΚUdX�–;P} He?����������������Q 4������Enum xΰΚUd¨—;P} He?����������������Q 4������Enum ΈΠΛUd(p—;P} He?����������������Q4������Enum((� *!ΒάHΐϊ!P} He?����)(������������§ dG²ΒqΟaθ ε@�*C &ή x ) q e Η‚ΌkYξ� ―Ζ A ‡ ¤ UhO°ι ������__init__R&&&��queueT'''��startedY(((��  classWeightsT)))��CAR_CNTW***��  nextTargetV+++pν ��  queueLockR,,,��DEBUG[ ---��litterStrategyX 000��  DRUG_PERIOD_ 77 7��NEED_TO_SEE_PERIODW >>>��  drugRemain[ ???�λ ��drugRemainLockcC C(C ��drugSupplementIntervalWHHH��  __noTarget]MMM ��__dropDrugTargetdRR%R°δ ��coolingTimeStateMachineaUU"U��drugSupplementTimers[]]]��remindIntervalU^^^Pε ��remindergbb(bΠβ ��changeDrugCoolingCountDowneee&eπε ��changeNeedToSeeCountDownRioi�ζ ��startZpΕUp0μ ��  GetNextTargetVΖΟ ΖΠϋ  ��  DeliveredZΠδΠύ ��  GetNewRequest]ενεΠφ  ��__UpdatePriorityWξςξψ ��  DrugLoaded]σψσ°ψ ��__DrugTracerMain_ωύωΰθ! ��__UpdateRemainDrugZώώ`α!��  GetRemainDrug]    η!��GetRequestStatusV!  @θ!��  TerminateT"��runningb#1! ΰ!��GetNeedToChangeStatus_$292@Ω!��ForgiveCurrentTaskb%:B:@Ο!��UpdateDrugCoolingTimeX&CFC Ψ!"��  BoardRemindd'GNG`�!��UpdateNeedToSeeIntervalS($��object 8pΞ£�¨ι"°σ (He?����������������UΒi «Q  ������selfR  ��DEBUG[ ��remindInterval[ ��LitterStrategyUBDBPτ ��if DEBUGSDGDPκ ��else : hPΝd�ΐ�;°ι He?�������������������� h@Ξd�0™;°ι He?�������������������� 8πΜ`dxΰ—;°σ (He?����������������\+++4������threadingRLock X`Ι`d¨P�;°σ  (He?����������������\???4������threadingRLock ¨ Ξ\dx ™;°σ (He?����������������XRRR4������  CoolingTime ΈΞ`dΈ`›;°σ (He?����������������\^^^4������ReloadableTimer H`Μ`dθπ�;°σ (He?����������������\bbb4������ReloadableTimer Θ�Μ`dΨ�;°σ (He?����������������\eee4������ReloadableTimer θΐΙεW(`RE°σ !(He?����������������UQiii ������self�kmkΠμ ��??for drugType , timer in self  drugSupplementTimers  items ( ) XπΙ―Θ 7�ζ ��������He?����������������YUk kk ������drugTypeRkkk��timer ΐΜfψΐΐ"°σ (He?����������������Uo¬Qppp ������selfSpp"p ��car_idby{yπκ ��if not self  startedY|||��  targetStatus�~ΑC~pθ ��oOif ( self  nextTarget [ car_id ] is None or self  nextTarget [ car_id ] [SΒΕΒPω ��else :  ΝdΨ�190μ ��������He?�������������������� €ΝΡ9ψ(`0μ He?����������������fbƒ ™ƒ ξ ������with self  queueLockg› Ύ#› 0β ��with self  drugRemainLock  Κ·ΈΠbEpθ He?����������������`\„–„°ξ ������if self  queueS–™–�α ��else : θ°Ν�Α�`Y?ξ He?����������������}‡“ ‡πτ ������00for index , target in enumerate ( self  queue ) HΰΝ7PxPi?°ξ He?�����������������ΰ†‰“ ‰πο ������99if self  GetRemainDrug ( target [ "requestType" ] ) >= 1R‡‡‡��indexS‡‡%‡��target HPΚd829 πτ He?�������������������� h€ΚdΨΰ+9ξ He?�������������������� X Τ ΅0hpθ He?����������������†‚�«��� ������55if self  litterStrategy == LitterStrategy  DROP_MAX�­Ί ­0!��??elif self  litterStrategy == LitterStrategy  DROP_SMALLER_MAX†ΌΎΌ�ϊ ��99elif self  litterStrategy == LitterStrategy  DONT_THROW X ΣΔ&hXE>0β He?����������������miΆ¥Ά0ϋ ������if mostStockedDrugAmount < 3S¥«¥�υ ��else : °Πd�P,9�� He?�������������������� ψΰΣd� -9�� He?�������������������� Έ€ΣΥ?8Έb0β He?����������������~z²΄²Pώ ������--if drugTypeCloserTo3Amount == float ( "inf" )S΄Ί΄πω ��else : ��d(.90!��������He?�������������������� xΰΠd(€.90!He?�������������������� ¨pΤd�π.90β ��������He?�������������������� Θ0ΟdθΠΥ#0μ He?�������������������� ψΠΤ$¶ΰ�E°σ (He?����������������U¬QΖΖΖ ������selfSΖΖΖ ��car_idtΚΝΚpό ��''if self  nextTarget [ car_id ] is None ¨ΐ�dΘ�Χ#Πϋ He?�������������������� ΨΐΟΨΔ�@�"°σ (He?����������������±zUQΠΠΠ ������selfXΠΠ'Π ��  requestType_Π)Π;Π) ��deliverDestinationbΤδΤ°ύ ��with self  queueLockZΥ ΥΥ ��  requestDetail XΟi�ψ((!ύ He?����������������eΫ γΫ πώ ������for item in self  queue HΠΡυoθ ε>°ύ He?���������������� �άγά0φ ������”Oif ( item [ "requestType" ] == requestDetail [ "requestType" ] and item [ "QΫΫΫ��item x�Οdθΐ�#πώ He?�������������������� �Τ��θ3°σ &(He?����������������U­Qεεε ������selfTεε&ε ��timeNowbλνλpχ ��with self  queueLock ¨ ΠdX€Τ#Πφ ��������He?�������������������� `Ο¬H¨7°σ  (He?����������������UQξξξ ������selfSξξξ ��car_id (`��hH-°σ (He?����������������U®Qσσσ ������selfUσσ'σ ��drugTypeaυψυ€δ!��while self  running �dh`Ξ#°ψ He?�������������������� Έ Ρp(ΨPΆ>°σ '(He?����������������®UQωωω ������selfUω!ω)ω! ��drugTypeSω+ω1ω+ ��addendgϋύϋΰγ!��with self  drugRemainLock ψ°Σd80Σ#ΰθ!��������He?�������������������� €Π¥Θθi°σ (He?����������������U®Qώώώ ������selfUώώ$ώ ��drugTypeg��ΐε!��with self  drugRemainLock (@Ρd�Ρ#`α!��������He?�������������������� ¨pΡ–8@2°σ  (He?����������������U©Q ������selfP ��resb  β!��with self  queueLock ΈPΣdΘΨ# η!He?�������������������� Ψ0�UdxΠΞ#°σ !#(He?����������������Q    ������self π�Ι;Hπσ°σ #(He?���� �������������r»2ΥxUQ" ������selfb"η!��with self  queueLock\  ��haveRequestForAY  ��  overflowForBY  ��  overflowForCY��  noRemainForA�"("β!��|Oif ( haveRequestForA and noRemainForA and self  coolingTimeStateMachine �(/(@γ!���Oelif ( ( not noRemainForA ) and ( overflowForB or overflowForC ) and selfS /1/€Π!��else : h@Τ"ƒX€}! ΰ! He?����������������αl8­h  €ι!������for request in self  queueq  ΐΰ!��$$if self  GetRemainDrug ( "A" ) <= 0S  €ί!��else :q  `ζ!��$$if self  GetRemainDrug ( "B" ) >= 3q  "   ε!��$$if self  GetRemainDrug ( "C" ) >= 3 �πΟΜ2dη!He?����������������tpΰή!������##if request [ "requestType" ] == "A"T��request xPΠd� Χ#€ι!He?�������������������� hΡd8pΨ#η!He?�������������������� ( Φdψ Σ#η!He?�������������������� ��ΨdHΤ#η!He?�������������������� ¨ΥdxπΤ#η!He?�������������������� ΈΪdΘΰΨ# ΰ! He?�������������������� Έ0ΥdΨΫ# ΰ! He?�������������������� Θ0ΨdΨ`Υ# ΰ! ��������He?�������������������� �`Ψ$¶θ�…E°σ $(He?����������������U¬Q222 ������selfS2!2'2! ��car_not464 Ϋ!��''if self  nextTarget [ car_no ] is None ΐΥd@Φ#@Ω!��������He?�������������������� 8PΦ@ΰΨ?°σ %$(He?�����������������UQ::": ������selfQ:$:(:$ ��plan’<B<@Τ!��EEfor drugType , newInterval in self  DRUG_PERIOD [ plan ]  items ( ) ¨ ΩµθΈ7@Ο!He?����������������YU< << ������drugTypeX<<!<��  newInterval X`ΥUdψ@Ο#°σ &(He?����������������QCCC ������self (°Φ ’π.°σ '%(He?�����������������UQG G$G ������selfQG&G*G& ��plan^HHH��newRemindInterval (€ΦΖ)Xΐ:!P} He?����������������Όq^ZRRR������  GetNewRequestZSSS��  GetNextTargetWTTT��  DrugLoadedVUUU��  DeliveredQQQQ��Enum ¨@ΪUdh°Ο#P}He?����������������QXXX4������Enum �@ΧUd�P�#P}He?����������������Q^^^4������Enum θΠΪ'(�(\"P}He?����������������»]pΚYeee Ρ!������  speedUpStateZfffΐΡ!��  slowDownStateXggg€Ϊ!��  normalStateUjj j`ά!��SPEED_UPVkkkέ!��  SLOW_DOWNYccc��  StateMachine pΪVd(€Ϋ#ΰΩ!He?����������������Reee4������State hΐΨVd8°Φ#ΰΩ!He?����������������Rfff4������State πΨVdΈ Π#ΰΩ!He?����������������Rggg4������State H�ΥadPΩ#ΰΩ!He?����������������]jjj4������slowDownStateto Έ€Ω`d8ΐΩ#ΰΩ!He?����������������\kkk4������speedUpStateto$ll¨ JAψpσ>.PHΘcl QV N CFΖΟΚΝξςσψυψ291(/"("ΠδΤδΫγάγpΕΒΕ~Α›Ύ­Ί΄Ί�«¥«Ά¥ƒ™–™„–‡“‰“ώ  hDGio :B<BGNενωύ
34,598
Python
.py
121
284.942149
1,851
0.11358
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,376
actuator_scripts_mission_server.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/actuator_scripts_mission_server.py.sisc
0T)êÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ ( @ÎYd˜ À‘;ÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU%%À¶ÿÿÿÿÿÿactuator È àÊXdˆ `”;°|øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT%% »ÿÿÿÿÿÿscripts h `Ì_dx ð“;À¶øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[%%P}ÿÿÿÿmission_server ¨ ˉM˜ P¢> »øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈYU   ½ÿÿÿÿÿÿresponsek€ºÿÿif request  request_type == 1S`Áÿÿelse :f%`¼ÿÿif __name__ == "__main__" H ðÌgšÈ �#!P}øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿc   4ÿÿÿÿÿÿDestinationMsgResponse È `É)>Ø ¸bP}øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿgÔcà¾ÿÿÿÿÿÿresponsedrug_locationi%à¹ÿÿresponsedeliver_destinationQ ÿÿtemp è PÍ_dØ p—;€ºøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[4ÿÿÿÿÿÿrandomrandint ø Î_dè  –;€ºøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[4ÿÿÿÿÿÿrandomrandint ¸  ÊÔ>( ØgP}øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿgcÿÿÿÿÿÿresponsedrug_locationi%ÿÿresponsedeliver_destination H Ì8 øcEP}øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ`¾\ÿÿÿÿÿÿrequestType_dicZÿÿ  responseToABCS!! ! ½ÿÿserver X @Ë^d˜ à—;`¼øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿZ!!!4ÿÿÿÿÿÿ  rospyService$%%h Ðz @ð>( pó>%
4,418
Python
.py
20
219.95
536
0.151853
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,377
deliver_scheduler_scripts_reloadable_timer.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_reloadable_timer.py.sisc
0T)ú$ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ ˜ �Ébdè À‘;ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^WWPô ÿÿÿÿÿÿdeliver_scheduler ˜0ÉXd¨`›;P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTWW�ğ ÿÿÿÿÿÿscripts È  ÎadXÀ˜;Pô He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]WW�ë ÿÿÿÿreloadable_timer ø `Ì`d ğ“;�ğ He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\WP Pê ÿÿÿÿÿÿReloadableTimer(¨ à$!ÁŒ È ˆR%�ë He? ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿj�íY6¿j²zÒĞm©KzÅ%U Ğñ ÿÿÿÿÿÿ__init__U   ÿÿinterval[   ÿÿreloadIntervalU   ÿÿfunctionQ   ÿÿargsS   ÿÿkwargsSÿÿthreadTÿÿrunningV ÿÿ  startTimeW ÿÿ  autoReloadR  0ì ÿÿstartQ & ğê ÿÿ_runQ '*'pò ÿÿstopT+2+På  ÿÿrestart`3:3°ä ÿÿrestartWithIntervalT;=;°ó ÿÿisAlive[>C>Pï ÿÿgetElapsedTimeZDIDğå ÿÿ  getRemainTimeZJPJpè ÿÿ  setRemainTime[QTQğï ÿÿsetNewInterval^UWU0ñ ÿÿgetReloadIntervalSÿÿobject  àÊ’Ø P¢>Pê He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿb® U·Q ÿÿÿÿÿÿselfU ÿÿintervalW!+! ÿÿ  autoReloadU-5- ÿÿfunctionQ7;7 ÿÿargsS@F@ ÿÿkwargs  Ì·ˆ øcEPê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQ ÿÿÿÿÿÿself^Ğì ÿÿif self  running ¸ ğÌd(  ™;0ì ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ H €ÍºX X_EPê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQ  ÿÿÿÿÿÿselfa#&#°î ÿÿif self  autoReload è ÀÌdø `”;ğê He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ÍUd( Ğ”;Pê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQ' '' ÿÿÿÿÿÿself 8 @΃¡HxfPê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ®UQ+++ ÿÿÿÿÿÿselfU+++ ÿÿintervald-/-Ğç ÿÿif interval is not Nonei/1/ó ÿÿif self  thread is not None HPÍd8 –;På He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Ø ËdhŒ;På ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ hp˨XèiPê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ®UQ33 3 ÿÿÿÿÿÿselfU3"3*3" ÿÿintervali797pí ÿÿif self  thread is not None ÈpÎdx�–;°ä ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ x°ÍUdØ —;Pê He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQ;;; ÿÿÿÿÿÿself Ğν¨aEPê He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQ>>> ÿÿÿÿÿÿselfd@B@î ÿÿif not self  startTime è�Ìdè 0™;Pï ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ (0̽€`EPê He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQDDD ÿÿÿÿÿÿselfdFHF�á ÿÿif not self  startTime ˆ àÍdˆp—;ğå ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ˜ ĞËœø ˜0Pê He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ°UQJJJ ÿÿÿÿÿÿselfWJJ&J ÿÿ  remainTime_LOL�æ ÿÿif remainTime <= 0 ø€Êdà—;pè He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ¨ α ( 7Pê He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQQQQ ÿÿÿÿÿÿselfXQQ(Q ÿÿ  newInterval ¸ @ËUd¸P˜;Pê He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQUUU ÿÿÿÿÿÿself$WWH ˜VEˆ Hè>8@ğ>W >CUWDI;=+23:&#&QTJPLO'*
10,250
Python
.py
40
255.275
1,109
0.156106
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,378
char_recognizer_scripts_recognizer.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/char_recognizer_scripts_recognizer.py.sisc
0T)¨ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ 8  ÍdX ð“;ÿÿÿÿÿÿÿÿè_?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$=(  JAÈ @ð>
780
Python
.py
2
389.5
536
0.073171
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,379
actuator_scripts_permission_client.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/actuator_scripts_permission_client.py.sisc
0T)ÃÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ ¨ ÌYdÈ À‘;ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU©ÿÿÿÿÿÿactuator (`ÌXd ™;ÐzHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT€µÿÿÿÿÿÿscripts hPÍbdˆp—;©He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^°|ÿÿÿÿpermission_client ˜ 0ÌjŸH ˆ%!€µHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿf  P}ÿÿÿÿÿÿif __name__ == "__main__" ¸ °Ê)’ P¢>°|He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿX«W·S   ³ÿÿÿÿÿÿclientPÀ±ÿÿreqR  ®ÿÿrate5S €«ÿÿrate30[ÿÿpermission_dicn  ³ÿÿ!!while not rospy  is_shutdown ( ) x €Ícdè À˜;P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ_   4ÿÿÿÿÿÿrospyServiceProxy 8 Ëe—ø `¨P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿa4ÿÿÿÿÿÿPermissionMsgRequest X pË[d ð“;P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿW4ÿÿÿÿÿÿ  rospyRate h àÍ[dx `”;P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿW4ÿÿÿÿÿÿ  rospyRate X  Ë( €`EP}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¿UQ @´ÿÿÿÿÿÿrespfà´ÿÿif resp  permission == 0Sàªÿÿelse : ¨ 0É\d8  –; ³He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿX4ÿÿÿÿÿÿ  clientcall h Édˆ Д; ³He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ È àÊUdØ �–; ³He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQ  à¯ÿÿÿÿÿÿresp è °Í\dø —;àªHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿX   4ÿÿÿÿÿÿ  clientcall$H Ø*"˜ pó> @ð> 
4,883
Python
.py
23
211.347826
536
0.142563
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,380
deliver_scheduler_scripts_examples_SchedulerExample.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_examples_SchedulerExample.py.sisc
0T)x ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ ˆàÍbd˜À‘;ÿÿÿÿÿÿÿÿ¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^440ñ ÿÿÿÿÿÿdeliver_scheduler HpËXd( ™;°|¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT44Pê ÿÿÿÿÿÿscripts XàÊYdX –;0ñ ¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU44Pï ÿÿÿÿÿÿexamples @Ëad˜Д;Pê ¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]44P}ÿÿÿÿSchedulerExample h ËjŸ(@Ô#Pï ¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿf4%î ÿÿÿÿÿÿif __name__ == "__main__" ø ÍdèP¢>P}¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿZ± Vpè ÿÿÿÿÿÿ  schedulerS �ë ÿÿtargetT °î ÿÿtarget1W242Ðç ÿÿ  while True ¸ÎZdØ`”;î ¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿV4ÿÿÿÿÿÿ  Scheduler x0ÉhœhèÔ#î ¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿd4ÿÿÿÿÿÿschedulerGetNextTarget 8ÐÎhœè(Ú#î ¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿd4ÿÿÿÿÿÿschedulerGetNextTarget HPÊdøð“;î ÿÿÿÿÿÿÿÿ¨j?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$44x`;#ˆpó>Hè>4
3,556
Python
.py
13
272.615385
536
0.148138
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,381
actuator_scripts_actuator_watcher.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/actuator_scripts_actuator_watcher.py.sisc
0T)6KÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ x�SYdxÀ‘;ÿÿÿÿÿÿÿÿ�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU��h"ÿÿÿÿÿÿactuator x @SXdh àî"Ğz�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT��¨"ÿÿÿÿÿÿscripts X ÀQadø õ"h"�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]��°|ÿÿÿÿactuator_watcher Øé6(ˆˆü"¨"�^?ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ0f±Á Oì}Ó�b6P}ÿÿÿÿÿÿpoint_special_watcherW6Ønÿÿ  GoalStatus[6xoÿÿMoveBaseActionY///68nÿÿ  MoveBaseGoalR   6XqÿÿStateY  68sÿÿ  StateMachine[   6ØsÿÿEveryoneStatusY  xtÿÿ  thread_Slave_ M= XvÿÿSimpleStateMachine^ O‚3O ølÿÿSendCar2Somewheref „� „X…ÿÿif __name__ == "__main__" (`Vv±ÈØ ?°| �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿr7ÿÿÿÿÿÿ%%actuator_pointspoint_special_watcher ˜ÀSn¥˜(m>°| �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿj7ÿÿÿÿÿÿactionlib_msgsmsgGoalStatus Ø Ur«8؉E°| �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿn7ÿÿÿÿÿÿ!!move_base_msgsmsgMoveBaseAction HğSp¨¸HçÙ°| �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿl///7ÿÿÿÿÿÿmove_base_msgsmsgMoveBaseGoal ØàTcdhğ“;°| �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ_   7ÿÿÿÿÿÿstatemachineState ÈUjŸè bE°| �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿf  7ÿÿÿÿÿÿstatemachineStateMachine ĞUl¢Ğ÷°| �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿh   7ÿÿÿÿÿÿactuatormsgEveryoneStatus (�Vd¨�–;°| �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ˜ë$J½h JA°|  �^? ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿYmÇbŒ)º²íUpÿÿÿÿÿÿ__init__UÿÿactuatorR øvÿÿStartVzÿÿ  TemporaryT XlÿÿHarbourZÿÿ  Single_TicketQ#uÿÿWaitV$*$kÿÿ  AllowedGo^ +0+X{ÿÿbefore_transition_ 1< 1¸pÿÿon_enter_Temporary] =M=8xÿÿon_enter_HarbourY %ÿÿ  StateMachine xğV®Ø 7Xv �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQ ÿÿÿÿÿÿselfU ÿÿactuator 8`YVd¸p—;Xv �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR4ÿÿÿÿÿÿState ÈĞ^Vdˆ`”;Xv �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR4ÿÿÿÿÿÿState Hà]VdèŒ;Xv �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR4ÿÿÿÿÿÿState ˜�YUd¨ –;Xv �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQ  ÿÿÿÿÿÿself Ø0\2HH`,=Xv �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÛUQ$$$ ÿÿÿÿÿÿself‚&(&Ø}ÿÿ55if self  actuator  master_location == "HandWritten"S(*(¸zÿÿelse : hÀYd¸—;kÿÿÿÿÿÿÿÿ�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ XP]dèĞ”;kÿÿÿÿÿÿÿÿ�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ È ZÔ¾ø¨æ!Xv  �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU« nQ+++ ÿÿÿÿÿÿselfR++$+ ÿÿstate[,,,¸uÿÿWatcher_status`---ÿÿWatcher_statusnameb...ÿÿWatcher_statusstatus ^_døà—;X{�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[,,,4ÿÿÿÿÿÿEveryoneStatus ğYÓæ(°µEXv  �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|Uª‰ïQ111 ÿÿÿÿÿÿselfQ33 3øqÿÿgoalm44)4ÿÿ  goaltarget_poseheaderframe_idj55&5˜rÿÿgoaltarget_poseheaderstampb666ÿÿgoaltarget_posepose‰797ø{ÿÿ<<if self  actuator  SendCar2Somewhere_move ( goal ) == TrueS9<9˜wÿÿelse : 8p[]dXP˜;¸p�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿY3334ÿÿÿÿÿÿ  MoveBaseGoal x@^_dˆÀ˜;¸p�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[5554ÿÿÿÿÿÿrospyTimenow @[d0™;¸pÿÿÿÿÿÿÿÿ�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ (PZd ™;¸p�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ¸ÀVüŞx ¸EXv  �^?ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ¥Uª‰ï|Û?Q=== ÿÿÿÿÿÿselfQ?? ?Øxÿÿgoalm@@)@ÿÿ  goaltarget_poseheaderframe_idjAA&A¸kÿÿgoaltarget_poseheaderstampbBBBÿÿgoaltarget_posepose‰CJCxyÿÿ<<if self  actuator  SendCar2Somewhere_move ( goal ) == True[E EE ˜|ÿÿWatcher_status`F F F ÿÿWatcher_statusnameb G G"G ÿÿWatcher_statusstatusS JMJ8}ÿÿelse : 8 €Z]dØš;8x �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿY???4ÿÿÿÿÿÿ  MoveBaseGoal (Ğ[_dÈğš;8x �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[AAA4ÿÿÿÿÿÿrospyTimenow èp^d8`›;8x �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ HàZ_dÈ€š;8x �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[E E E 4ÿÿÿÿÿÿEveryoneStatus ¨€]dØà+98x �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ( `\lŸ ˜d°|  �^?ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ¶Ys¦?ÔUPkPx~ÿÿÿÿÿÿ__init__YSSS˜mÿÿ  location_subYYYY‰ÿÿ  location_pub\___ÿÿmaster_location]aaa¸‰ÿÿmove_base_clientglol؇ÿÿSendCar2Somewhere_shutdowncp~p¸ÿÿSendCar2Somewhere_movek‚xƒÿÿSendCar2Somewhere_deallocationS OOOÿÿobject ø°Z°¸¨7øl �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQPPP ÿÿÿÿÿÿselfWhhhxˆÿÿ  add_thread ˜�\adˆP,9x~�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]hhh4ÿÿÿÿÿÿthreadingThread è[ad.9øl �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]SSS4ÿÿÿÿÿÿrospySubscriber ø\`dX€.9øl �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\YYY4ÿÿÿÿÿÿrospyPublisher h [m£ ¨?9øl �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿiaaa4ÿÿÿÿÿÿactionlibSimpleActionClient H À\UdX  -9øl �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQl#l'l# ÿÿÿÿÿÿself h ğ\(»x àã!øl �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ{ªUÒQpp#p ÿÿÿÿÿÿselfQp%p)p% ÿÿgoalarrrø€ÿÿfinished_within_timehsvs8‡ÿÿif not finished_within_timeSv~vÿÿelse :Rw ww ˜�ÿÿstate ˆ ^v±˜?¸�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿrrrr4ÿÿÿÿÿÿ%%selfmove_base_clientwait_for_result ¨Yd¨ ğ.9¸�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ È 0YÊ/x  8¸�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿsox {x X€ÿÿÿÿÿÿ""if state == GoalStatus  SUCCEEDEDS{ ~{ 8‚ÿÿelse : ¸ °]dØ �19�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 8 0_dh 29�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ H  ]p¨è ¸‰>¸�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿlw w w 4ÿÿÿÿÿÿselfmove_base_clientget_state ˜ �_œ H-øl �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ©UQ'+' ÿÿÿÿÿÿselfP-0- ÿÿmsgf€‚€Ø‚ÿÿif msg  name == "Master" È _dø ü"xƒ�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  PTVdˆ °ú"°|  �^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR…Š…„ÿÿÿÿÿÿtry : Ø `_&¹ x£>X…�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\´X†††ø…ÿÿÿÿÿÿ  Watcher_CarT‡‡‡¸„ÿÿmachinenˆŠˆ˜†ÿÿ!!while not rospy  is_shutdown ( ) ( À_bd( �û"„�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^†††4ÿÿÿÿÿÿSendCar2Somewhere 8 Tcd  û"„�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ_‡‡‡4ÿÿÿÿÿÿSimpleStateMachine X 0TdH Àö"„ÿÿÿÿÿÿÿÿ�^?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$��ˆÀÀ"Xpó>(è ğó„�…ŠO‚ Pk‚p~v~{~x{svloM $*+0=MJMCJ1<9<# 
20,394
Python
.py
98
207.112245
1,020
0.17239
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,382
send_goals_scripts_send_goals_node_python.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/send_goals_scripts_send_goals_node_python.py.sisc
0T)%ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ  pÎ[š˜ğÒ#ÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWJJkÿÿÿÿÿÿ  send_goals 8#ğÌXdH# ™;˜|øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTJJø{ÿÿÿÿÿÿ scripts ø"�Ìgš¸"ˆ×#køg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿcJJ¸uÿÿÿÿsend_goals_node_python È `Ì<;Øğóø{øg?ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ{Òe(U«ÂQ68nÿÿÿÿÿÿPoseR$$$6XqÿÿPointW+++6øqÿÿ  Quaternion[   68sÿÿMoveBaseActionY / / /6¸kÿÿ  MoveBaseGoalb   6Xvÿÿquaternion_from_eulerO   6ØxÿÿpiS F9 8xÿÿclientf HJHX{ÿÿif __name__ == "__main__" 8 PÍgš8!øĞ#¸u øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿc7ÿÿÿÿÿÿgeometry_msgsmsgPose H Ëhœˆ àÖ#¸u øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿd$$$7ÿÿÿÿÿÿgeometry_msgsmsgPoint è Ëm£!(m>¸u øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿi+++7ÿÿÿÿÿÿgeometry_msgsmsgQuaternion Ø ÀÌr«¨X"¸u øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿn   7ÿÿÿÿÿÿ!!move_base_msgsmsgMoveBaseAction ˜  Îp¨( ¨?9¸u øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿl / / /7ÿÿÿÿÿÿmove_base_msgsmsgMoveBaseGoal øàÊyµø pU¸u øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿu   7ÿÿÿÿÿÿ((tftransformationsquaternion_from_euler X ÀÉXd¨ ğ“;¸u øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT   7ÿÿÿÿÿÿmathpi¸ »Eö´è ˜z!¸u øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿIxoŞ3¤İƒ1¶Ù ZVx~ÿÿÿÿÿÿ  move_baseXzÿÿ  test_numberXØsÿÿ  quaternionsYÿÿ  euler_anglesf#'#˜rÿÿfor angle in euler_anglesT$$$˜mÿÿq_angleN%% %uÿÿqW(((øvÿÿ  point_testQ 22 2xyÿÿgoalm 33%3ÿÿ  goaltarget_poseheaderframe_idj 44"48}ÿÿgoaltarget_poseheaderstampb 555ÿÿgoaltarget_poseposea <<<xoÿÿfinished_within_timeh=@=Xlÿÿif not finished_within_timeS@F@xtÿÿelse :RAAAølÿÿstate (!@Ëm£h!HçÙ8x øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿi4ÿÿÿÿÿÿactionlibSimpleActionClient x!@ÎTd¸À‘;8xøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿP4ÿÿÿÿÿÿint  ĞÎUd˜!`”;8x øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQ4ÿÿÿÿÿÿlist # ÊVdx#Ğ”;8xøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿR## #ÿÿÿÿÿÿangle ("€Êf™¨"XÎ#8x øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿb$$$4ÿÿÿÿÿÿquaternion_from_euler h#0É[dØ" –;8x øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿW%%%4ÿÿÿÿÿÿ  Quaternion è!pËUd¨!�–;8x øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQ(((4ÿÿÿÿÿÿlist È"ğÉ]dˆ!—;8x øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿY2224ÿÿÿÿÿÿ  MoveBaseGoal ¸!€Í_d8"p—;8x øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[4444ÿÿÿÿÿÿrospyTimenow È!ĞËjŸ#HÒ#8x øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿf<<<4ÿÿÿÿÿÿmove_basewait_for_result ˆ"Ìd"à—;8xøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ X"ÎÊ/X#h88xøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿsoBDB˜wÿÿÿÿÿÿ""if state == GoalStatus  SUCCEEDEDSDFD¸zÿÿelse : h"`ÉdØ!Œ;xtÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ x"°ÊdH"P˜;xtÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ˜" Ídd"À˜;8xøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ`AAA4ÿÿÿÿÿÿmove_baseget_state è"0Ìd(#0™;¸u ÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$JJX!Ğ%8!@ğ>ø!pó> F@F#'=@
10,005
Python
.py
47
211.893617
1,028
0.177528
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,383
board_reminder_scripts_reminder_basic.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/board_reminder_scripts_reminder_basic.py.sisc
0T)-1ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ àÊ_d8ğ“;ÿÿÿÿÿÿÿÿPi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[qqğê ÿÿÿÿÿÿboard_reminder x@ÑXd8 -9°|Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTqqĞç ÿÿÿÿÿÿscripts (@Ô_d˜P,9ğê Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[qqP}ÿÿÿÿreminder_basic °Ê#´¸p�EĞç Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿY¹U F;  pü ÿÿÿÿÿÿReminder\Hk#H pò ÿÿAutoReloadTimerfmqm0ç ÿÿif __name__ == "__main__" Ø@¸Egšˆ˜z!P}Pi?ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿèY-¹N‹×¶uU �ú ÿÿÿÿÿÿ__init__\ÿÿdefaultInterval`!ı ÿÿdefaultTimerUpdaterTÿÿrunning^ø ÿÿtimerUpdateThreadR Ğû ÿÿstartZ!'!°ø ÿÿ  DefaultRemindY(5 (0û ÿÿ  ReminderMainb 6<6ğş ÿÿCreateNewDefaultTimerd =C=�ÿ ÿÿFullBoardUpdateReminderV DFDp÷ ÿÿ  TerminateS    ÿÿobject XËµÈ Ğ7pü  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQ ÿÿÿÿÿÿself\& ÿÿdefaultInterval H`Ì`d¨ –;pü  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\4ÿÿÿÿÿÿthreadingTimer ˆ àÍadè`”;pü  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]4ÿÿÿÿÿÿthreadingThread PÊUd(Ğ”;pü  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQ ÿÿÿÿÿÿself 8ÀÉ ø À7pü  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ±UQ!!! ÿÿÿÿÿÿselfX#%#Pù ÿÿ  if DEBUGINGS%'%ğù ÿÿelse : x�Ìd¸ �–;°ø ÿÿÿÿÿÿÿÿPi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ¨ ÎdØ —;°ø ÿÿÿÿÿÿÿÿPi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ (ÀÌºè ¨aEpü  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQ((( ÿÿÿÿÿÿselfa*5 *°ı ÿÿwhile self  running 0ÌÔ>X¸b0û Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ}y, ., 0ö ÿÿÿÿÿÿ,,if self  defaultTimerUpdater  is_alive ( )S. 4. Pş ÿÿelse : H ËdÈ0™;°ı ÿÿÿÿÿÿÿÿPi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ğÌd˜Œ;°ı Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ (ĞΫ¨z?pü  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQ66"6 ÿÿÿÿÿÿselfR888Ğö ÿÿtimer @Ë`d8p—;ğş Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\8884ÿÿÿÿÿÿthreadingTimer ( Í HH7pü   Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ±UQ= =$= ÿÿÿÿÿÿselfX?A?0!ÿÿ  if DEBUGINGSACA�õ ÿÿelse : hpËd8à—;�ÿ ÿÿÿÿÿÿÿÿPi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ HpÎdXP˜;�ÿ ÿÿÿÿÿÿÿÿPi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ˜0ÉUdxÀ˜;pü  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQDDD ÿÿÿÿÿÿself Xø¹EäÖh JAP}Pi?ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿ j²Y�ÅxĞ(UIR I°é ÿÿÿÿÿÿ__init__UJJJÿÿintervalUKKKÿÿfunction[LLLÿÿargsToFunctionWMMMÿÿ  autoReloadTNNNÿÿrunningWOOO�ë ÿÿ  __argsLockTPPP°ó ÿÿ__timerT SbS°î ÿÿTimesUpa ckcĞñ ÿÿUpdateArgsToFunctionS HHH ÿÿobject ˆĞËÁ¡¸P¢>pò  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿf®UQIII ÿÿÿÿÿÿselfUIII ÿÿintervalUI!I)I! ÿÿfunction[I+I9I+ ÿÿargsToFunctionWI@IJI@ ÿÿ  autoReload ¨�É_d¨ ™;pò  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[OOO4ÿÿÿÿÿÿthreadingLock xPÍ`dØÀ‘;pò  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\PPP4ÿÿÿÿÿÿthreadingTimer ˆ Î«ØÀÀ"pò  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ·UQSSS ÿÿÿÿÿÿself^Ub Uä ÿÿif self  runningbXX&XPô ÿÿfunctionHandlerThread ¸ğÉÌ2È(`°î Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿgcV \V ó ÿÿÿÿÿÿwith self  __argsLocka\ b\ Pê ÿÿif self  autoReload è@Îdèš;ä Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ €Êdh`›;ä Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ø Êadøğš;°î Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]XXX4ÿÿÿÿÿÿthreadingThread ÌÜÊx@ª"pò  Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ…U­Qcc!c ÿÿÿÿÿÿselfTc#c*c# ÿÿnewArgscdfd0â ÿÿwith self  __argsLockmfhf�á ÿÿ  if self  __timer  is_alive ( )Shkhğô ÿÿelse : ¸€Íd˜�19Ğñ Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ è°Ídˆ29Ğñ ÿÿÿÿÿÿÿÿPi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ È€Ód8€.9Ğñ Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ¸`ÉYdXà+9P}Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUnn né ÿÿÿÿÿÿreminder h°ĞYd(ğ.90ç Pi?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUnnn4ÿÿÿÿÿÿReminder$qqø`É#hpó>X@ğ>Hk IRSbUb\bV\ckhkmq F 6<!'=C(5*5.4 DF
13,557
Python
.py
52
259.730769
1,211
0.168073
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,384
deliver_scheduler_scripts_examples_RestartWithIntervalTest.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_examples_RestartWithIntervalTest.py.sisc
0T)ÃÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ ø`Ìbœ¸,!ÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^0ì ÿÿÿÿÿÿdeliver_scheduler øÀÌXdÀ‘;°|øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTPô ÿÿÿÿÿÿscripts ØËYd8à—;0ì øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUPï ÿÿÿÿÿÿexamples HÀÉhœ(Ð(!Pô øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿdP}ÿÿÿÿRestartWithIntervalTest �̬¨è 7Pï øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVR ä ÿÿÿÿÿÿSayHiR  pã ÿÿtimer (€ÊdXД;P}øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Ø Ë`dè0™;P}øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\ 4ÿÿÿÿÿÿReloadableTimer$˜ÉEÈ@ð>Hè>
2,463
Python
.py
10
245.4
536
0.137734
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,385
deliver_scheduler_scripts_examples_ReloadableTimerTests.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_examples_ReloadableTimerTests.py.sisc
0T)¯ ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ  Ìb—è P}ÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^pí ÿÿÿÿÿÿdeliver_scheduler H  ËXdX p—;°|øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTÐç ÿÿÿÿÿÿscripts XàÍYdX`”;pí øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUÐì ÿÿÿÿÿÿexamples ( °Êe—8 Pê Ðç øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿa°é ÿÿÿÿReloadableTimerTests ˜ Î"³¨ ˆ…EÐì øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¸^Z 0ì ÿÿÿÿÿÿ  timeCostlyFunVðå ÿÿ  MakePrintf �ë ÿÿif __name__ == "__main__"  �Ìd˜ ð“;°é øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  0Ìd¸ À‘;°é øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ˆ À̱ ( x7°é øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿVR �ð ÿÿÿÿÿÿtimerWÐñ ÿÿ  while True 8 `Ì`d¨ Œ;�ë øg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\4ÿÿÿÿÿÿReloadableTimer H €Ídè À˜;�ë ÿÿÿÿÿÿÿÿøg?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$È øhˆ @ð>X pó>
3,299
Python
.py
15
219
536
0.144597
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,386
board_reminder_scripts_reminder_client.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/board_reminder_scripts_reminder_client.py.sisc
0T)ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ (0Ì_d¨à+9ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ[@@0ç ÿÿÿÿÿÿboard_reminder X°ÊXd¸à—;°|He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT@@pã ÿÿÿÿÿÿscripts ØÌ`dð“;0ç He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\@@P}ÿÿÿÿreminder_client ˜ÎŠOxP¢>pã He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ]Y   6Ðñ ÿÿÿÿÿÿ  NeedToSeeMsga - - -60â ÿÿNeedToSeeMsgResponseZ:* Pê ÿÿ  BoardReminderf<@<Ðì ÿÿif __name__ == "__main__" àÊp¨¨(m>P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿl   7ÿÿÿÿÿÿboard_remindersrvNeedToSeeMsg ¸Ëx´¸°UP}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿt - - -7ÿÿÿÿÿÿ''board_remindersrvNeedToSeeMsgResponse ˆ Î·ÛÈ(\"P}He?ÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿYz½’ù^Ø.U°î ÿÿÿÿÿÿ__init__`!ðå ÿÿboardReminderClientYpí ÿÿ  initialTimer\Ðâ ÿÿcountDownThreadZ % î ÿÿ  DefaultRemindR&)&ó ÿÿstart`*1*Pï ÿÿWaitForInitialTimerc2:2ðê ÿÿNeedToSeeCountDownMaina 33"3ÿÿnextNeedToSeeCounterU ÿÿReminder (ÐΜx˜0Pê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUµQ ÿÿÿÿÿÿself\& ÿÿdefaultIntervalZ/</ ÿÿ  firstInterval è€ÊcdøP,9Pê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ_4ÿÿÿÿÿÿrospyServiceProxy 8ðÌ`d�19Pê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ\4ÿÿÿÿÿÿthreadingTimer °ÍadH29Pê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]4ÿÿÿÿÿÿthreadingThread ˜ ËUdH -9Pê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQ    ÿÿÿÿÿÿself X@ÎUdÈ.9Pê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿQ&&& ÿÿÿÿÿÿself hÐËÎ5Ø iPê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQ** * ÿÿÿÿÿÿselfu,.,°é ÿÿ((while self  initialTimer  is_alive ( ) X@Ëdh€.9Pï ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Èpκ8€`EPê  He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿUQ22#2 ÿÿÿÿÿÿselfa4:40ñ ÿÿwhile self  running x Ít®H�)"ðê He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿp8 :8 0ì ÿÿÿÿÿÿ##if self  nextNeedToSeeCounter <= 0 x`Ìd˜ð.90ñ He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Ø0É^dèÀ‘;P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿZ===ðï ÿÿÿÿÿÿ  boardReminder HàÍ^dø –;Ðì He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿZ===4ÿÿÿÿÿÿ  BoardReminder$@@è y?h@ð>ˆpó>: %2:4:&)*1<@
7,469
Python
.py
34
218.705882
949
0.168908
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,387
deliver_scheduler_scripts_examples_multicarTest.py.sisc
cyiyang_miniros/drug-deliverer.si4project/cache/parse/deliver_scheduler_scripts_examples_multicarTest.py.sisc
0T)† ÕµÕµÖµÖµ¥ÜÕ Õµ¥Ä© ÕµT”œ È �ÉbdX `”;ÿÿÿÿÿÿÿÿHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^`£ÿÿÿÿÿÿdeliver_scheduler Ø ÉXdè Д;°|He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿT€µÿÿÿÿÿÿscripts ø PÊYd —;`£He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿU@¥ÿÿÿÿÿÿexamples È  Ê]d8 �–;€µHe?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿYP}ÿÿÿÿ  multicarTest H ̘¨ è3@¥He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿZµV à´ÿÿÿÿÿÿ  schedulerW à¥ÿÿ  car0TargetW `­ÿÿ  car1Target H  ÍZdX  –;P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿV4ÿÿÿÿÿÿ  Scheduler ¸ PÍhœ ˆ%!P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿd4ÿÿÿÿÿÿschedulerGetNextTarget ˜ ÀÌhœ¨ 0!P}He?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿd4ÿÿÿÿÿÿschedulerGetNextTarget$8 ð“; Hè>( @ð>
2,934
Python
.py
15
194.666667
518
0.141096
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,388
actuator_points.py
cyiyang_miniros/actuator/scripts/actuator_points.py
#! /usr/bin/env python # -*- coding: utf-8 -*- from geometry_msgs.msg import Point, Pose, Quaternion from tf.transformations import quaternion_from_euler from math import pi quaternions = list() euler_angles = ( pi / 2, pi / 2, pi / 2, 0, -pi / 2, -pi / 2, -pi / 2, -pi / 2, 0, pi, pi / 2, -pi / 2, ) # 将上面的Euler angles转换成Quaternion的格式 for angle in euler_angles: q_angle = quaternion_from_euler(0, 0, angle, axes="sxyz") q = Quaternion(*q_angle) quaternions.append(q) point_ABC_master = [ Pose(Point(0.42, 2.30, 0), quaternions[0]), Pose(Point(1.30, 2.75, 0), quaternions[1]), Pose(Point(1.28, 1.78, 0), quaternions[2]), ] # 3 point_1234_master = [ Pose(Point(0, 0, 0), quaternions[3]), # 无意义 Pose(Point(-1.84, 2.26, 0), quaternions[4]), #1号 Pose(Point(-1.06, 1.78, 0), quaternions[5]), #2号 Pose(Point(-1.85, 1.30, 0), quaternions[6]), #3号 Pose(Point(-1.06, 0.80, 0), quaternions[7]), #4号 ] # D point_special_master = [ Pose(Point(0, 0, 0), quaternions[8]), # 起点 Pose(Point(-0.4, 3.7, 0), quaternions[9]), # 手写数字 Pose(Point(0.885, 2.54, 0), quaternions[10]), # 运动1点 Pose(Point(-1.44, 2.035, 0), quaternions[11]), ] # 运动2点 point_ABC_slave = [ Pose(Point(2.2,2.30,0), quaternions[0]), Pose(Point(3.08,2.75,0), quaternions[1]), Pose(Point(3.06,1.78,0), quaternions[2]), ] # 3 point_1234_slave = [ Pose(Point(0, 0, 0), quaternions[3]), # 无意义 Pose(Point(-0.06, 2.26, 0), quaternions[4]), Pose(Point(0.79, 1.78, 0), quaternions[5]), Pose(Point(-0.06, 1.30, 0), quaternions[6]), Pose(Point(0.79, 0.80, 0), quaternions[7]), ] # D point_special_slave = [ Pose(Point(0, 0, 0), quaternions[8]), # 起点 Pose(Point(1.38, 3.7, 0), quaternions[9]), # 手写数字 Pose(Point(2.616, 1.0, 0), quaternions[10]), #运动1点 Pose(Point(0.35, 2.9, 0), quaternions[11]), #运动2点 ] # 运动2点 point_special_watcher = [ Pose(Point(1.4, 2.3, 0), quaternions[10]), Pose(Point(-0.75, 3.92, 0), quaternions[9]), ] # 运动2点
2,176
Python
.py
65
28.292308
61
0.594608
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,389
permission_client.py
cyiyang_miniros/actuator/scripts/permission_client.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # 虚假的cv节点,模仿识别数字板的行为 import rospy from actuator.srv import PermissionMsg, PermissionMsgRequest, PermissionMsgResponse if __name__ == "__main__": rospy.init_node("CVnode") client = rospy.ServiceProxy("permission", PermissionMsg) client.wait_for_service() req = PermissionMsgRequest() rate5 = rospy.Rate(5) rate30 = rospy.Rate(30) permission_dic = {"Yes": 1, "No": 0} while not rospy.is_shutdown(): resp = client.call(0) rospy.loginfo("想看") if resp.permission == 0: rate5.sleep() rospy.loginfo("CV不可看") else: resp = client.call(1) rospy.loginfo("CV看完了") rate30.sleep()
793
Python
.py
23
25.695652
83
0.616783
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,390
actuator_master.py
cyiyang_miniros/actuator/scripts/actuator_master.py
#! /usr/bin/env python # -*- coding: utf-8 -*- import threading from actuator_points import point_ABC_master, point_1234_master, point_special_master import actionlib import rospy from actionlib_msgs.msg import GoalStatus from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from playsound import playsound from statemachine import State, StateMachine from actuator.srv import ( DestinationMsg, DestinationMsgRequest, PermissionMsg, PermissionMsgResponse, ) from actuator.msg import EveryoneStatus def thread_CV(): rospy.spin() class SimpleStateMachine(StateMachine): def __init__(self, actuator): self.actuator = actuator super(SimpleStateMachine, self).__init__() Start = State("Start", initial=True) Dispense_ABC = State("Dispense_ABC") HandWritten = State("HandWritten") Pickup_1234 = State("Pickup_1234") Zero = State("Zero") Wander1 = State("Wander1") Wander2 = State("Wander2") Rubbish = State("Rubbish") # Go是一个事件Event,这个Event是由几个转移Transitions组成 Go = ( Start.to(Start, cond="ReAskMission") | Start.to(Dispense_ABC, cond="GotTarget") | Start.to(Wander1, cond="StartWander") | Dispense_ABC.to(HandWritten) | HandWritten.to(Rubbish, cond="GetRubbish") | HandWritten.to(Pickup_1234) | Rubbish.to(Zero) | Pickup_1234.to(Zero) | Zero.to(Start) | Wander1.to(Wander2) | Wander2.to(Zero) ) # 以下是条件转移的条件 """ seefinished_flag asksuccess_flag 意义 True or False 0 0 得到识别请求,请求失败,重新请求 0 1 得到识别请求,请求成功,出现小哥堆积情况,继续配送 1 0 识别结束,请求失败,本轮小哥处理完,进入wander 1 1 识别结束,请求成功,常规情况,继续配送 """ def GotTarget(self): if self.actuator.asksuccess_flag: while not self.actuator.seefinished_flag: rospy.loginfo("虽然请求成功,但要识别,阻塞中") return True else: return False def StartWander(self): if ( self.actuator.seefinished_flag == True and self.actuator.asksuccess_flag == False and self.actuator.gamestart_flag == True ): rospy.logwarn("进入wander状态") return True else: return False def ReAskMission(self): if not (self.GotTarget() or self.StartWander()): rospy.sleep(1) return True else: return False def GetRubbish(self): if self.actuator.mission_response.deliver_destination == 5: rospy.logwarn("丢弃") return True else: return False def before_transition(self, state): Master_status = EveryoneStatus() Master_status.name = "Master" Master_status.status = state.id self.actuator.location_pub.publish(Master_status) def on_enter_Start(self): self.actuator.allow2see_flag = True # rospy.sleep(1) while not self.actuator.seefinished_flag: # 标志位为False时,代表收到了新请求。 if not self.actuator.logwarn_protect: # False为不保护,第一次log self.actuator.logwarn_protect = True rospy.logwarn("接收到识别器请求,请原地等待") # 睡眠0.5s等待需求更新 rospy.sleep(0.5) self.actuator.actuator_ask_newtarget() self.actuator.logwarn_protect = False def on_exit_Start(self): self.actuator.allow2see_flag = False def on_enter_Dispense_ABC(self): """ 需要完成的工作: 1.向Move_Base发布关于ABC的点 2.判断是否到达 3.如果到达请上报服务器 4.如果没有到达,请阻塞在这里 5.如果失败,请取消目标点 """ rospy.loginfo("前往配药区") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_ABC_master[ self.actuator.mission_response.drug_location ] if self.actuator.actuator_move(goal) == True: newABC = self.actuator.responseToABC[ self.actuator.mission_response.drug_location ] rospy.logwarn("到达配药区%c", newABC) self.actuator.actuator_updateABC() else: rospy.logerr("配药失败") self.actuator.move_base_client.cancel_goal() # 所有都有可能要改成exit,或者调整广播 def on_enter_HandWritten(self): rospy.loginfo("前往手写数字识别区") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_master[1] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达手写数字点") else: rospy.logerr("手写数字点失败") self.actuator.move_base_client.cancel_goal() def on_enter_Pickup_1234(self): rospy.loginfo("前往取药区") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_1234_master[ self.actuator.mission_response.deliver_destination ] if self.actuator.actuator_move(goal) == True: rospy.logwarn("到达取药区%d", self.actuator.mission_response.deliver_destination) self.actuator.actuator_update1234() else: rospy.logerr("取药失败") self.actuator.move_base_client.cancel_goal() # 取消当前目标导航点 def on_enter_Rubbish(self): rospy.logwarn("前往垃圾桶") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_master[3] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达垃圾桶") self.actuator.actuator_throwRubbish() else: rospy.logerr("丢垃圾失败!") self.actuator.move_base_client.cancel_goal() # 取消当前目标导航点 def on_enter_Zero(self): rospy.loginfo("前往起点") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_master[0] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达起点") else: rospy.logerr("前往起点失败") self.actuator.move_base_client.cancel_goal() # 取消当前目标导航点 def on_enter_Wander1(self): rospy.loginfo("前往运动点(配药区)") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_master[2] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达运动点(配药区)") else: rospy.logerr("前往1号运动点失败") self.actuator.move_base_client.cancel_goal() # 取消当前目标导航点 def on_enter_Wander2(self): rospy.loginfo("前往运动点(取药区)") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_master[3] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达运动点(配药区)") else: rospy.logerr("前往2号运动点失败") self.actuator.move_base_client.cancel_goal() # 取消当前目标导航点 class CarActuator(object): def __init__(self): rospy.init_node("act_master") self.location_pub = rospy.Publisher("/location", EveryoneStatus, queue_size=10) self.asksuccess_flag = False # 请求成功标志位 self.seefinished_flag = False # 识别结束标志位 self.allow2see_flag = True # 允许识别标志位,物理上的 self.gamestart_flag = False # 游戏开始 self.logwarn_protect = False rospy.on_shutdown(self.actuator_shutdown) self.permission_server = rospy.Service( "permission", PermissionMsg, self.actuator_dealCV_ask ) rospy.loginfo("命令服务器正常启动") # 订阅move_base服务器的消息 self.move_base_client = actionlib.SimpleActionClient( "move_base", MoveBaseAction ) rospy.loginfo("等待连接move_base服务器") self.move_base_client.wait_for_server() rospy.loginfo("连上move_base 服务器了") self.mission_client = rospy.ServiceProxy("/mission", DestinationMsg) rospy.loginfo("调度器客户端正常启动了") self.mission_client.wait_for_service() rospy.loginfo("连上调度器服务器了") self.mission_request = DestinationMsgRequest() # 定义请求 self.responseToABC = {-1: "E", 0: "A", 1: "B", 2: "C"} add_thread = threading.Thread(target=thread_CV) add_thread.start() rospy.loginfo("deal CV thread OK") # 程序退出执行 def actuator_shutdown(self): rospy.logerr("Stop the robot") self.move_base_client.cancel_goal() # 取消当前目标导航点 # 向服务器请求新任务,到达起点(标准数字区) def actuator_ask_newtarget(self): self.mission_request.request_type = 1 # 请求包编号为“请求新任务” self.mission_response = self.mission_client.call( 0, self.mission_request.request_type, 0, 0 ) rospy.loginfo("代号:%d,请求新任务", 0) rospy.logerr( "Get:%c,Send:%d", self.responseToABC[self.mission_response.drug_location], self.mission_response.deliver_destination, ) if ( self.mission_response.drug_location != -1 and self.mission_response.deliver_destination != -1 ): # 不是负-1代表请求成功 self.asksuccess_flag = True # 请求成功 self.gamestart_flag = True # 开始游戏 else: # 请求失败 self.asksuccess_flag = False # 向服务器上报已取药 def actuator_updateABC(self): playsound("/home/EPRobot/Music/dispense.mp3") self.mission_request.request_type = 2 # 请求包编号为“完成配药/ABC” self.mission_client.call(0, self.mission_request.request_type, 0, 0) # 向服务器上报已送药 def actuator_update1234(self): playsound("/home/EPRobot/Music/pick_up.mp3") self.mission_request.request_type = 3 # 请求包编号为“完成送药/1234” self.mission_client.call(0, self.mission_request.request_type, 0, 0) def actuator_throwRubbish(self): # playsound("/home/EPRobot/Music/throwRubbish.mp3") self.mission_request.request_type = 3 # 请求包编号为“完成送药/1234” self.mission_client.call(0, self.mission_request.request_type, 0, 0) # 处理来自识别器的请求 def actuator_dealCV_ask(self, req): if req.request == 0: # "想看请求" rospy.loginfo("接受:[想看]") self.seefinished_flag = False # 未看完=想看=接受到想看请求=有新一轮 if self.allow2see_flag: # 已经到达识别区,允许识别 self.allow2see_flag = False resp = PermissionMsgResponse(1) # 可以看 rospy.loginfo("回复:[可以]") else: resp = PermissionMsgResponse(0) # 不可以 rospy.loginfo("回复:[拒绝]") else: # "看完了" rospy.loginfo("接受:[看完]") resp = PermissionMsgResponse(0) self.seefinished_flag = True # 识别结束=不需要识别 return resp def actuator_move(self, goal): self.move_base_client.send_goal(goal) finished_within_time = self.move_base_client.wait_for_result(rospy.Duration(15)) if not finished_within_time: self.move_base_client.cancel_goal() rospy.logerr("move_base超时") else: state = self.move_base_client.get_state() if state == GoalStatus.SUCCEEDED: rospy.loginfo("成功到达") return True else: rospy.logerr("没超时但失败") return False if __name__ == "__main__": try: Master_Car = CarActuator() machine = SimpleStateMachine(Master_Car) while not rospy.is_shutdown(): machine.Go() except rospy.ROSInterruptException: rospy.logerr("程序意外退出") pass
13,518
Python
.py
303
30.290429
90
0.605776
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,391
mission_server.py
cyiyang_miniros/actuator/scripts/mission_server.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # 制作虚假的服务器,进行调试 # 模仿scheduler的节点 import rospy from actuator.srv import DestinationMsg, DestinationMsgResponse import random def doPrint(request): response = DestinationMsgResponse() rospy.loginfo( "车辆编号:%d,请求类型:%s", request.car_no, requestType_dic[request.request_type] ) if request.request_type == 1: response.drug_location = random.randint(0, 2) # 返回0-2的随机数,代表ABC response.deliver_destination = random.randint(1, 5) # 返回0-3的随机数,代表1-4送药点 temp = response.deliver_destination rospy.loginfo("配药位置:%c,送药位置为:%d", responseToABC[response.drug_location], temp) else: response.drug_location = -1 response.deliver_destination = -1 return response if __name__ == "__main__": requestType_dic = {1: "GetNextTarget", 2: "DrugLoaded", 3: "Delivered"} responseToABC = {0: "A", 1: "B", 2: "C"} rospy.init_node("scheduler") # 服务器节点起名为scheduler server = rospy.Service("/mission", DestinationMsg, doPrint) # 话题名为mission rospy.loginfo("服务器启动") rospy.spin() pass
1,255
Python
.py
29
33.241379
86
0.680037
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,392
actuator_slave.py
cyiyang_miniros/actuator/scripts/actuator_slave.py
#! /usr/bin/env python # -*- coding: utf-8 -*- import threading from actuator_points import point_ABC_slave, point_1234_slave, point_special_slave import actionlib import rospy from actionlib_msgs.msg import GoalStatus from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from playsound import playsound from statemachine import State, StateMachine from actuator.srv import ( DestinationMsg, DestinationMsgRequest, ) from actuator.msg import EveryoneStatus def thread_Master(): rospy.spin() class SimpleStateMachine(StateMachine): def __init__(self, actuator): self.actuator = actuator super(SimpleStateMachine, self).__init__() Start = State("Start", initial=True) Dispense_ABC = State("Dispense_ABC") HandWritten = State("HandWritten") Pickup_1234 = State("Pickup_1234") Zero = State("Zero") Wander1 = State("Wander1") Wander2 = State("Wander2") Rubbish = State("Rubbish") # Go是一个事件Event,这个Event是由几个转移Transitions组成 Go = ( Start.to(Dispense_ABC, cond="GotTarget") | Start.to(Start, cond="ReAskMission") | Start.to(Wander1, cond="StartWander") | Dispense_ABC.to(HandWritten) | HandWritten.to(Rubbish,cond="GetRubbish") | HandWritten.to(Pickup_1234) | Rubbish.to(Zero) | Pickup_1234.to(Zero) | Zero.to(Start) | Wander1.to(Wander2) | Wander2.to(Zero) ) def on_transition(self,state): Slave_status = EveryoneStatus() Slave_status.name = 'Slave' Slave_status.status = state.id self.actuator.location_pub.publish(Slave_status) rospy.logwarn("请求从[%s]转移",state.id) if state.id == 'Start': #在Start时进入转移,代表条件已经允许,可以直接pass pass else: while self.actuator.master_location == state.id : rospy.logwarn("主从状态一致,请等待") def GotTarget(self): if (self.actuator.asksuccess_flag): if self.actuator.watcher_location =='Harbour' and (self.actuator.master_location == 'Dispense_ABC' or self.actuator.master_location == 'Wander1'): rospy.logwarn("从车出发") return True else: return False else: return False def StartWander(self): if self.actuator.master_location == 'Wander1' and self.actuator.asksuccess_flag == False : rospy.logwarn("进入wander状态") return True else: return False def ReAskMission(self): if self.actuator.master_location == 'Start' or (not self.GotTarget() and not self.StartWander()): #主车在Start,从车只能reask return True else: return False def GetRubbish(self): if (self.actuator.mission_response.deliver_destination==5): rospy.logwarn("丢弃") return True else: return False def on_enter_Start(self): self.actuator.actuator_ask_newtarget() rospy.sleep(1) def on_enter_Dispense_ABC(self): # while self.actuator.master_location == 'Wander1' : # rospy.logwarn("转移保护失效,阻塞") rospy.loginfo("前往配药区") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "slave/map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_ABC_slave[ self.actuator.mission_response.drug_location ] if self.actuator.actuator_move(goal) == True: newABC = self.actuator.responseToABC[ self.actuator.mission_response.drug_location ] rospy.loginfo("到达配药区%c", newABC) self.actuator.actuator_updateABC() else: rospy.logerr("配药失败") self.actuator.move_base_client.cancel_goal() def on_enter_HandWritten(self): rospy.loginfo("前往手写数字识别区") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "slave/map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_slave[1] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达手写数字点") else: rospy.logerr("手写数字点失败") self.actuator.move_base_client.cancel_goal() def on_enter_Pickup_1234(self): # while self.actuator.master_location == 'Wander2' : # rospy.logwarn("转移保护失效,阻塞") rospy.loginfo("前往取药区") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "slave/map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_1234_slave[ self.actuator.mission_response.deliver_destination ] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达取药区%d", self.actuator.mission_response.deliver_destination) self.actuator.actuator_update1234() else: rospy.logerr("取药失败") self.actuator.move_base_client.cancel_goal() # 取消当前目标导航点 def on_enter_Rubbish(self): rospy.logwarn("前往垃圾桶") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "slave/map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_slave[3] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达垃圾桶") self.actuator.actuator_throwRubbish() else: rospy.logerr("丢垃圾失败!") self.actuator.move_base_client.cancel_goal() # 取消当前目标导航点 def on_enter_Zero(self): rospy.loginfo("前往起点") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "slave/map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_slave[0] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达起点") else: rospy.logerr("前往起点失败") self.actuator.move_base_client.cancel_goal() # 取消当前目标导航点 def on_enter_Wander1(self): rospy.loginfo("前往运动点(配药区)") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "slave/map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_slave[2] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达运动点(配药区)") else: rospy.logerr("前往1号运动点失败") self.actuator.move_base_client.cancel_goal() # 取消当前目标导航点 def on_enter_Wander2(self): rospy.loginfo("前往手写数字识别区") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "slave/map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_slave[1] if self.actuator.actuator_move(goal) == True: rospy.loginfo("到达手写数字点") else: rospy.logerr("手写数字点失败") self.actuator.move_base_client.cancel_goal() rospy.loginfo("前往运动点(取药区)") goal2 = MoveBaseGoal() goal2.target_pose.header.frame_id = "slave/map" goal2.target_pose.header.stamp = rospy.Time.now() goal2.target_pose.pose = point_special_slave[3] if self.actuator.actuator_move(goal2) == True: rospy.loginfo("到达运动点(配药区)") else: rospy.logerr("前往2号运动点失败") self.actuator.move_base_client.cancel_goal() # 取消当前目标导航点 class CarActuator(object): def __init__(self): rospy.init_node("act_slave") self.location_sub = rospy.Subscriber("/location",EveryoneStatus,self.actuator_deallocation,queue_size=10) self.location_pub = rospy.Publisher("/location",EveryoneStatus,queue_size=10) self.asksuccess_flag = False # 请求成功标志位 self.master_location = 'Start' #主车一开始默认为Start self.watcher_location = 'Start' #主车一开始默认为Start rospy.on_shutdown(self.actuator_shutdown) # 订阅move_base服务器的消息 self.move_base_client = actionlib.SimpleActionClient( "move_base", MoveBaseAction ) rospy.loginfo("等待连接move_base服务器") self.move_base_client.wait_for_server() rospy.logwarn("连上move_base 服务器了") self.mission_client = rospy.ServiceProxy("/mission", DestinationMsg) rospy.loginfo("调度器客户端正常启动了") self.mission_client.wait_for_service() rospy.loginfo("连上调度器服务器了") self.mission_request = DestinationMsgRequest() # 定义请求 self.responseToABC = {-1: "E", 0: "A", 1: "B", 2: "C"} add_thread = threading.Thread(target=thread_Master) add_thread.start() rospy.loginfo("deal Master thread OK") # 程序退出执行 def actuator_shutdown(self): rospy.logerr("Stop the robot") self.move_base_client.cancel_goal() # 取消当前目标导航点 # 向服务器请求新任务,到达起点 def actuator_ask_newtarget(self): self.mission_request.request_type = 1 # 请求包编号为“请求新任务” self.mission_response = self.mission_client.call( 1, self.mission_request.request_type, 0, 0 ) rospy.loginfo("代号:%d,请求新任务",1) rospy.loginfo( "Get:%c,Send:%d", self.responseToABC[self.mission_response.drug_location], self.mission_response.deliver_destination, ) if ( self.mission_response.drug_location != -1 and self.mission_response.deliver_destination != -1 ): # 不是负-1代表请求成功 self.asksuccess_flag = True # 请求成功 else: # 请求失败 self.asksuccess_flag = False # 向服务器上报已取药 def actuator_updateABC(self): playsound("/home/slave/Music/dispense.mp3") self.mission_request.request_type = 2 # 请求包编号为“完成配药/ABC” self.mission_client.call(1, self.mission_request.request_type, 0, 0) # 向服务器上报已送药 def actuator_update1234(self): playsound("/home/slave/Music/pick_up.mp3") self.mission_request.request_type = 3 # 请求包编号为“完成送药/1234” self.mission_client.call(1, self.mission_request.request_type, 0, 0) def actuator_throwRubbish(self): # playsound("/home/slave/Music/throwRubbish.mp3") self.mission_request.request_type = 3 # 请求包编号为“完成送药/1234” self.mission_client.call(1, self.mission_request.request_type, 0, 0) def actuator_move(self, goal): self.move_base_client.send_goal(goal) finished_within_time = self.move_base_client.wait_for_result(rospy.Duration(15)) if not finished_within_time: self.move_base_client.cancel_goal() rospy.logerr("move_base超时") else: state = self.move_base_client.get_state() if state == GoalStatus.SUCCEEDED: rospy.loginfo("成功到达") return True else: rospy.logerr("没超时但失败") return False def actuator_deallocation(self,msg): if msg.name == 'Master': self.master_location=msg.status elif msg.name == 'Watcher' : self.watcher_location=msg.status if __name__ == "__main__": try: Slave_Car = CarActuator() machine = SimpleStateMachine(Slave_Car) while not rospy.is_shutdown(): machine.Go() except rospy.ROSInterruptException: rospy.logerr("程序意外退出") pass
12,277
Python
.py
274
31.974453
158
0.626346
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,393
actuator_watcher.py
cyiyang_miniros/actuator/scripts/actuator_watcher.py
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import threading from actuator_points import point_special_watcher import actionlib import rospy from actionlib_msgs.msg import GoalStatus from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from statemachine import State, StateMachine from actuator.msg import EveryoneStatus def thread_Slave(): rospy.spin() class SimpleStateMachine(StateMachine): def __init__(self, actuator): self.actuator = actuator super(SimpleStateMachine, self).__init__() Start = State("Start", initial=True) Temporary = State("Temporary") Harbour = State("Harbour") # Go是一个事件Event,这个Event是由几个转移Transitions组成 Single_Ticket = ( Start.to(Temporary, cond="AllowedGo") | Temporary.to(Harbour) | Start.to(Start, cond="Wait") ) def Wait(self): rospy.loginfo("Master尚未到达,请等待") rospy.sleep(1) return True def AllowedGo(self): #或者这里可以改成ABC if self.actuator.master_location == "HandWritten": return True else: return False def before_transition(self,state): Watcher_status = EveryoneStatus() Watcher_status.name = 'Watcher' Watcher_status.status = state.id self.actuator.location_pub.publish(Watcher_status) def on_enter_Temporary(self): rospy.loginfo("前往临时停靠点") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "watcher/map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_watcher[0] if self.actuator.SendCar2Somewhere_move(goal) == True: rospy.loginfo("到达临时停靠点") else: rospy.logerr("临时停靠点失败") self.actuator.move_base_client.cancel_goal() def on_enter_Harbour(self): rospy.logwarn("前往识别区") goal = MoveBaseGoal() goal.target_pose.header.frame_id = "watcher/map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_special_watcher[1] if self.actuator.SendCar2Somewhere_move(goal) == True: rospy.logwarn("到达识别区") Watcher_status = EveryoneStatus() Watcher_status.name = 'Watcher' Watcher_status.status = 'Harbour' self.actuator.location_pub.publish(Watcher_status) rospy.signal_shutdown('任务完成,即将退出...') else: rospy.logerr("识别区失败") self.actuator.move_base_client.cancel_goal() class SendCar2Somewhere(object): def __init__(self): rospy.init_node("act_watcher") rospy.on_shutdown(self.SendCar2Somewhere_shutdown) self.location_sub = rospy.Subscriber( "/location", EveryoneStatus, self.SendCar2Somewhere_deallocation, queue_size=10, ) self.location_pub = rospy.Publisher( "/location", EveryoneStatus, queue_size=10, ) self.master_location = "Start" # 从车一开始默认为Start self.move_base_client = actionlib.SimpleActionClient( "move_base", MoveBaseAction ) rospy.loginfo("等待连接move_base服务器") self.move_base_client.wait_for_server() rospy.logwarn("连上move_base 服务器了") add_thread = threading.Thread(target=thread_Slave) add_thread.start() rospy.loginfo("deal Master thread OK") def SendCar2Somewhere_shutdown(self): rospy.logerr("Stop the robot") self.move_base_client.cancel_goal() # 取消当前目标导航点 def SendCar2Somewhere_move(self, goal): self.move_base_client.send_goal(goal) finished_within_time = self.move_base_client.wait_for_result(rospy.Duration(30)) if not finished_within_time: self.move_base_client.cancel_goal() rospy.logerr("move_base超时") else: state = self.move_base_client.get_state() if state == GoalStatus.SUCCEEDED: rospy.loginfo("成功到达") return True else: rospy.logerr("没超时但失败") return False def SendCar2Somewhere_deallocation(self, msg): if msg.name == "Master": self.master_location = msg.status if __name__ == "__main__": try: Watcher_Car = SendCar2Somewhere() machine = SimpleStateMachine(Watcher_Car) while not rospy.is_shutdown(): machine.Single_Ticket() except rospy.ROSInterruptException: rospy.logerr("程序意外退出") pass
4,815
Python
.py
122
28.721311
88
0.632791
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,394
recognizer.py
cyiyang_miniros/char_recognizer/scripts/recognizer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import rospy import glob import cv2 import numpy as np import imutils import cv_bridge import random import sys from sensor_msgs.msg import Image from char_recognizer.srv import ( NeedToSeeMsg, NeedToSeeMsgResponse, DestinationMsg, PermissionMsg, ) class ActualCharRecognizer: def __init__(self, tmpl_path): """ :funciton: recognizerChar实例化 :param tmpl_path: 字母库在系统中的绝对路径, 末尾不含斜杠 """ self.charTmplLib = [] for char in ("A", "B", "C"): path = glob.glob("%s/%s/*.jpg" % (tmpl_path, char)) pathAndChar = list(zip(path, [char] * len(path))) self.charTmplLib.extend(pathAndChar) def vertexFind(self, contours): """ :function: vertexFind寻找顶点(输入近似矩形的轮廓, 返回它的四个顶点, 代替原cv2.approxPolyDP()) :param contours: 轮廓 :return: 四个顶点(list, array(4,1,2)) """ cnt_reshaped = contours.reshape(contours.shape[0], 2) vertexes = [0 for _ in range(4)] sumYX = cnt_reshaped.sum(axis=1) vertexes[0] = cnt_reshaped[sumYX.argmin()] # 上左 vertexes[2] = cnt_reshaped[sumYX.argmax()] # 下右 diffYX = np.diff(cnt_reshaped, axis=1) vertexes[3] = cnt_reshaped[diffYX.argmin()] # 上右 vertexes[1] = cnt_reshaped[diffYX.argmax()] # 下左 # 顶点顺序: 上左, 下左, 下右, 上右(逆时针) return np.array(vertexes).reshape(4, 1, 2) def perspTrans(self, image, approx, size): """ :function: perspectiveTransform透视变换 :param image: 待变换原图Error: perspTrans() takes 3 positional arguments but 4 were given\n'] :param approx: 原图中边界坐标(array(4,1,2)) :param size: 新图尺寸(list, [width, height]) :return: 变换后的新图(BGR) """ # 读入数据: pts: 原图中边界四点坐标, rect: 按顺序排列四点坐标 pts = approx.reshape(4, 2) # array(4,1,2) --> array(4,2) rect = np.zeros((4, 2), dtype="float32") # 四点坐标排序: rect[上左, 上右, 下右, 下左] sumYX = pts.sum(axis=1) rect[0] = pts[sumYX.argmin()] # 上左 rect[2] = pts[sumYX.argmax()] # 下右 diffYX = np.diff(pts, axis=1) rect[1] = pts[diffYX.argmin()] # 上右 rect[3] = pts[diffYX.argmax()] # 下左 # 确定变换后字母框的四点坐标 dst = np.array( [[0, 0], [size[0] - 1, 0], [size[0] - 1, size[1] - 1], [0, size[1] - 1]], dtype="float32", ) # 透视变换: ptMatrix: 变换矩阵, warped: 变换后图片 ptMatrix = cv2.getPerspectiveTransform(rect, dst) warped = cv2.warpPerspective(image, ptMatrix, (size[0], size[1])) return warped def cntsDetect(self, image): """ :function: contoursDetect轮廓检测 :param image: 待检测原图 :return: 4个字母框的近似矩形轮廓在原图中的坐标(list, array(4,1,2), len=4) """ # Step1: 边缘检测 image_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) image_gray = cv2.GaussianBlur(image_gray, (5, 5), 0) # [参数!] 高斯模糊: 滤除噪声 image_edged = cv2.Canny(image_gray, 80, 200) # [参数!] 边缘检测(两个阈值越大, 保留的轮廓越少) # Step2: 轮廓提取(目标: 识别板内四个字母框的轮廓, 思路: 先提取面积最大轮廓, 若长宽比近似于1则认为面积前四即字母框, 否则认为是识别板外轮廓) found = 0 image_forCnt = image_edged.copy() # 用于提取轮廓的edged图 self.image_forChar = image.copy() # 用于抠出字母框作匹配的color图 while not found: temp, cnts, hier = cv2.findContours( image_forCnt, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE ) cnts = sorted(cnts, key=cv2.contourArea, reverse=True) # 取面积最大轮廓 approx = self.vertexFind(cnts[0]) aprx = approx.reshape(4, 2) widthT = np.sqrt( (aprx[0][0] - aprx[3][0]) ** 2 + (aprx[0][1] - aprx[3][1]) ** 2 ) widthB = np.sqrt( (aprx[1][0] - aprx[2][0]) ** 2 + (aprx[1][1] - aprx[2][1]) ** 2 ) heightL = np.sqrt( (aprx[0][0] - aprx[1][0]) ** 2 + (aprx[0][1] - aprx[1][1]) ** 2 ) heightR = np.sqrt( (aprx[2][0] - aprx[3][0]) ** 2 + (aprx[2][1] - aprx[3][1]) ** 2 ) width = max(widthT, widthB) height = max(heightL, heightR) if ( width < height ): # 理论上width > height, 但实际上由于四点顺序不同可能有width < height出现, 此时交换二者 width, height = height, width r = width / height if r <= 1.2: found = 1 else: image_forCnt = self.perspTrans( image_forCnt, approx, [int(630 * r), 630] ) self.image_forChar = self.perspTrans( self.image_forChar, approx, [int(630 * r), 630] ) # 确保image_forCnt和image_forChar的内容保持同步(仅色彩不同) aprxes = [] for i in range(4): approxI = self.vertexFind(cnts[i]) aprxes.append(approxI) return aprxes def charDetect(self, aprxes): """ :function: charDetect字母检测 :param aprxes: 4个字母框的近似矩形轮廓在原图中的坐标(list, array(4,1,2), len=4) :return: 纠正后的4个字母框图片(list, len=4) """ aprxes_tl = np.array([aprxes[i][0][0] for i in range(4)]) aprxes_ordered = [0 for _ in range(4)] sumYX = aprxes_tl.sum(axis=1) aprxes_ordered[0] = aprxes[sumYX.argmin()] # 上左(1) aprxes_ordered[3] = aprxes[sumYX.argmax()] # 下右(4) diffYX = np.diff(aprxes_tl, axis=1) aprxes_ordered[1] = aprxes[diffYX.argmin()] # 上右(2) aprxes_ordered[2] = aprxes[diffYX.argmax()] # 下左(3) charImages = [] for aprx in aprxes_ordered: charImage = self.perspTrans(self.image_forChar, aprx, [110, 110]) charImage = self.cropImg(charImage, 0.1) charImages.append(charImage) return charImages def cropImg(self, image, ratio): """ :funciton: cropImage裁剪图片 :param image: 欲裁剪原图 :param ratio: 上下左右裁剪的长度比例 :return: 裁剪后的图片crop_img """ height, width, _ = image.shape x = int(width * ratio) y = int(height * ratio) w = int(width * (1 - ratio * 2)) h = int(height * (1 - ratio * 2)) crop_img = image[y : y + h, x : x + w] return crop_img def tmplMatch(self, charImage, threshold): """ :function: templateMatch模板匹配 :param charImage: 待识别字母图片(经过透视变换) :param threshold: 识别阈值(一旦与某个模板的匹配度超过该值, 即返回该模板对应字母) :return: 识别结果(字母) """ image_gray = cv2.cvtColor(charImage, cv2.COLOR_BGR2GRAY) blank_var = np.var(image_gray, axis=None, dtype=None, ddof=0, keepdims=False) if blank_var < 500: return " " for tmpl_char in self.charTmplLib: tmpl = cv2.imread(tmpl_char[0]) tmpl_gray = cv2.cvtColor(tmpl, cv2.COLOR_BGR2GRAY) # 放大待识别图片image for scale in np.linspace(1.0, 1.3, 30): image_resized = imutils.resize( image_gray, width=int(image_gray.shape[1] * scale) ) tmplRes = cv2.matchTemplate( image_resized, tmpl_gray, cv2.TM_CCOEFF_NORMED ) minVal, maxVal, minLoc, maxLoc = cv2.minMaxLoc(tmplRes) if maxVal >= threshold: return tmpl_char[1] # 缩小模板图片tmpl for scale in np.linspace(0.7, 1.0, 30): tmpl_resized = imutils.resize( tmpl_gray, width=int(tmpl_gray.shape[1] * scale) ) tmplRes = cv2.matchTemplate( image_resized, tmpl_resized, cv2.TM_CCOEFF_NORMED ) minVal, maxVal, minLoc, maxLoc = cv2.minMaxLoc(tmplRes) if maxVal >= threshold: return tmpl_char[1] return " " def recognize(self, image): """ :function: recognize识别(主函数) :param image: 待识别目标板原图 :return: 识别结果(字母)(list, [char1, char2, char3, char4]) """ charAprxes = self.cntsDetect(image) charImages = self.charDetect(charAprxes) charResult = ["", "", "", ""] for i in range(4): char_single = self.tmplMatch(charImages[i], 0.7) # [参数!] charResult[i] = char_single return charResult class CharRecognizer: def __init__(self, use_fake_img): self.use_fake_img = use_fake_img # 是否使用假图的参数 rospy.init_node("char_recognizer") self.bridge = cv_bridge.CvBridge() # 创建CV桥 self.actRecognizer = ActualCharRecognizer( "/home/EPRobot/robot_ws/src/char_recognizer/template" ) # 创建字母识别器(实际) self.scheduler_client = rospy.ServiceProxy( "mission", DestinationMsg ) # 创建调度器请求客户 self.actuator_client = rospy.ServiceProxy( "permission", PermissionMsg ) # 创建执行器请求客户 self.board_reminder_server = rospy.Service( "board_reminder_server", NeedToSeeMsg, self.ReminderHandler ) # 创建目标板提示服务器 rospy.loginfo("[recognizer] recognizer_server正常启动") rospy.wait_for_service("mission") rospy.loginfo("[recognizer] 连接schduler_server成功") rospy.wait_for_service("permission") rospy.loginfo("[recognizer] 连接actuator_server成功") rospy.spin() def ReminderHandler(self, req): rospy.loginfo("[recognizer] 收到reminder请求“需要看”: %d" % req.need_to_see) if req.need_to_see: can_see = 0 # 默认“不能看” while not can_see: can_see = self.actuator_client.call(0).permission # 向actuator请求“想看” rospy.loginfo("[recognizer] 已向actuator请求“想看”") rospy.sleep(2) rospy.loginfo("[recognizer] 收到actuator回复“能看”") self.RecognizeHandler() # “能看”以后开始识别 return NeedToSeeMsgResponse(True) def RecognizeHandler(self): def Photograph(): if not self.use_fake_img: # 不使用假图: 向相机订阅照片 temp_sub = rospy.Subscriber("/usb_cam/image_raw", Image) # 创建临时的照片订阅 rospy.sleep(1) # 延时1s, 等待相机自动曝光 board_image = rospy.wait_for_message( "/usb_cam/image_raw", Image ) # 订阅一次照片 temp_sub.unregister() # 获取到照片后, 取消临时订阅 board_image = self.bridge.imgmsg_to_cv2(board_image, "bgr8") image_name = ( "/home/EPRobot/robot_ws/src/char_recognizer/board1_image/board1_%s.jpg" % str(random.randint(10000, 99999)) ) cv2.imwrite(image_name, board_image) else: board_image = cv2.imread( "/home/EPRobot/robot_ws/src/char_recognizer/board1_ABC.jpg" ) return board_image rospy.loginfo("[recognizer] 开始识别...") # Step1. 获取目标板照片 board_image = Photograph() # board_image = imutils.resize(board_image, width=1000) # 原640*480照片需放大才能识别 # Step2. 识别目标板字母 charResult = self.actRecognizer.recognize(board_image) while charResult == [" ", " ", " ", " "]: rospy.loginfo("[recognizer] 识别到四个空白框! 等待3s后重新识别...") rospy.sleep(3) board_image = Photograph() charResult = self.actRecognizer.recognize(board_image) rospy.loginfo( "[recognizer] 识别成功, 结果: 1[%c] 2[%c] 3[%c] 4[%c]" % (charResult[0], charResult[1], charResult[2], charResult[3]) ) self.actuator_client.call(1) # 向actuator请求“看完了” rospy.loginfo("[recognizer] 已向actuator请求“看完了”") # Step3. 向scheduler请求新的配送需求(作为client) drugTypeToInt = {"A": 0, "B": 1, "C": 2} for i in range(4): if charResult[i] != " ": self.scheduler_client.call( 0, 0, drugTypeToInt[charResult[i]], i + 1 ) # (i+1): 目的地编号为1~4 rospy.loginfo( "[recognizer] 已向scheduler请求新配送需求: 药品[%c] --> 窗口[%d]" % (charResult[i], i + 1) ) if __name__ == "__main__": # 读入是否使用假图的参数 myargv = rospy.myargv(argv=sys.argv) if "--use_fake_img" in myargv: use_fake_img = int(myargv.index("--use_fake_img") + 1) else: use_fake_img = 0 charRecognizer = CharRecognizer(use_fake_img)
13,943
Python
.py
299
30.602007
96
0.549346
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,395
fake_actuator_server.py
cyiyang_miniros/char_recognizer/scripts/fake_actuator_server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import rospy from char_recognizer.srv import PermissionMsg, PermissionMsgResponse def doSomething(req): response = PermissionMsgResponse() if req.request == 0: response.permission = 1 rospy.loginfo("[fake_actuator]收到“想看”, 已回复“能看”") else: rospy.loginfo("[fake_actuator]收到“看完了”") return response if __name__ == "__main__": rospy.init_node("fake_actuator_server.py") fake_actuator_server = rospy.Service("permission", PermissionMsg, doSomething) rospy.loginfo("[fake_actuator]fake_actuator_server已启动!") rospy.spin()
664
Python
.py
17
31.882353
82
0.695652
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,396
send_goals_node_python.py
cyiyang_miniros/send_goals/scripts/send_goals_node_python.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # 动作通信:该例程在任一仿真环境下,执行/action_client通信,消息类型move_base_msgs/MoveBaseAction MoveBaseGoal import roslib import rospy import actionlib from actionlib_msgs.msg import * from geometry_msgs.msg import Pose, Point, Quaternion from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from tf.transformations import quaternion_from_euler from math import pi def client(): # 1、订阅move_base服务器的消息 rospy.init_node("simple_goal", anonymous=True) move_base = actionlib.SimpleActionClient("move_base", MoveBaseAction) move_base.wait_for_server() rospy.loginfo("Connected to move base server") test_number = int(sys.argv[1]) # 设定编号 quaternions = list() euler_angles = ( pi / 2, pi / 2, pi / 2, -pi / 2, -pi / 2, -pi / 2, -pi / 2, 0, pi, ) # 将上面的Euler angles转换成Quaternion的格式 for angle in euler_angles: q_angle = quaternion_from_euler(0, 0, angle, axes="sxyz") q = Quaternion(*q_angle) quaternions.append(q) point_test = list() point_test.append(Pose(Point(2.2, 2.30, 0), quaternions[0])) # A点 point_test.append(Pose(Point(3.08, 2.75, 0), quaternions[1])) # B点 point_test.append(Pose(Point(3.04, 1.82, 0), quaternions[2])) # C点 point_test.append(Pose(Point(-1.90, 2.10, 0), quaternions[3])) # 1点 point_test.append(Pose(Point(-1.03, 1.63, 0), quaternions[4])) # 2点 point_test.append(Pose(Point(-1.88, 1.13, 0), quaternions[5])) # 3点 point_test.append(Pose(Point(-1.03, 0.68, 0), quaternions[6])) # 4点 # 2、目标点内容 goal = MoveBaseGoal() goal.target_pose.header.frame_id = "slave/map" goal.target_pose.header.stamp = rospy.Time.now() goal.target_pose.pose = point_test[test_number] # 3、将目标点发送出去 rospy.loginfo("Sending goal") move_base.send_goal(goal) # 4、五分钟时间限制 查看是否成功到达 finished_within_time = move_base.wait_for_result(rospy.Duration(30)) if not finished_within_time: move_base.cancel_goal() rospy.loginfo("Timed out achieving goal") else: state = move_base.get_state() if state == GoalStatus.SUCCEEDED: rospy.loginfo("Goal succeeded!") else: rospy.loginfo("Goal failed! ") if __name__ == "__main__": client()
2,559
Python
.py
64
30.890625
84
0.637744
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,397
scheduler_server.py
cyiyang_miniros/deliver_scheduler/scripts/scheduler_server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import threading import rospy from scheduler import CoolingTimePlan, NeedToSeePlan, NeedToChangeStatus from scheduler_ros import SchedulerROS from SocketService import SocketServiceMaster # Future warning 不知道是干什么的 # sys.path.append("/home/ncut/scheduler_ws/devel/lib/python2.7/dist-packages") DEBUG = 0 # WARNING: 网络环境变化时,多处IP需要修改,建议通过环境变量获取地址和端口等信息 SLAVE_ADDR = "192.168.137.172" SLAVE_PORT = 12345 SLAVE_READY_PORT = 11515 FIXED_PERIOD = False def SchedulerServerMain(): rospy.spin() def DrugCoolingTimeHandlerMain(): # ROS 版本 # needToChangeService = rospy.ServiceProxy("changetime", ChangeTimeResult) rospy.loginfo("[scheduler] 等待changetime服务...") # socket 版本 needToChangeService = SocketServiceMaster( slave_addr=SLAVE_ADDR, slave_port=SLAVE_PORT, slave_ready_port=SLAVE_READY_PORT ) rospy.loginfo("[scheduler] 等待连接到slave...") needToChangeService.wait_for_service() rospy.loginfo("[scheduler] 成功连接到slave!") while not rospy.is_shutdown(): need = deliverScheduler.GetNeedToChangeStatus() if need != NeedToChangeStatus.DONT_CHANGE.value: if need == NeedToChangeStatus.SPEED_UP.value: rospy.logwarn("[scheduler to watcher] 请减少配药时间!") if need == NeedToChangeStatus.SLOW_DOWN.value: rospy.logwarn("[scheduler to watcher] 请增加配药时间!") rospy.loginfo("[scheduler] 发出修改请求...") change_success = needToChangeService.call(need) if need != deliverScheduler.GetNeedToChangeStatus(): # 可能存在到达手写数字点后,已经不需要更新配送时间的情况 # TODO 存在bug: 当小车第一轮有 2A 需求时, rospy.logwarn("[scheduler] 更新时间需求与发出请求时不同!") rospy.logwarn("[scheduler] 发出请求时: %d", need) rospy.logwarn("[scheduler] 当前: %d", deliverScheduler.GetNeedToChangeStatus()) if change_success: deliverScheduler.UpdateDrugCoolingTime(need) rospy.logwarn("[watcher to scheduler] 修改成功!") print( "当前状态:" + str(deliverScheduler.coolingTimeStateMachine.current_state.value) ) if __name__ == "__main__": deliverScheduler = SchedulerROS() print(deliverScheduler.reminder.interval) deliverScheduler.RegisterService() if FIXED_PERIOD: rospy.logwarn("scheduler 正在以固定的周期运行!") deliverScheduler.UpdateNeedToSeeInterval(NeedToSeePlan.PERIOD_2) deliverScheduler.UpdateDrugCoolingTime(CoolingTimePlan.PERIOD_3) deliverScheduler.start() rospy.loginfo("[scheduler] 调度器就绪!") SchedulerServerMain()
2,989
Python
.py
61
36
95
0.693111
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,398
reloadable_timer.py
cyiyang_miniros/deliver_scheduler/scripts/reloadable_timer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import threading import time class ReloadableTimer(object): def __init__(self, interval, autoReload, function, args=[], kwargs={}): self.interval = interval self.reloadInterval = interval self.function = function self.args = args self.kwargs = kwargs self.thread = None self.running = False self.startTime = None self.autoReload = autoReload def start(self): if self.running: return self.running = True self.startTime = time.time() self.thread = threading.Timer(self.interval, self._run) # setDaemon(True) 后,当主线程退出时,其他定时器线程也将退出 self.thread.setDaemon(True) self.thread.start() def _run(self): self.running = False self.startTime = None threading.Thread( target=self.function, args=self.args, kwargs=self.kwargs ).start() if self.autoReload: # 自动重载会以 self.reloadInterval 指定的间隔进行 self.restart(self.reloadInterval) def stop(self): self.thread.cancel() self.running = False def restart(self, interval=None): """使得定时器的剩余时间为 interval,但不影响定时器的重载值""" if interval is not None: self.interval = interval if self.thread is not None: self.stop() self.start() def restartWithInterval(self, interval): """设置定时器的计时周期,并立刻以该周期重新开始计时""" self.interval = interval self.reloadInterval = interval if self.thread is not None: self.stop() self.start() def isAlive(self): return self.thread and self.running def getElapsedTime(self): """若没有执行过 setRemainTime, 该方法会返回start后的时间,否则会返回上一次 setRemainTime 后经过的时间""" if not self.startTime: return None return time.time() - self.startTime def getRemainTime(self): """返回本次定时剩余的时间, 如果定时器没有启动,则会返回 None""" if not self.startTime: return None return max(0, self.interval - self.getElapsedTime()) def setRemainTime(self, remainTime): """临时修改定时器的剩余时间,本轮定时器超时后,将按原有的周期继续运行""" if remainTime <= 0: self._run() return self.restart(remainTime) def setNewInterval(self, newInterval): """修改下一周期开始的定时周期,不会影响当前周期的剩余时间""" self.reloadInterval = newInterval def getReloadInterval(self): return self.reloadInterval
2,902
Python
.py
73
25.767123
81
0.623709
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)
2,287,399
SocketService.py
cyiyang_miniros/deliver_scheduler/scripts/SocketService.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import socket import time class SocketServiceMaster(object): def __init__( self, slave_addr, slave_port, slave_ready_port, use_full_socket=False, time_to_return=5, ): self.slave_addr = slave_addr # slave_port 目前没有作用 self.slave_port = slave_port self.socket = None # slave 向 sch@master 汇报到达手写数字点的端口 self.slave_ready_port = slave_ready_port # 如果不采用socket, wait_for_service 将立即返回, call 方法将等待 time_to_return 秒后返回 self.use_full_socket = use_full_socket self.time_to_return = time_to_return def wait_for_service(self): if self.use_full_socket: self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.connect((self.slave_addr, self.slave_port)) # 等待副车上线并到达手写数字点 # 创建套接字对象 slave_ready_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_address = (self.slave_addr, self.slave_ready_port) print("等待连接到slave...") while True: try: slave_ready_socket.connect(server_address) break except socket.error as e: print("连接失败:", e) print("等待 5 秒后重新连接") time.sleep(5) # 等待 5 秒后重新连接 print("成功连接到slave!") # 接收数据 print("正在接收数据...") received_data = slave_ready_socket.recv(1024) # 解析JSON数据 json_data = received_data.decode("utf-8") data = json.loads(json_data) # 获取 slave_ready 的值 self.slave_ready = data.get("slave_ready") # 打印 slave_ready 的值 print("slave_ready:", self.slave_ready) # 关闭连接 slave_ready_socket.close() def call(self, need=0): if not self.slave_ready: raise RuntimeError("Slave未到达手写数字点") if not self.use_full_socket: time.sleep(self.time_to_return) return True # 使用socket if not self.socket: raise RuntimeError("Service not connected. Call 'wait_for_service' first.") # 发送带有"NeedToChange: True"的JSON字符串 request = {"NeedToChange": True, "need": need} request_str = json.dumps(request) self.socket.sendall(request_str) # 等待从节点返回响应 response_str = self.socket.recv(4096) # 解析响应JSON字符串 response = json.loads(response_str) # 检查是否成功 if "Success" in response and response["Success"] == True: return True else: return False
2,946
Python
.py
75
25.653333
87
0.588189
cyiyang/miniros
8
1
0
GPL-2.0
9/5/2024, 10:48:18 PM (Europe/Amsterdam)