Beispiel #1
0
	def authenticate(self):
		resp = self.provider.GET(provider.get_setting('url_address'),
			{
				'get_token': 'get_token',
				'app_id': self.app_id
			}
		)
		if int(resp.code) == 200:
			json = resp.json()
			self.authenticated = True
			self.token = json['token']
			self.provider.log.info('Got token: %s'%json['token'])
			return
		else:
			provider.log.info('error getting token: %s'%resp.msg)
			provider.notify('Error getting token')
			return
Beispiel #2
0
    def parseRawResults(self, data):
        results = []
        for torrent in self.ipt_regex.findall(data):
            url = "%s%s" % (provider.get_setting("url_address"), urllib.quote(torrent[1]))
            results.append(
                {
                    "name": torrent[0],
                    # 'info_hash': hashlib.sha1(url).hexdigest(),
                    "uri": url,
                    "seeds": int(torrent[3]),
                    "peers": int(torrent[4]),
                    "size": furious.human2bytes(torrent[2]),
                }
            )

            # print results
        return results
def hasDateBasedEpisodeNumbering(id):
    exceptions = provider.get_setting('showexceptions')
    return int(id) in [int(x.strip()) for x in exceptions.split(',')]
Beispiel #4
0
from pulsar import provider


icon = provider.ADDON.getAddonInfo('icon')
notificationTime = int(provider.get_setting('time_noti'))

def search(query):
	query = query.replace(' ', '%20')
	url_search = "https://getstrike.net/api/v2/torrents/search/?phrase=%s" % (query)
	provider.log.info(url_search)
	response = provider.GET(url_search)
	results=[]
	if response != (None, None):
		items = provider.parse_json(response.data)
		nbrTorrents = items['results']
		for torrent in range(0, nbrTorrents):
			hash = items['torrents'][torrent]['torrent_hash']
			name = items['torrents'][torrent]['torrent_title']
			magnet = items['torrents'][torrent]['magnet_uri']
			results.append({'name': name, 'uri': magnet, 'info_hash': hash})
	return results
		
def search_episode(info):
	title = info['title'].encode('utf-8') + ' S%02dE%02d' % (info['season'],info['episode'])
	if notificationTime > 0:
		provider.notify(message='Searching: ' + title +'...', header=None, time=notificationTime, image=icon)
	return search(title)

def search_movie(info):
	title = info['title'].encode('utf-8') + ' %s' % (info['year'])
	if notificationTime > 0: