V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
pureGirl
V2EX  ›  程序员

有什么能稳定从 ftp 下载文件不会出现断连等报错的好方法吗

  •  
  •   pureGirl · Apr 25, 2025 · 2358 views
    This topic created in 369 days ago, the information mentioned may be changed or developed.
    现在后台的定时 ftp 下载程序动不动就失败,用的是 ftplib 这个库,感觉一点都不好用
    11 replies    2025-04-26 16:38:52 +08:00
    dode
        1
    dode  
       Apr 25, 2025
    断点续传功能
    lisxour
        2
    lisxour  
       Apr 25, 2025
    断了就重连呗
    luciferlulu
        3
    luciferlulu  
       Apr 25, 2025
    ftp 已经被淘汰了啊 不安全也不稳定
    tf2
        4
    tf2  
       Apr 25, 2025
    while True:
    RangerWolf
        5
    RangerWolf  
       Apr 25, 2025
    我感觉 ftp 挺麻烦的 ,还不如 https 的文件服务器
    cheng6563
        6
    cheng6563  
       Apr 25, 2025   ❤️ 1
    ftp 诞生得比 tcp 早,运行在 tcp 下本来就非常别扭。
    ETiV
        7
    ETiV  
       Apr 25, 2025 via iPhone
    curl 也支持 ftp 协议
    sn0wdr1am
        8
    sn0wdr1am  
       Apr 25, 2025
    通过 ssh 支持 sftp 协议
    EchoGroot
        9
    EchoGroot  
       Apr 26, 2025
    wget 支持 ftp ,支持断点续传
    Syiize
        10
    Syiize  
       Apr 26, 2025 via Android
    如果你是用的 Python ,可以参考我这个包里的实现,使用了 pycurl 来下载 ftp 文件。多进程下载有自动重连,不过单进程下载我好像没写重连的功能。

    https://github.com/Syize/seafog/blob/master/seafog/utils.py#L186
    Syiize
        11
    Syiize  
       Apr 26, 2025 via Android
    @Syiize 单进程也有重连,记错了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   938 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 20:32 · PVG 04:32 · LAX 13:32 · JFK 16:32
    ♥ Do have faith in what you're doing.