V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Diphia
V2EX  ›  macOS

macOS 下如何设置 Python 脚本为 magnet link 的打开方式?

  •  
  •   Diphia · Apr 16, 2022 · 1666 views
    This topic created in 1476 days ago, the information mentioned may be changed or developed.

    在浏览器中点击一个 magnet link 时,会使用一个设置的默认程序去打开,比如如果本地装了 qbittorrent ,会直接传给 qbittorrent 去处理。

    我现在写了一个 Python 脚本 magnet-handler.py ,传入参数是一个 magnet link ,然后会 POST 给一台服务器上的 qbittorrent 的 API ,进行下载。

    但是我要如何在 macOS 中设置这个 Python 脚本为默认启动程序呢?直接指定是不行的,是一定要通过一层 Apple Script 之类的吗?甚至是变成一个 .app ?

    2 replies    2022-04-17 01:17:38 +08:00
    Diphia
        2
    Diphia  
    OP
       Apr 17, 2022
    @Chihaya0824 感谢!搞定了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2494 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 226ms · UTC 12:16 · PVG 20:16 · LAX 05:16 · JFK 08:16
    ♥ Do have faith in what you're doing.