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

本工具依赖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. 2 周前
    2026-10-13 22:35:28

    I’ve been playing on 999baji for a bit now and I am really enjoying the selection. It seems like there’s always something new! 999baji

  2. 3 周前
    2026-10-05 22:24:33

    Finally found a site that doesn’t crash every five minutes. The interface is super user-friendly and the payouts feel fair. Highly recommend giving 65jililogin a try if you are into online gaming.

  3. 3 周前
    2026-10-04 0:07:41

    [3293]Kursi4d: Login Daftar Akun Slot Gacor Dana Tanpa Potongan,Kursi4d menyediakan akses login dan daftar akun mudah. Nikmati slot gacor dana tanpa potongan serta download apk slot terbaru sekarang juga. visit: kursi4d

  4. 4 周前
    2026-9-30 21:49:44

    I’ve suggested this site to all my friends. The odds are fair and the gameplay is exciting. idpasar123 is definitely my new favorite.

  5. 1 月前
    2026-9-22 16:22:21

    kv777casino! Gotta love the sound. It’s a fun site. Have you had a shot at kv777casino?

  6. 1 月前
    2026-9-20 12:54:30

    I had a great run last night! The games are fair and the atmosphere is exciting. Definitely spending more time on 7brwincom.

  7. 1 月前
    2026-9-17 9:40:22

    I’ve been looking for a reliable way to access my account and this site is super smooth. Everything loads fast and the login process is effortless. Highly recommend pk68viplogin for anyone who wants a hassle-free experience.

  8. 1 月前
    2026-9-13 0:20:10

    Finally found a place that actually pays out without a headache. The interface is very user-friendly and the games are top notch. Check out suksesjitulogin if you want a reliable experience.

  9. 2 月前
    2026-9-12 11:06:41

    Honestly, this is one of the most reliable platforms I have used in Bangladesh. The payout process is super fast and the games are top notch. Highly recommend bdjaya9bangladesh for anyone looking for a fair game.

  10. 2 月前
    2026-9-06 0:53:37

    I’ve tried a few sites lately, but the interface here is just so smooth. Really enjoying the gameplay so far. Definitely check out brwinpg if you want a reliable experience.

发送评论 编辑评论


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