Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
Little modify
Browse files Browse the repository at this point in the history
  • Loading branch information
sdvcrx committed Sep 17, 2014
1 parent 9f4b617 commit 6e25ba7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bddown_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@
from util import convert_none, logger
from command.config import global_config

BAIDUPAN_SERVER = "http://pan.baidu.com/"
BAIDUPAN_SERVER = "http://pan.baidu.com/api/"


class Pan(object):
headers = {}
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)'
' Chrome/37.0.2062.120 Safari/537.36'
}

def __init__(self):
self.baiduid = ''
self.bduss = ''
self.bdstoken = ''
self.session = requests.Session()
self.cookies = self.session.cookies
self._load_cookies_from_file()

def _load_cookies_from_file(self):
"""Load cookies file if file exist."""
Expand Down Expand Up @@ -104,7 +108,7 @@ def verify_passwd(self, url, secret=None):
elif errno == -9:
raise VerificationError("提取密码错误\n")

def request(self, method='GET', base_url='', extra_params=None, post_data=None, **kwargs):
def _request(self, method='GET', base_url='', extra_params=None, post_data=None, **kwargs):
"""
Send a request based on template.
:param method: http method, GET or POST
Expand Down

0 comments on commit 6e25ba7

Please sign in to comment.