Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/inputstreamhelper/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@
'webOS': '21.1'
}

WIDEVINE_VERSIONS_URL = 'https://dl.google.com/widevine-cdm/versions.txt'

WIDEVINE_DOWNLOAD_URL = 'https://dl.google.com/widevine-cdm/{version}-{os}-{arch}.zip'

WIDEVINE_LICENSE_FILE = 'LICENSE'

WIDEVINE_MANIFEST_FILE = 'manifest.json'
Expand Down
28 changes: 2 additions & 26 deletions lib/inputstreamhelper/widevine/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import json
import random

from .. import config
from ..kodiutils import log
from ..utils import arch, http_get, http_head, http_post, system_os
from ..utils import arch, http_post, system_os


def cdm_from_repo():
Expand All @@ -18,28 +16,6 @@ def cdm_from_repo():
return False


def widevines_available_from_repo():
"""Returns all available Widevine CDM versions and urls from Google's library CDM repository"""
cdm_versions = http_get(config.WIDEVINE_VERSIONS_URL).strip('\n').split('\n')
try:
cdm_os = config.WIDEVINE_OS_MAP[system_os()]
cdm_arch = config.WIDEVINE_ARCH_MAP_REPO[arch()]
except KeyError:
cdm_os = "mac"
cdm_arch = "x64"
available_cdms = []
for cdm_version in cdm_versions:
cdm_url = config.WIDEVINE_DOWNLOAD_URL.format(version=cdm_version, os=cdm_os, arch=cdm_arch)
http_status = http_head(cdm_url)
if http_status == 200:
available_cdms.append({'version': cdm_version, 'url': cdm_url})

if not available_cdms:
log(4, "could not find any available cdm in repo")

return available_cdms


def latest_widevine_available_from_repo(cdm_os, cdm_arch):
"""Returns the latest available Widevine CDM version and url from Google's library CDM repository"""
cdm = {}
Expand Down Expand Up @@ -69,7 +45,7 @@ def latest_widevine_available_from_repo(cdm_os, cdm_arch):
'platform': cdm_os,
},
'protocol': '4.0',
'updaterversion': '140.0.7339.127'
'updaterversion': '142.0.7444.175'
}
}
text = http_post(url, data=json.dumps(payload).encode('utf-8'), headers=headers)
Expand Down
Loading