本文整理汇总了Python中entertainment.net.Net类的典型用法代码示例。如果您正苦于以下问题:Python Net类的具体用法?Python Net怎么用?Python Net使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Net类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ExtractContentAndAddtoList
def ExtractContentAndAddtoList(self, indexer, section, url, type, list, page='', total_pages='', sort_by='', sort_order=''):
new_url = url.replace('.so/','.la/')
if page == '':
page = '1'
else:
page = str( int(page) )
new_url = new_url + page
from entertainment.net import Net
net = Net()
import urllib
url = urllib.unquote_plus(url)
new_url = self.base_url+section+'/'
html = net.http_GET(new_url+str(page)).content
if total_pages == '':
lastlist = '/'+section+'/'
r= ">Next</a> <a href='%s(.+?)'>Last</a>" % lastlist
total_pages = re.compile(r).findall(html)[0]
self.AddInfo(list, indexer, section, '', type, str(page), total_pages)
if section == 'featured-movies' or 'new-releases' or 'latest-added' or 'latest-hd-movies' or 'most-viewed' or 'most-voted' or 'az' or 'genres':
match=re.compile('<h1><a href="(.+?)" target="_self" title="(.+?) \((.+?)\)">',re.DOTALL).findall(html)
for url,name,year in match:
name = self.CleanTextForSearch(name)
self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + year +')' ,'',type, url='http://www.movie25.ag'+url, name=name, year=year)
示例2: GetContent
def GetContent(self, indexer, url, title, name, year, season, episode, type, list):
import urllib
url = urllib.unquote_plus(url)
title = urllib.unquote_plus(title)
name = urllib.unquote_plus(name)
name = (name).lower()
import re
from entertainment.net import Net
net = Net(cached=False)
net.set_cookies(self.cookie_file)
content = net.http_GET(url).content
if type == 'tv_seasons':
match=re.compile('<br><br><b>(.+?)x').findall(content)
for seasonnumber in match:
item_title = 'Season ' + seasonnumber
item_id = common.CreateIdFromString(title + ' ' + item_title)
self.AddContent(list, indexer, common.mode_Content, item_title, item_id, 'tv_episodes', url=url, name=name, season=seasonnumber)
elif type == 'tv_episodes':
match=re.compile("<br><b>"+season+"x(.+?)\s-\s<a style=.+?color.+?\shref='/(.+?)'>(.+?)</a>").findall(content)
for item_v_id_2,url,item_title in match:
season = "0%s"%season if len(season)<2 else season
item_v_id_2 = "0%s"%item_v_id_2 if len(item_v_id_2)<2 else item_v_id_2
item_url = self.base_url + url
item_v_id_2 = str(int(item_v_id_2))
self.AddContent(list, indexer, common.mode_File_Hosts, item_title, item_id, type, url=item_url, name=name, season=season, episode=item_v_id_2)
示例3: Resolve
def Resolve(self, url):
from entertainment.net import Net
import re
import time
net = Net()
try:
common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: [B][COLOR white]' + self.name.upper() + '[/B][/COLOR]',
'Resolving', 700, self.icon)
content = net.http_GET(url).content
new_url = re.search('streamContinueButton.+?href="(.+?)"', content,re.I)
from entertainment import istream
html = net.http_GET(new_url.group(1)).content
r = re.search(r'<iframe\s*src="(.+?)"\s*allowfullscreen',html,re.I|re.DOTALL)
if r:
play_url = istream.ResolveUrl(r.group(1))
return play_url
except Exception, e:
common.addon.log(self.name.upper() + ' - Exception occured: %s' % e)
common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: [B][COLOR white]' + self.name.upper() + '[/B][/COLOR]', '[COLOR red]'+str(e)+'[/COLOR]', 700, self.icon)
return None
示例4: ExtractContentAndAddtoList
def ExtractContentAndAddtoList(self, indexer, section, url, type, list, page='', total_pages='', sort_by='', sort_order=''):
import urllib
if section != 'search':
url = urllib.unquote_plus(url)
new_url = url
if not new_url.startswith(self.base_url):
new_url = re.sub("http\://.*?/", self.base_url, url)
if page == '':
page = '1'
from entertainment.net import Net
cached = False if section == 'watchlist' else True
net = Net(cached=cached)
content = net.http_GET(new_url + '/page/' + page).content
if total_pages == '' :
re_page = '<span class=[\'"]{1}pages[\'"]{1}>Page 1 of ([0-9]+)</span>' #'<a class=[\'"]{1}last[\'"]{1}.+?([0-9]+)[\'"]{1}'
total_pages = re.search(re_page, content)
if total_pages:
total_pages = total_pages.group(1)
else:
if re.search('0 items found', content):
page = '0'
total_pages = '0'
else:
page = '1'
total_pages = '1'
self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order)
item_re = r'(?s)<div class=[\'"]{1}inner[\'"]{1}>.+?<a href=[\'"]{1}(.+?)[\'"]{1}.+?<img src=[\'"]{1}(.+?)[\'"]{1} alt=[\'"]{1}(.+?)[\'"]{1}.+?<p>(.+?)<'
for item in re.finditer(item_re, content):
item_url = item.group(1)
item_img = item.group(2)
item_alt = item.group(3)
item_name = re.sub('\([0-9]+\).*', '', item_alt)
item_year = re.search("\(([0-9]+)", item_alt)
if item_year:
item_year = item_year.group(1)
item_title = item_name + ' (' + item_year + ')'
else:
item_year = ''
item_title = item_name
if total_pages == '':
total_pages = '1'
item_plot = re.sub('^\s', '', common.CleanText(item.group(4), True, True) )
self.AddContent(list, indexer, common.mode_File_Hosts, item_title, '', type, url=item_url, name=item_name, year=item_year, img=item_img, plot=item_plot)
示例5: ResolveLive
def ResolveLive(self, content, url):
import re
new_content = re.search('src=[\'"]{1}http://liveall\.tv/player\.php\?streampage=(.+?)[&\'"]{1}', content)
if new_content:
page_url = 'http://liveall.tv/player.php?streampage=%s' % new_content.group(1)
from entertainment.net import Net
net = Net()
content = net.http_GET( page_url, headers={'Referer':url} ).content
var_a = int(re.search('var a = ([0-9]*);', content).group(1))
var_b = int(re.search('var b = ([0-9]*);', content).group(1))
var_c = int(re.search('var c = ([0-9]*);', content).group(1))
var_d = int(re.search('var d = ([0-9]*);', content).group(1))
var_f = int(re.search('var f = ([0-9]*);', content).group(1))
var_v_part = re.search('var v_part = [\'"]{1}(.+?)[\'"]{1};', content).group(1)
swf_url = 'http://wds.liveall.tv/jwplayer.flash.swf'
#playpath = play_media.group(2)
streamer = 'rtmp://%s.%s.%s.%s%s' % ( str(var_a/var_f), str(var_b/var_f), str(var_c/var_f), str(var_d/var_f), var_v_part )
''' playpath=' + playpath + '''
content = streamer + ' swfUrl=' + swf_url + ' pageUrl=' + page_url + ' timeout=15 live=1'
return (True, True, content, url)
return (False, False, content, url)
示例6: GetFileHosts
def GetFileHosts(self, url, list, lock, message_queue):
import re,urllib
from entertainment.net import Net
net = Net(user_agent='Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5')
loginurl = 'https://m.genvideos.org/video_info/html5'
v=url.split('v=')[1]
data={'v': v}
headers = {'host': 'm.genvideos.org','origin':'https://m.genvideos.org', 'referer': url,
'user-agent':'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5','x-requested-with':'XMLHttpRequest'}
first= net.http_POST(loginurl,data,headers).content
import json
link= json.loads(first)
for j in link:
quality = j.upper()
if '360P' in quality:
quality='SD'
THEURL = urllib.unquote(link[j][3])+'**'+url
self.AddFileHost(list, quality, THEURL,host='GOOGLEVIDEO.COM')
示例7: GetFileHostsForContent
def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):
import urllib2
import re
from entertainment.net import Net
net = Net()
title = self.CleanTextForSearch(title)
name = self.CleanTextForSearch(name)
season_pull = "0%s"%season if len(season)<2 else season
episode_pull = "0%s"%episode if len(episode)<2 else episode
tv_url='http://www.myvideolinks.eu/index.php?s=%s+S%sE%s' %(name.replace(' ','+'),season_pull,episode_pull)
movie_url='http://www.myvideolinks.eu/index.php?s=%s+%s' %(name.replace(' ','+'),year)
if type == 'movies':
html = net.http_GET(movie_url).content
for item in re.finditer(r'<h4><a href="(.+?)" rel="bookmark"',html,re.I):
url = item.group(1)
self.GetFileHosts(url, list, lock, message_queue)
elif type == 'tv_episodes':
html = net.http_GET(tv_url).content
for item in re.finditer(r'<h4><a href="(.+?)" rel="bookmark"',html,re.I):
url = item.group(1)
self.GetFileHosts(url, list, lock, message_queue)
示例8: Resolve
def Resolve(self, url):
import re
from entertainment.net import Net
net = Net(user_agent=self.UA)
url=url.replace('muchmovies.org','umovies.me')
try:
net.set_cookies(self.cookie_file)
content = net.http_GET(url).content
print '##########################'
print 'NET'
except:
from entertainment import cloudflare
content=cloudflare.solve(url,self.cookie_file,self.UA)
content = content.replace('\n','')
link=content.split('href=')
for p in link:
if '.mp4' in p:
resolved_media_url = re.compile('"(.+?)"').findall(p)[0]
host =resolved_media_url.split('//')[1]
host = host.split('/')[0]
cookie =open(self.cookie_file).read()
__cfduid =re.compile('__cfduid=(.+?);').findall(cookie)[0]
cf_clearance =re.compile('cf_clearance="(.+?)"').findall(cookie)[0]
COOKIE = '__cfduid=%s; cf_clearance=%s' % (__cfduid,cf_clearance)
resolved_media_url = resolved_media_url+'|User-Agent='+self.UA+'&Referrer='+url+'&host='+host+'&Cookie='+COOKIE
print resolved_media_url
return resolved_media_url
示例9: Handle
def Handle(self, url, html, params=None):
import re
recaptcha = re.search('<script type=[\'"]{1}text/javascript[\'"]{1} src=[\'"]{1}(http://www.google.com/recaptcha/api/.+?)[\'"]{1}', html)
if recaptcha:
recaptcha = recaptcha.group(1)
from entertainment.net import Net
net = Net(cached=False)
if 'recaptcha_ajax' in recaptcha:
import random
recaptcha = 'http://www.google.com/recaptcha/api/challenge?k=%s&ajax=1&cachestop=%s' % ( params['site'], str(random.random()) )
html = net.http_GET( recaptcha ).content
import re
hugekey=re.search('challenge \: [\'"]{1}(.+?)[\'"]{1}', html).group(1)
solution = self.Solve(net.http_GET("http://www.google.com/recaptcha/api/image?c=%s" % hugekey ).content)
if solution:
return {'status':'ok', 'captcha_type':self.name, 'challenge':hugekey, 'captcha':solution, 'recaptcha_challenge_field': hugekey,'recaptcha_response_field': solution}
else:
return {'status':'error', 'message':'Image-Text not entered', 'captcha_type':self.name}
return None
示例10: GetFileHosts
def GetFileHosts(self, id, other_names, region, language, list, lock, message_queue):
from entertainment.net import Net
net = Net()
clean_id= id.replace('_',' ').lower()
for blogs in self.BLOG:
import re
r = self.base_url % blogs
content = net.http_GET(r).content
POSTER=re.compile('<poster>(.+?)</poster>').findall(content)[0]
match=re.compile('<title>(.+?)</title>.+?link>(.+?)</',re.DOTALL).findall(content)
for name, RTMP in match:
if clean_id.replace(' ','') in name.replace(' ','').lower():
self.AddLiveLink( list, name, RTMP, host=POSTER)
示例11: GetFileHostsForContent
def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):
from entertainment.net import Net
net = Net(user_agent=self.UA)
title = self.CleanTextForSearch(title)
name = self.CleanTextForSearch(name)
search_term = name.replace(' ','-')+'-'+year
import re
url='http://umovies.me/search/'+search_term
try:
net.set_cookies(self.cookie_file)
link = net.http_GET(url).content
print '##########################'
print 'NET'
except:
from entertainment import cloudflare
link = cloudflare.solve(url,self.cookie_file,self.UA)
match = re.compile('lass="movies list inset">.+?href="(.+?)">.+?class="label">(.+?)<',re.DOTALL).findall(link)
for movie_url, TITLE in match:
if year in TITLE:
self.GetFileHosts('http://umovies.me'+movie_url, list, lock, message_queue)
示例12: GetFileHostsForContent
def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):
from entertainment.net import Net
import re,json
net = Net(cached=False,user_agent='Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5')
name = self.CleanTextForSearch(name)
main_url= self.API+'type=search&os=Android&v=2.0.1&k=0&keyword=%s' %(name.replace(' ','+'))
content=net.http_GET(main_url).content
import json
link=json.loads(content)
data=link['data']
for field in data['films']:
NAME=field['title'].encode('utf8')
item_url=str(field['id'])
if NAME==name:
self.GetFileHosts(item_url, list, lock, message_queue,season,episode)
示例13: GetFileHosts
def GetFileHosts(self, id, other_names, region, language, list, lock, message_queue):
from entertainment.net import Net
import re
net = Net(cached=False)
stream_id = id.replace('_','').lower()
NEW_URL= "http://d3gbuig838qdtm.cloudfront.net/json/tvp/channels.json"
html = net.http_GET(NEW_URL).content
import json
link=json.loads(html)
data=link['data']
for field in data:
name= field['channel']['name'].encode("utf-8")
url=field['channel']['id']
if stream_id in name.replace(' ','').lower():
self.AddLiveLink( list, id.replace('_',' ').upper(), url, language = language.title(),host= 'TVPLAYER',quality='HD')
示例14: GetFileHosts
def GetFileHosts(self, url, list, lock, message_queue):
from entertainment.net import Net
net = Net(do_not_cache_if_any=do_no_cache_keywords_list)
custom_url = self.get_url()
if self.Settings().get_setting("proxy") == "true":
import socks
(proxy, port) = self.get_proxy()
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, proxy, port)
net.set_socket_class(socks.socksocket)
content = common.unescape(common.str_conv(net.http_GET(url).content))
import re
for sq in re.finditer(r"<span class=quality_(.+?)>.+?<a href=\".+?external.+?url=(.+?)&", content):
quality = sq.group(1).upper()
if quality == "UNKNOWN":
continue
import base64
host_url = base64.b64decode(sq.group(2))
if not "affbuzz" in host_url.lower():
self.AddFileHost(list, quality, host_url)
示例15: ResolveLive
def ResolveLive(self, content, url):
import re
new_content = re.search("<script.+?id=[\"'](.+?)[\"'].+?src=[\"']http://embeds\.coolsport\.tv/(.+?)\.js[\"']", content)
if new_content:
headers = {'Referer':url}
page_url = 'http://embeds.coolsport.tv/' + new_content.group(2) + '.php?id=' + new_content.group(1)
from entertainment.net import Net
net = Net()
content = net.http_GET( page_url, headers=headers ).content
return (False, True, content, page_url)
new_content = re.search("<iframe.+?src=[\"'](http://www.coolsport.tv/.+?)[\"']", content)
if new_content:
page_url = new_content.group(1)
from entertainment.net import Net
net = Net()
content = net.http_GET( page_url, headers={'Referer':url} ).content
new_content = re.search("<script.+?id=[\"'](.+?)[\"'].+?src=[\"']http://embeds\.coolsport\.tv/(.+?)\.js[\"']", content)
headers = {'Referer':page_url}
page_url = 'http://embeds.coolsport.tv/' + new_content.group(2) + '.php?id=' + new_content.group(1)
content = net.http_GET( page_url, headers=headers ).content
return (False, True, content, page_url)
return (False, False, content, url)