From a62114c91f2070c8c8453d117f3d81dc113e41ff Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan <biswa@surgot.in> Date: Mon, 25 Mar 2024 16:43:09 +0530 Subject: dotfile update --- zsh/oh-my-zsh/plugins/torrent/README.md | 13 ------------- zsh/oh-my-zsh/plugins/torrent/torrent.plugin.zsh | 17 ----------------- 2 files changed, 30 deletions(-) delete mode 100644 zsh/oh-my-zsh/plugins/torrent/README.md delete mode 100644 zsh/oh-my-zsh/plugins/torrent/torrent.plugin.zsh (limited to 'zsh/oh-my-zsh/plugins/torrent') diff --git a/zsh/oh-my-zsh/plugins/torrent/README.md b/zsh/oh-my-zsh/plugins/torrent/README.md deleted file mode 100644 index 079aafc..0000000 --- a/zsh/oh-my-zsh/plugins/torrent/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# torrent - -This plugin creates a Torrent file based on a [MagnetURI](https://en.wikipedia.org/wiki/Magnet_URI_scheme). - -To use it, add `torrent` to the plugins array in your zshrc file. - -```zsh -plugins=(... torrent) -``` - -## Plugin commands - -* `magnet_to_torrent <MagnetURI>`: creates Torrent file. diff --git a/zsh/oh-my-zsh/plugins/torrent/torrent.plugin.zsh b/zsh/oh-my-zsh/plugins/torrent/torrent.plugin.zsh deleted file mode 100644 index 656e337..0000000 --- a/zsh/oh-my-zsh/plugins/torrent/torrent.plugin.zsh +++ /dev/null @@ -1,17 +0,0 @@ -# -# Algorithm borrowed from http://wiki.rtorrent.org/MagnetUri and adapted to work with zsh. -# - -function magnet_to_torrent() { - [[ "$1" =~ xt=urn:btih:([^\&/]+) ]] || return 1 - - hashh=${match[1]} - - if [[ "$1" =~ dn=([^\&/]+) ]];then - filename=${match[1]} - else - filename=$hashh - fi - - echo "d10:magnet-uri${#1}:${1}e" > "$filename.torrent" -} \ No newline at end of file -- cgit v1.2.3-59-g8ed1b