MCPcopy Create free account
hub / github.com/Jack-Cherish/python-spider / __init__

Method __init__

Netease/Netease.py:61–77  ·  view source on GitHub ↗
(self, timeout=60, cookie_path='.')

Source from the content-addressed store, hash-verified

59 网易云爬取API
60 """
61 def __init__(self, timeout=60, cookie_path='.'):
62 self.headers = {
63 'Accept': '*/*',
64 'Accept-Encoding': 'gzip,deflate,sdch',
65 'Accept-Language': 'zh-CN,zh;q=0.8,gl;q=0.6,zh-TW;q=0.4',
66 'Connection': 'keep-alive',
67 'Content-Type': 'application/x-www-form-urlencoded',
68 'Host': 'music.163.com',
69 'Referer': 'http://music.163.com/search/',
70 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'
71 }
72 self.session = requests.Session()
73 self.session.headers.update(self.headers)
74 self.session.cookies = cookiejar.LWPCookieJar(cookie_path)
75 self.download_session = requests.Session()
76 self.timeout = timeout
77 self.ep = Encrypyed()
78
79 def post_request(self, url, params):
80 """

Callers

nothing calls this directly

Calls 1

EncrypyedClass · 0.85

Tested by

no test coverage detected