Skip to content

Commit 2ab088b

Browse files
committed
修改逻辑
1 parent 941fe26 commit 2ab088b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
__pycache__
2+
.*
3+
!.gitignore

getComic-gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def anaysisURL(self):
128128

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

133133
except KeyError:
134134
self.statusLabel.setText('<font color="red">不存在的地址</font>')

getComic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ def getId(url):
5050
if not numRE.search(url):
5151
get_id_request = requestSession.get(url)
5252
url = get_id_request.url
53-
if not isLegelUrl(url):
53+
id = numRE.findall(url)
54+
if not isLegelUrl(url) or not id:
5455
print('无法自动跳转移动端URL,请进入http://m.ac.qq.com,找到'
5556
'该漫画地址。\n'
5657
'地址应该像这样: '
5758
'http://m.ac.qq.com/Comic/comicInfo/id/xxxxx (xxxxx为整数)')
5859
raise ErrorCode(2)
5960

60-
id = numRE.findall(url)[0]
6161

62-
return id
62+
return id[0]
6363

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

0 commit comments

Comments
 (0)