Shadow Plugin: Premiumize only streaming transcoded 720p files
Closed this issue · 1 comments
felipejfc commented
There's a bug in this function
def _single_magnet_resolve(self, magnet, pack_select=False): import logging folder_details = self.direct_download(magnet)['content'] folder_details = sorted(folder_details, key=lambda i: int(i['size']), reverse=True) folder_details = [i for i in folder_details if source_utils.is_file_ext_valid(i['link'])] return folder_details[0]['stream_link'] ''' filter_list = [i for i in folder_details if source_utils.filter_movie_title(i['path'].split('/')[-1], args['info']['title'], args['info']['year'])] ''' if len(filter_list) == 1: stream_link = self._fetch_transcode_or_standard(filter_list[0]) self._handle_add_to_cloud(magnet) return stream_link filter_list = [tfile for tfile in folder_details if 'sample' not in tfile['path'].lower()] filter_list = [tfile for tfile in filter_list if source_utils.cleanTitle(args['info']['title']) in source_utils.cleanTitle(tfile['path'].lower())] if len(filter_list) == 1: stream_link = self._fetch_transcode_or_standard(filter_list[0]) self._handle_add_to_cloud(magnet) return stream_link
This line
return folder_details[0]['stream_link']
should be replaced with
return folder_details[0]['stream_link'] if tools.getSetting('premiumize.transcoded') == 'true' else folder_details[0]['link']
Also, everything below it in the same function is useless given the return and should be erased, final code:
def _single_magnet_resolve(self, magnet, pack_select=False): import logging folder_details = self.direct_download(magnet)['content'] folder_details = sorted(folder_details, key=lambda i: int(i['size']), reverse=True) folder_details = [i for i in folder_details if source_utils.is_file_ext_valid(i['link'])] return folder_details[0]['stream_link'] if tools.getSetting('premiumize.transcoded') == 'true' else folder_details[0]['link']
thecrewwh commented
Fixed