Skip to content

Commit

Permalink
Fixed broken upload due to source page change (_parse_src_js_var)
Browse files Browse the repository at this point in the history
  • Loading branch information
shichao-an committed Apr 7, 2015
1 parent 83e091e commit c7ebc16
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

0.4.2 (2015-04-03)
------------------

- Fixed broken upload due to source page change (``_parse_src_js_var``)

0.4.1 (2015-04-03)
------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='115wangpan',
version='0.4.1',
version='0.4.2',
description="Unofficial Python API wrapper for 115.com",
long_description=open('README.rst').read(),
keywords='115 wangpan pan cloud lixian',
Expand Down
2 changes: 1 addition & 1 deletion u115/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def _parse_src_js_var(self, variable):
soup = BeautifulSoup(r.content)
scripts = [script.text for script in soup.find_all('script')]
text = '\n'.join(scripts)
pattern = "%s = (.*);" % (variable.upper())
pattern = "%s\s*=\s*(.*);" % (variable.upper())
m = re.search(pattern, text)
if not m:
msg = 'Cannot parse source JavaScript for %s.' % variable
Expand Down

0 comments on commit c7ebc16

Please sign in to comment.