URL检测小工具
本文最后更新于 1574 天前,其中的信息可能已经有所发展或是发生改变。

本工具依赖Python Requests库,在Python 3版本中运行

我的博客首页有非常多的图片,而这些图片所对应的URL并不是全部都可以访问的,有部分文件已经无法使用了,在首页会以空白的形式显示,非常的丑。

在网上找了很多现成的脚本,都不能非常好的完成我的需求,仔细想了想,这个需求也不难,于是自己手写了一下。

然后就死循环了,怎么救都救不了,最后在好兄弟 Akibaso的帮助下搞定

import requests
import os

urlin = open("url-in.txt")
urlin = str(urlin.read())
urllist = urlin.split()
outurl = []
times = 0
num = len(urllist) -1

def check(url):
    try:
        request = requests.get(url)
        status = request.status_code
    except:
        print('error')
        status=114514
    if status != 200:
        return url
    else:
        return 200

for url in urllist:
    i = check(url)
    if i == 200:
        outurl.append(url)

try:
    os.remove("url-out.txt")
    outfile = open("url-out.txt",mode="w")
except:
    outfile = open("url-out.txt",mode="w")

for i in outurl:
    outfile.write(str(i)+"\n")
outfile.close()
print('ok')

本工具可以批量区分大量链接中正常的链接和不能正常使用的链接

将要检测的URL写入进 url-in.txt 然后运行即可

URL写入示范

一行一个
https://lo-li.icu
https://lo-li.icu/404
https://cloudflare.com

输出文件 url-out.txt 中会输出返回200的URL,一行一个

GitHub: FutureApple/url-check

评论

  1. 6 天前
    2026-11-19 20:13:20

    I used to bounce around slow sites but 21jl runs like a well tuned engine. Every game loads instantly on my phone and the layout is clean enough to not overwhelm my eyes. Fair play here is not just a promise but a daily habit. I finally found a spot that respects my time. 21jl

  2. 1 周前
    2026-11-16 12:10:24

    [9701]Fun88 | Link Vào Chính Thức – Hướng Dẫn Chơi Baccarat Online,Fun88 cung cấp link truy cập chính thức và hướng dẫn tải app APK nhanh chóng. Tìm hiểu luật chơi xóc đĩa và nạp tiền casino qua Momo tiện lợi. Tham gia ngay hôm nay! visit: fun88

  3. 1 周前
    2026-11-16 4:02:36

    [5453]7j777 লগইন করুন – অ্যান্ড্রয়েড অ্যাপ এবং অনলাইন স্লট গেম,7j777 লগইন করুন এবং অনলাইন স্লট গেম নিয়ম বুঝে খেলা শুরু করুন। বিকাশ দিয়ে ক্যাসিনো ডিপোজিট ও অ্যান্ড্রয়েড ক্যাসিনো অ্যাপ ডাউনলোড করে আজই যুক্ত হন। visit: 7j777

  4. 2 周前
    2026-11-14 1:15:54

    [8450]GK99: অনলাইন ক্যাসিনো সাইট – অ্যাপ ডাউনলোড,GK99 বাংলাদেশের খেলোয়াড়দের জন্য একটি অনলাইন গ্যাম্বলিং সাইট যেখানে আপনি লগইন এবং অ্যাকাউন্ট খোলার পাশাপাশি অ্যাপ ডাউনলোড করতে পারেন, এবং ক্যাটাগরি অনুযায়ী গেমগুলো ব্রাউজ করে FAQ চেক করতে পারেন। visit: gk99

  5. 2 周前
    2026-11-11 7:57:51

    Finally found a site that doesn’t lag during peak hours. The graphics are crisp and the bonuses are generous. Give kr12kr333 a try, you wont regret it.

  6. 2 周前
    2026-11-11 6:34:52

    Really impressed with the resources available here. It is clear that the team knows what they are doing. I’m learning a lot thanks to phearnphp.

  7. 2 周前
    2026-11-11 0:34:02

    The customer support team is top notch. I had a small issue with my deposit and they fixed it within minutes. 9gldcasino is definitely my new favorite go-to.

  8. 2 周前
    2026-11-08 21:06:30

    I’ve been looking for a reliable spot and this one really delivers. The interface is smooth and the payouts are fast. Definitely worth checking out clubpkrvip

  9. 3 周前
    2026-11-06 17:50:54

    [518]mxbigwin77 Login Oficial | Slots en Línea y Pagos con OXXO,mxbigwin77 es tu portal de juegos. Descarga la APK para jugar las mejores slots y aprende las reglas de ruleta con depósitos fáciles vía OXXO. ¡Regístrate hoy! visit: mxbigwin77

  10. 3 周前
    2026-11-04 23:06:19

    I’ve tried a few sites lately but this one feels different. The loading speed is great and the interface is super intuitive. Definitely my new go-to spot! club789beat

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇