X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=resources%2Flib%2FNetflixSession.py;h=69c848f666f1761e14cc6c501321cd1faae39182;hb=c6e56c0365952da48fa6678c83497fecdb5d73e6;hp=d2be1cdd9ba7ea92dfa7a318e9a0dcba510d25ef;hpb=8416be9e6d04a977eeb70522c2400fa2143f3da9;p=plugin.video.netflix.git diff --git a/resources/lib/NetflixSession.py b/resources/lib/NetflixSession.py index d2be1cd..69c848f 100644 --- a/resources/lib/NetflixSession.py +++ b/resources/lib/NetflixSession.py @@ -2299,11 +2299,31 @@ class NetflixSession: :obj:`str` of :obj:`str ESN, something like: NFCDCH-MC-D7D6F54LOPY8J416T72MQXX3RD20ME """ - esn = '' + # we generate an esn from device strings for android + import subprocess + try: + manufacturer = subprocess.check_output(["/system/bin/getprop", "ro.product.manufacturer"]) + if manufacturer: + esn = 'NFANDROID1-PRV-' + input = subprocess.check_output(["/system/bin/getprop", "ro.nrdp.modelgroup"]) + if not input: + esn = esn + 'T-L3-' + else: + esn = esn + input.strip(' \t\n\r') + '-' + esn = esn + '{:5}'.format(manufacturer.strip(' \t\n\r').upper()) + input = subprocess.check_output(["/system/bin/getprop" ,"ro.product.model"]) + esn = esn + input.strip(' \t\n\r').replace(' ', '=').upper() + self.log(msg='Android generated ESN:' + esn) + return esn + except OSError as e: + self.log(msg='Ignoring exception for non Android devices') + # values are accessible via dict (sloppy parsing successfull) if type(netflix_page_data) == dict: return netflix_page_data.get('esn', '') + esn = '' + # values are stored in lists (returned from JS parser) for item in netflix_page_data: if 'esnGeneratorModel' in dict(item).keys():