def __init__(self, content, settings=None): Informer.__init__(self) self._dict = dict() self.content = content self.settings = settings self.OK = self.parse()
def __init__(self, content, settings=None): Informer.__init__(self) self._dict.clear() self.content = content self.settings = settings self.OK = self.parse()
def __init__(self, title, description, settings=None): Informer.__init__(self) self._dict = dict() self.content = description self.settings = settings self._dict['full_title'] = title.strip(' \t\n\r') self.OK = self.parse()
def __init__(self, title, description, settings=None): Informer.__init__(self) self._dict.clear() self.content = description self.settings = settings self._dict['full_title'] = title.strip(' \t\n\r') self.OK = self.parse()
def __init__(self, url, fulltitle, settings=None): Informer.__init__(self) soup_base.__init__(self, url) self._dict = dict() self._dict['link'] = url self._dict['full_title'] = fulltitle self.settings = settings self.OK = self.parse()
def clean_movie_by_imdbid(imdbid): api = movieapi.MovieAPI(imdbid) genre = api['genres'] if u'мультфильм' in genre: base_path = settings.animation_path() elif u'документальный' in genre: base_path = settings.documentary_path() else: base_path = settings.movies_path() mm = MoreRequests().get_movies_by_imdb(imdbid) from base import STRMWriterBase from base import Informer title = Informer().filename_with(api['title'], api['originaltitle'], api['year']) strm_path = filesystem.join(base_path, make_fullpath(title, '.strm')) #alt_path = strm_path + '.alternative' nfo_path = filesystem.join(base_path, make_fullpath(title, '.nfo')) strm_data = filesystem.fopen(mm[0][3], 'r').read() alt_data = [] for m in mm: links_with_ranks = STRMWriterBase.get_links_with_ranks(mm[0][3], settings, use_scrape_info=False) alt_data.extend(links_with_ranks) alt_data = [dict(t) for t in set([tuple(d.iteritems()) for d in alt_data])] #alt_data = list(set(alt_data)) #alt_data.sort(key=operator.itemgetter('rank')) with filesystem.save_make_chdir_context(base_path, 'STRMWriterBase.write_alternative'): STRMWriterBase.write_alternative(strm_path, alt_data) pass
def __init__(self, info, settings=None): Informer.__init__(self) self._dict = dict() self.api_info = None for item in soap4me_data.api_data: if item['title'] == info['originaltitle']: self.api_info = item break self.episodes_data = get_api_request('https://api.soap4.me/v2/episodes/' + str(self.api_info['sid']) + '/') from movieapi import KinopoiskAPI kp_url = KinopoiskAPI.make_url_by_id(self.kp_id) self.settings = settings self.make_movie_api(self.imdb_id, kp_url, self.settings) self.tvshow_api = TVShowAPI.get_by(info['originaltitle'], self.api_info['title_ru'], self.imdb_id, kp_url) self.OK = self.parse(self.api_info)