Skip to content

Commit

Permalink
pref: 小优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
sinspired committed Nov 29, 2024
1 parent c65c2e6 commit c19e85e
Show file tree
Hide file tree
Showing 6 changed files with 227 additions and 315 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/update_hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
paths:
- 'setHosts.py'
- 'setHosts_Classic.py'
- 'requirements.txt'
schedule:
- cron: '0 */4 * * *'
Expand All @@ -21,6 +22,9 @@ jobs:
cancel-in-progress: true

steps:
- name: Wait for synchronization
run: sleep 10

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand All @@ -39,13 +43,13 @@ jobs:
- name: Run hosts update script
run: |
sudo python setHosts_Classic.py
sudo python setHosts.py
# 提交并推送更新(仅在文件变更时)
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5
uses: EndBug/add-and-commit@v9
with:
commit_message: "chore: update hosts"
file_pattern: '.'
commit_user_name: action_bot
commit_user_email: [email protected]
push_options: '--force'
message: "Update servers list"
add: |
hosts
README.md
115 changes: 58 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,79 +29,80 @@
#### 1.2.1 复制下面的内容

```bash

# cnNetTool Start in 2024-11-29 19:31:56 +08:00
140.82.112.26 alive.github.com
20.205.243.168 api.github.com
140.82.113.21 central.github.com
140.82.113.22 central.github.com
20.205.243.165 codeload.github.com
140.82.113.22 collector.github.com
140.82.112.21 collector.github.com
140.82.112.3 gist.github.com
20.205.243.166 github.com
140.82.113.17 github.community
151.101.129.194 github.global.ssl.fastly.net
16.182.106.193 github-com.s3.amazonaws.com
52.216.208.105 github-production-release-asset-2e65be.s3.amazonaws.com
140.82.112.25 live.github.com
140.82.113.3 github.com
140.82.112.18 github.community
151.101.65.194 github.global.ssl.fastly.net
52.216.32.129 github-com.s3.amazonaws.com
52.217.96.236 github-production-release-asset-2e65be.s3.amazonaws.com
140.82.114.25 live.github.com
13.107.42.16 pipelines.actions.githubusercontent.com
185.199.110.154 github.githubassets.com
185.199.109.153 github.io
185.199.109.153 githubstatus.com
185.199.109.153 assets-cdn.github.com
185.199.109.133 avatars.githubusercontent.com
185.199.109.133 avatars0.githubusercontent.com
185.199.109.133 avatars1.githubusercontent.com
185.199.109.133 avatars2.githubusercontent.com
185.199.109.133 avatars3.githubusercontent.com
185.199.109.133 avatars4.githubusercontent.com
185.199.109.133 avatars5.githubusercontent.com
185.199.109.133 camo.githubusercontent.com
185.199.109.133 cloud.githubusercontent.com
185.199.109.133 desktop.githubusercontent.com
185.199.109.133 favicons.githubusercontent.com
185.199.109.133 github.map.fastly.net
185.199.109.133 media.githubusercontent.com
185.199.109.133 objects.githubusercontent.com
185.199.109.133 private-user-images.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.109.133 user-images.githubusercontent.com
13.227.62.55 tmdb.org
13.227.62.55 api.tmdb.org
13.227.62.55 files.tmdb.org
52.85.151.24 themoviedb.org
52.85.151.24 api.themoviedb.org
52.85.151.24 www.themoviedb.org
52.85.151.24 auth.themoviedb.org
185.199.111.153 github.io
185.199.111.153 githubstatus.com
185.199.111.153 assets-cdn.github.com
185.199.108.133 avatars.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.108.133 avatars1.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
185.199.108.133 avatars3.githubusercontent.com
185.199.108.133 avatars4.githubusercontent.com
185.199.108.133 avatars5.githubusercontent.com
185.199.108.133 camo.githubusercontent.com
185.199.108.133 cloud.githubusercontent.com
185.199.108.133 desktop.githubusercontent.com
185.199.108.133 favicons.githubusercontent.com
185.199.108.133 github.map.fastly.net
185.199.108.133 media.githubusercontent.com
185.199.108.133 objects.githubusercontent.com
185.199.108.133 private-user-images.githubusercontent.com
185.199.108.133 raw.githubusercontent.com
185.199.108.133 user-images.githubusercontent.com
13.225.183.95 tmdb.org
13.225.183.95 api.tmdb.org
13.225.183.95 files.tmdb.org
52.85.151.48 themoviedb.org
52.85.151.48 api.themoviedb.org
52.85.151.48 www.themoviedb.org
52.85.151.48 auth.themoviedb.org
169.150.236.100 image.tmdb.org
169.150.236.100 images.tmdb.org
52.94.225.248 imdb.com
18.67.61.135 www.imdb.com
52.94.225.248 secure.imdb.com
18.67.61.135 s.media-imdb.com
52.94.228.167 secure.imdb.com
18.67.59.121 s.media-imdb.com
52.94.225.248 us.dd.imdb.com
18.67.61.135 www.imdb.to
52.94.225.248 imdb-webservice.amazon.com
98.82.158.179 origin-www.imdb.com
151.101.129.16 m.media-amazon.com
151.101.193.16 Images-na.ssl-images-amazon.com
3.171.83.185 images-fe.ssl-images-amazon.com
18.154.229.206 images-eu.ssl-images-amazon.com
18.172.46.173 www.imdb.to
52.94.228.167 imdb-webservice.amazon.com
44.215.137.99 origin-www.imdb.com
151.101.193.16 m.media-amazon.com
65.9.39.29 Images-na.ssl-images-amazon.com
146.75.93.16 images-fe.ssl-images-amazon.com
18.172.38.138 images-eu.ssl-images-amazon.com
173.223.163.218 ia.media-imdb.com
151.101.197.16 f.media-amazon.com
18.67.76.111 imdb-video.media-imdb.com
18.67.66.59 dqpnq362acqdi.cloudfront.net
216.58.200.10 translate.google.com
216.58.200.10 translate.googleapis.com
216.58.200.10 translate-pa.googleapis.com
18.65.168.86 plugins.jetbrains.com
18.65.168.86 download.jetbrains.com
18.65.168.86 cache-redirector.jetbrains.com

# Update time: 2024-11-29 17:20:51 +08:00
151.101.189.16 f.media-amazon.com
3.166.216.19 imdb-video.media-imdb.com
18.67.66.215 dqpnq362acqdi.cloudfront.net
172.217.31.136 translate.google.com
172.217.31.136 translate.googleapis.com
172.217.31.136 translate-pa.googleapis.com
18.65.168.59 plugins.jetbrains.com
18.65.168.59 download.jetbrains.com
18.65.168.59 cache-redirector.jetbrains.com

# Update time: 2024-11-29 19:31:56 +08:00
# GitHub仓库: https://github.com/sinspired/cnNetTool
# cnNetTool End

```

以上内容会自动定时更新, 数据更新时间:2024-11-29 17:20:51 +08:00
以上内容会自动定时更新, 数据更新时间:2024-11-29 19:31:56 +08:00

#### 1.2.2 修改 hosts 文件

Expand Down
111 changes: 56 additions & 55 deletions hosts
Original file line number Diff line number Diff line change
@@ -1,69 +1,70 @@

# cnNetTool Start in 2024-11-29 19:31:56 +08:00
140.82.112.26 alive.github.com
20.205.243.168 api.github.com
140.82.113.21 central.github.com
140.82.113.22 central.github.com
20.205.243.165 codeload.github.com
140.82.113.22 collector.github.com
140.82.112.21 collector.github.com
140.82.112.3 gist.github.com
20.205.243.166 github.com
140.82.113.17 github.community
151.101.129.194 github.global.ssl.fastly.net
16.182.106.193 github-com.s3.amazonaws.com
52.216.208.105 github-production-release-asset-2e65be.s3.amazonaws.com
140.82.112.25 live.github.com
140.82.113.3 github.com
140.82.112.18 github.community
151.101.65.194 github.global.ssl.fastly.net
52.216.32.129 github-com.s3.amazonaws.com
52.217.96.236 github-production-release-asset-2e65be.s3.amazonaws.com
140.82.114.25 live.github.com
13.107.42.16 pipelines.actions.githubusercontent.com
185.199.110.154 github.githubassets.com
185.199.109.153 github.io
185.199.109.153 githubstatus.com
185.199.109.153 assets-cdn.github.com
185.199.109.133 avatars.githubusercontent.com
185.199.109.133 avatars0.githubusercontent.com
185.199.109.133 avatars1.githubusercontent.com
185.199.109.133 avatars2.githubusercontent.com
185.199.109.133 avatars3.githubusercontent.com
185.199.109.133 avatars4.githubusercontent.com
185.199.109.133 avatars5.githubusercontent.com
185.199.109.133 camo.githubusercontent.com
185.199.109.133 cloud.githubusercontent.com
185.199.109.133 desktop.githubusercontent.com
185.199.109.133 favicons.githubusercontent.com
185.199.109.133 github.map.fastly.net
185.199.109.133 media.githubusercontent.com
185.199.109.133 objects.githubusercontent.com
185.199.109.133 private-user-images.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.109.133 user-images.githubusercontent.com
13.227.62.55 tmdb.org
13.227.62.55 api.tmdb.org
13.227.62.55 files.tmdb.org
52.85.151.24 themoviedb.org
52.85.151.24 api.themoviedb.org
52.85.151.24 www.themoviedb.org
52.85.151.24 auth.themoviedb.org
185.199.111.153 github.io
185.199.111.153 githubstatus.com
185.199.111.153 assets-cdn.github.com
185.199.108.133 avatars.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.108.133 avatars1.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
185.199.108.133 avatars3.githubusercontent.com
185.199.108.133 avatars4.githubusercontent.com
185.199.108.133 avatars5.githubusercontent.com
185.199.108.133 camo.githubusercontent.com
185.199.108.133 cloud.githubusercontent.com
185.199.108.133 desktop.githubusercontent.com
185.199.108.133 favicons.githubusercontent.com
185.199.108.133 github.map.fastly.net
185.199.108.133 media.githubusercontent.com
185.199.108.133 objects.githubusercontent.com
185.199.108.133 private-user-images.githubusercontent.com
185.199.108.133 raw.githubusercontent.com
185.199.108.133 user-images.githubusercontent.com
13.225.183.95 tmdb.org
13.225.183.95 api.tmdb.org
13.225.183.95 files.tmdb.org
52.85.151.48 themoviedb.org
52.85.151.48 api.themoviedb.org
52.85.151.48 www.themoviedb.org
52.85.151.48 auth.themoviedb.org
169.150.236.100 image.tmdb.org
169.150.236.100 images.tmdb.org
52.94.225.248 imdb.com
18.67.61.135 www.imdb.com
52.94.225.248 secure.imdb.com
18.67.61.135 s.media-imdb.com
52.94.228.167 secure.imdb.com
18.67.59.121 s.media-imdb.com
52.94.225.248 us.dd.imdb.com
18.67.61.135 www.imdb.to
52.94.225.248 imdb-webservice.amazon.com
98.82.158.179 origin-www.imdb.com
151.101.129.16 m.media-amazon.com
151.101.193.16 Images-na.ssl-images-amazon.com
3.171.83.185 images-fe.ssl-images-amazon.com
18.154.229.206 images-eu.ssl-images-amazon.com
18.172.46.173 www.imdb.to
52.94.228.167 imdb-webservice.amazon.com
44.215.137.99 origin-www.imdb.com
151.101.193.16 m.media-amazon.com
65.9.39.29 Images-na.ssl-images-amazon.com
146.75.93.16 images-fe.ssl-images-amazon.com
18.172.38.138 images-eu.ssl-images-amazon.com
173.223.163.218 ia.media-imdb.com
151.101.197.16 f.media-amazon.com
18.67.76.111 imdb-video.media-imdb.com
18.67.66.59 dqpnq362acqdi.cloudfront.net
216.58.200.10 translate.google.com
216.58.200.10 translate.googleapis.com
216.58.200.10 translate-pa.googleapis.com
18.65.168.86 plugins.jetbrains.com
18.65.168.86 download.jetbrains.com
18.65.168.86 cache-redirector.jetbrains.com
151.101.189.16 f.media-amazon.com
3.166.216.19 imdb-video.media-imdb.com
18.67.66.215 dqpnq362acqdi.cloudfront.net
172.217.31.136 translate.google.com
172.217.31.136 translate.googleapis.com
172.217.31.136 translate-pa.googleapis.com
18.65.168.59 plugins.jetbrains.com
18.65.168.59 download.jetbrains.com
18.65.168.59 cache-redirector.jetbrains.com

# Update time: 2024-11-29 17:20:51 +08:00
# Update time: 2024-11-29 19:31:56 +08:00
# GitHub²Ö¿â: https://github.com/sinspired/cnNetTool
# cnNetTool End
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
aiohttp==3.10.10
aiohttp==3.11.7
dnspython==2.7.0
prettytable==3.12.0
rich==13.9.4
Expand Down
Loading

0 comments on commit c19e85e

Please sign in to comment.