Diphia
V2EX  ›  macOS

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

  •  
  •   Diphia · Apr 16, 2022 · 1713 views
    This topic created in 1497 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   ·   3000 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 09:25 · PVG 17:25 · LAX 02:25 · JFK 05:25
    ♥ Do have faith in what you're doing.