Skip to content

Commit

Permalink
修复copymanga的链接(copymanga.com->copymanga.net)
Browse files Browse the repository at this point in the history
Url fix
  • Loading branch information
misaka10843 authored Feb 25, 2022
2 parents dc2d18f + b565eec commit 20f0593
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ copymanga网站的一个小爬虫,来使用python下载copymanga中的漫画
## 更新

### 重大更新:
2022/2/25:修复copymanga的url问题(copymanga.com似乎已经被弃用,已更换到copymanga.net)

2022/2/13:Github自动编译Windows EXE文件![actions](https://github.com/misaka10843/copymanga-download/actions/workflows/python-app-Windows.yml)

Expand Down
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def manga_search(manga_name):
headers = {}
headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36'
response = requests.get(
'https://api.copymanga.com/api/v3/search/comic?format=json&limit=20&offset=0&platform=3&q=%s' % manga_name, headers=headers)
'https://api.copymanga.net/api/v3/search/comic?format=json&limit=20&offset=0&platform=3&q=%s' % manga_name, headers=headers)
print("搜索完毕啦! \n")
# !简要判断是否服务器无法连接
if response.status_code == 200:
Expand Down Expand Up @@ -82,7 +82,7 @@ def manga_chapter_list():
headers = {}
headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36'
manga_chapter = requests.get(
'https://api.copymanga.com/api/v3/comic/%s/group/default/chapters?limit=500&offset=0&platform=3' % get_list_name, headers=headers)
'https://api.copymanga.net/api/v3/comic/%s/group/default/chapters?limit=500&offset=0&platform=3' % get_list_name, headers=headers)
# !简要判断是否服务器无法连接
if manga_chapter.status_code == 200:
# *将api解析成json
Expand Down Expand Up @@ -119,7 +119,7 @@ def manga_download():
headers = {}
headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36'
response = requests.get(
'https://api.copymanga.com/api/v3/comic/%s/chapter2/%s?platform=3' % (get_list_name, i["uuid"]), headers=headers)
'https://api.copymanga.net/api/v3/comic/%s/chapter2/%s?platform=3' % (get_list_name, i["uuid"]), headers=headers)
response = response.json()
j = 0
# *通过获取的数量来循环
Expand Down Expand Up @@ -155,7 +155,7 @@ def manga_download():
headers = {}
headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36'
response = requests.get(
'https://api.copymanga.com/api/v3/comic/%s/chapter2/%s?platform=3' % (get_list_name, manga_chapter_list["results"]["list"][startchapter_id]["uuid"]), headers=headers)
'https://api.copymanga.net/api/v3/comic/%s/chapter2/%s?platform=3' % (get_list_name, manga_chapter_list["results"]["list"][startchapter_id]["uuid"]), headers=headers)
response = response.json()
j = 0
# *通过获取的数量来循环
Expand Down Expand Up @@ -191,7 +191,7 @@ def manga_collection(offset):
headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36'
headers['authorization'] = authorization
response = requests.get(
'https://copymanga.com/api/v3/member/collect/comics?limit=50&offset={%s}&free_type=1&ordering=-datetime_modifier' % offset, headers=headers)
'https://copymanga.net/api/v3/member/collect/comics?limit=50&offset={%s}&free_type=1&ordering=-datetime_modifier' % offset, headers=headers)
print("搜索完毕啦! \n")
# !简要判断是否服务器无法连接
if response.status_code == 200:
Expand Down

0 comments on commit 20f0593

Please sign in to comment.