本文整理汇总了Python中entertainment.net.Net.get_cookies方法的典型用法代码示例。如果您正苦于以下问题:Python Net.get_cookies方法的具体用法?Python Net.get_cookies怎么用?Python Net.get_cookies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entertainment.net.Net
的用法示例。
在下文中一共展示了Net.get_cookies方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GrabMailRu
# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import get_cookies [as 别名]
def GrabMailRu(self,url,list):
print 'RESOLVING VIDEO.MAIL.RU VIDEO API LINK'
from entertainment.net import Net
net = Net(cached=False)
import json,re
items = []
data = net.http_GET(url).content
cookie = net.get_cookies()
for x in cookie:
for y in cookie[x]:
for z in cookie[x][y]:
l= (cookie[x][y][z])
r = '"key":"(.+?)","url":"(.+?)"'
match = re.compile(r,re.DOTALL).findall(data)
for quality,stream in match:
test = str(l)
test = test.replace('<Cookie ','')
test = test.replace(' for .my.mail.ru/>','')
url=stream +'|Cookie='+test
QUALITY=quality.upper()
if '480' in QUALITY:
QUALITY = '720P'
self.AddFileHost(list, QUALITY, url,host='WATCH-TVSERIES.NET')
示例2: GrabMailRu
# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import get_cookies [as 别名]
def GrabMailRu(self,url,list):
print 'RESOLVING VIDEO.MAIL.RU VIDEO API LINK'
from entertainment.net import Net
net = Net(cached=False)
import json,re
items = []
data = net.http_GET(url).content
cookie = net.get_cookies()
for x in cookie:
if '.my.mail.ru' in x:
for y in cookie[x]:
for z in cookie[x][y]:
l= (cookie[x][y][z])
r = '"key":"(.+?)","url":"(.+?)"'
match = re.compile(r,re.DOTALL).findall(data)
for quality,stream in match:
test = str(l)
test = test.replace('<Cookie ','')
matcher =re.compile('for (.+?)>').findall(test)[0]
test = test.replace(' for '+matcher+'>','')
url=stream +'|Cookie='+test
Q=quality.upper()
if Q == '1080P':
Q ='1080P'
elif Q == '720P':
Q ='720P'
elif Q == '480P':
Q ='HD'
else:
Q ='SD'
self.AddFileHost(list, Q, url,host='MAIL.RU')