55import json
66import random
77
8- from .. import config
9- from ..kodiutils import log
10- from ..utils import arch , http_get , http_head , http_post , system_os
8+ from ..utils import arch , http_post , system_os
119
1210
1311def cdm_from_repo ():
@@ -18,28 +16,6 @@ def cdm_from_repo():
1816 return False
1917
2018
21- def widevines_available_from_repo ():
22- """Returns all available Widevine CDM versions and urls from Google's library CDM repository"""
23- cdm_versions = http_get (config .WIDEVINE_VERSIONS_URL ).strip ('\n ' ).split ('\n ' )
24- try :
25- cdm_os = config .WIDEVINE_OS_MAP [system_os ()]
26- cdm_arch = config .WIDEVINE_ARCH_MAP_REPO [arch ()]
27- except KeyError :
28- cdm_os = "mac"
29- cdm_arch = "x64"
30- available_cdms = []
31- for cdm_version in cdm_versions :
32- cdm_url = config .WIDEVINE_DOWNLOAD_URL .format (version = cdm_version , os = cdm_os , arch = cdm_arch )
33- http_status = http_head (cdm_url )
34- if http_status == 200 :
35- available_cdms .append ({'version' : cdm_version , 'url' : cdm_url })
36-
37- if not available_cdms :
38- log (4 , "could not find any available cdm in repo" )
39-
40- return available_cdms
41-
42-
4319def latest_widevine_available_from_repo (cdm_os , cdm_arch ):
4420 """Returns the latest available Widevine CDM version and url from Google's library CDM repository"""
4521 cdm = {}
@@ -69,7 +45,7 @@ def latest_widevine_available_from_repo(cdm_os, cdm_arch):
6945 'platform' : cdm_os ,
7046 },
7147 'protocol' : '4.0' ,
72- 'updaterversion' : '140 .0.7339.127 '
48+ 'updaterversion' : '142 .0.7444.175 '
7349 }
7450 }
7551 text = http_post (url , data = json .dumps (payload ).encode ('utf-8' ), headers = headers )
0 commit comments