Skip to content

Commit

Permalink
修改逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
abcfy2 committed Sep 20, 2014
1 parent 941fe26 commit 2ab088b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__pycache__
.*
!.gitignore
2 changes: 1 addition & 1 deletion getComic-gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def anaysisURL(self):

except getComic.ErrorCode as e:
if e.code == 2:
self.statusLabel.setText('<font color="red">无法跳转为移动端URL,请使用http://m.ac.qq.com</font>')
self.statusLabel.setText('<font color="red">无法跳转为移动端URL,请进入http://m.ac.qq.com找到该漫画地址</font>')

except KeyError:
self.statusLabel.setText('<font color="red">不存在的地址</font>')
Expand Down
6 changes: 3 additions & 3 deletions getComic.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ def getId(url):
if not numRE.search(url):
get_id_request = requestSession.get(url)
url = get_id_request.url
if not isLegelUrl(url):
id = numRE.findall(url)
if not isLegelUrl(url) or not id:
print('无法自动跳转移动端URL,请进入http://m.ac.qq.com,找到'
'该漫画地址。\n'
'地址应该像这样: '
'http://m.ac.qq.com/Comic/comicInfo/id/xxxxx (xxxxx为整数)')
raise ErrorCode(2)

id = numRE.findall(url)[0]

return id
return id[0]

def getContent(id):
getComicInfoUrl = 'http://m.ac.qq.com/GetData/getComicInfo?id={}'.format(id)
Expand Down

0 comments on commit 2ab088b

Please sign in to comment.