Пример #1
0
    def showPack(self, simpleInfo, allInfo):

        try:
            showTitle = source_utils.cleanTitle(simpleInfo['show_title'])

            url = self.base_link + self.search_link % tools.quote('%s season 1-%s' % (showTitle, simpleInfo['no_seasons']))
            results = self.getList(url)

            url = self.base_link + self.search_link % tools.quote('%s complete' % showTitle)
            results += self.getList(url)

            torrent_list = []

            for i in results:
                try:
                    if not source_utils.filterShowPack(simpleInfo, i['release_title']):
                        continue
                    else:
                        i['package'] = 'show'
                        torrent_list.append(i)
                except:
                    continue

            self.threadResults += torrent_list

        except:
            import traceback
            traceback.print_exc()
            pass
Пример #2
0
    def getLocalTorrentResults(self):
        local_storage = database.getTorrents(self.trakt_id)
        relevant_torrents = []

        if 'showInfo' in self.args:
            simple_info = self.buildSimpleShowInfo(self.args)
            for torrent in local_storage:
                if source_utils.filterShowPack(simple_info,
                                               torrent['release_title']):
                    relevant_torrents.append(torrent)
                if source_utils.filterSingleEpisode(simple_info,
                                                    torrent['release_title']):
                    relevant_torrents.append(torrent)
                if source_utils.filterSeasonPack(simple_info,
                                                 torrent['release_title']):
                    relevant_torrents.append(torrent)
        else:
            relevant_torrents = local_storage

        if len(relevant_torrents) > 0:
            for torrent in relevant_torrents:
                torrent['source'] = 'Local Cache'
            self.allTorrents += relevant_torrents
            self.torrentCacheSources += TorrentCacheCheck().torrentCacheCheck(
                relevant_torrents, self.args)
Пример #3
0
    def showPack(self, simpleInfo, allInfo):

        try:
            showTitle = source_utils.cleanTitle(simpleInfo['show_title'])

            url = self.base_link + '%s/%s' % (
                showTitle[:1].lower(), '%s season 1-%s' %
                (showTitle, simpleInfo['no_seasons']))
            url = url.replace(' ', '-')
            results = self.getList(url)

            url = self.base_link + '%s/%s' % (showTitle[:1].lower(),
                                              '%s complete' % showTitle)
            url = url.replace(' ', '-')
            results += self.getList(url)

            results = self.get_info(results, 'show')
            torrent_list = []

            for torrent in results:
                try:
                    if not source_utils.filterShowPack(
                            simpleInfo, torrent['release_title']):
                        continue
                    torrent_list.append(torrent)
                except:
                    continue

            self.threadResults += torrent_list

        except:
            pass
Пример #4
0
    def show_pack(self, simpleInfo, allInfo):

        season = 1
        no_seasons = simpleInfo['no_seasons']

        query = quote_plus(simpleInfo['show_title'] + ' season %s+%s' %
                           (season, no_seasons))

        url = self.base_link + self.search_link % query
        print(url)
        try:
            search_results = self.searchResults(serenRequests().get(url))
        except:
            import traceback
            traceback.print_exc()
            return

        for i in search_results:
            release = i.findAll('a')[1]
            url = release['href']
            release_title = release.text
            if source_utils.filterShowPack(simpleInfo, release_title):
                self.showPackThreads.append(
                    threading.Thread(target=self.info_thread,
                                     args=(release_title, url, 'show')))

        for i in self.showPackThreads:
            i.start()
        for i in self.showPackThreads:
            i.join()

        return
Пример #5
0
    def showPack(self, simpleInfo, allInfo):

        try:
            showTitle = source_utils.cleanTitle(simpleInfo['show_title'])

            url = self.base_link + self.search_link + tools.quote(
                '%s season 1-%s' % (showTitle, simpleInfo['no_seasons']))
            response = serenRequests().get(url, timeout=10)
            try:
                if response.status_code != 200:
                    return
            except:
                return
            webpage = BeautifulSoup(response.text, 'html.parser')
            results = webpage.find_all('tr')

            url = self.base_link + self.search_link + tools.quote(
                '%s complete' % showTitle)
            response = serenRequests().get(url)
            webpage = BeautifulSoup(response.text, 'html.parser')
            results += webpage.find_all('tr')

            torrent_list = []

            for i in results:
                try:
                    torrent = {}
                    torrent['package'] = 'pack'
                    torrent['release_title'] = i.find('a', {'class', 'detLink'}).text
                    if not source_utils.filterShowPack(simpleInfo, torrent['release_title']):
                        continue
                    torrent['magnet'] = i.find_all('a')[3]['href']
                    if 'magnet:?' not in torrent['magnet']:
                        torrent['magnet'] = self.magnet_request(torrent['magnet'])
                    torrent['seeds'] = int(i.find_all('td')[2].text)
                    torrent_list.append(torrent)
                except:
                    continue

            self.threadResults += torrent_list

        except:
            pass