:obj:`list` of :obj:`dict`
List of all the serialized data pulled out of the pagws <script/> tags
"""
- scripts = page_soup.find_all('script', attrs={'src': None});
+ scripts = page_soup.find_all('script', attrs={'src': None})
self.log(msg='Trying sloppy inline data parser')
inline_data = self._sloppy_parse_inline_data(scripts=scripts)
if self._verfify_auth_and_profiles_data(data=inline_data) != False:
},
}
"""
+ mpaa = ''
+ if episode.get('maturity', None) is not None:
+ if episode['maturity'].get('board', None) is not None and episode['maturity'].get('value', None) is not None:
+ mpaa = str(episode['maturity'].get('board', '').encode('utf-8')) + '-' + str(episode['maturity'].get('value', '').encode('utf-8'))
+
return {
episode['summary']['id']: {
'id': episode['summary']['id'],
'title': episode['info']['title'],
'year': episode['info']['releaseYear'],
'genres': self.parse_genres_for_video(video=episode, genres=genres),
- 'mpaa': str(episode['maturity']['rating']['board']) + ' ' + str(episode['maturity']['rating']['value']),
+ 'mpaa': mpaa,
'maturity': episode['maturity'],
'playcount': (0, 1)[episode['watched']],
'rating': episode['userRating'].get('average', 0) if episode['userRating'].get('average', None) != None else episode['userRating'].get('predicted', 0),
response = self._path_request(paths=paths)
return self._process_response(response=response, component='Search results')
- def fetch_video_list (self, list_id, list_from=0, list_to=20):
+ def fetch_video_list (self, list_id, list_from=0, list_to=26):
"""Fetches the JSON which contains the contents of a given video list
Parameters
: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():