How to set magnet links to open in a CLI program?

(Running Kubuntu 19.10, Firefox 73.0.1, KDE Plasma 5.18.2)

Hi all,

I have recently discovered a CLI-program called peerflix that allows the user to stream torrents. For example the command: peerflix "[magnet link]" --vlc would open a magnet link for streaming in VLC.

Would there be any way to get this to automatically run when I click a magnet link in Firefox like how you could for a torrent client?

(i.e. getting it to run from this dialog)

the Launch image dialog

Thanks for any and all assistance!

EDIT: I installed peerflix with the command npm install -g peerflix. The source code is available on GitHub

3

1 Answer

As per the link DK Bose posted, I was able to get this working!

  1. Firstly, install vlc, xterm, python-libtorrent and wget:

    sudo apt-get install vlc xterm python-libtorrent wget

  2. To be able to open torrent files from Firefox and play them with VLC via Peerflix:

    wget -O /tmp/Torrent-Video-Player

    sudo install /tmp/Torrent-Video-Player /usr/local/bin/

    Then when you open your browser and click a torrent, select other and browse for /usr/local/bin/Torrent-Video-Player

  3. To get magnet links to work:

    wget -O /tmp/Magnet_To_Torrent2.py

    sudo install /tmp/Magnet_To_Torrent2.py /usr/local/bin/

    wget -O /tmp/Magnet-Video-Player

    sudo install /tmp/Magnet-Video-Player /usr/local/bin/

    Then when you open your browser and click a magnet link, select other and browse for /usr/local/bin/Magnet-Video-Player

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like