Dynamic menu interface for The Pirate Bay, built with rofi
in mind.
pip install rofi-tpb
Consider using pipx
:
pipx install rofi-tpb
Prompt to either search tpb or browse tpb's top torrents:
rofi-tpb
Prompt for search query:
rofi-tpb search
Search for ubuntu related torrents:
rofi-tpb search ubuntu
Browse tpb's top torrents across all categories:
rofi-tpb top all
Browse tpb's recent top torrents across all categories in the last 48h:
rofi-tpb top all -r
Check the help for details:
rofi-tpb --help
...
rofi-tpb search --help
...
rofi-tpb top --help
...
python >= 3.6
tpblite
dynmen
lxml
traitlets
(undeclared dependency ofdynmen
)
rofi-tpb
stores its config in $XDG_CONFIG_HOME/rofi-tpb/config.ini
.
The default configuration is the following:
[menu]
command = rofi -dmenu -i
torrent_format = {title:<65} π{filesize:<12} π½{seeds:<4} πΌ{leeches:<4} Trusted: {trusted} VIP: {vip}
vip_str = β
not_vip_str = β
trusted_str = β
not_trusted_str = β
use_tpb_proxy = True
tpb_url = https://thepiratebay0.org
categories = All, APPLICATIONS, AUDIO, GAMES, OTHER, PORN, VIDEO
categories_48h = True
[actions]
add = xdg-open '{magnetlink}'
open = xdg-open '{url}'
menu.command
: the dynamic menu command which should read fromstdin
and output tostdout
, if you want to usedmenu
instead ofrofi
then adjust this command accordingly.menu.torrent_format
: text representation of a torrent in the dynamic menu, accepts torrent string format keys.menu.use_tpb_proxy
: if True will use the first tpb url as found on https://piratebayproxy.info/.menu.vip_str
: string to use in themenu.torrent_format
when the user is VIP.menu.not_vip_str
: string to use in themenu.torrent_format
when the user is not VIP.menu.trusted_str
: string to use in themenu.torrent_format
when the user is trusted.menu.not_trusted_str
: string to use in themenu.torrent_format
when the user is not trusted.menu.tpb_url
: tpb url, ifuse_tpb_proxy
is True acts as a fallback url in case https://piratebayproxy.info/ is unavailable or the parsing fails.menu.categories
: comma separated list of tpb categories, when browsing the top torrents.menu.categories_48h
: add last 48h top torrent categories.actions.*
: commands to run on the selected torrent, accepts torrent string format keys.
Available torrent string format keys:
{title}
: torrent title{filesize}
: torrent file size{seeds}
: number of seeders{leeches}
: number of leechers{uploader}
: torrent uploader{upload_date}
: upload date{url}
: torrent's tpb url{magnetlink}
: torrent magnet link{vip}
: uploader is VIP, replaced withmenu.vip_str
/menu.not_vip_str
.{trusted}
: uploader is trusted, replaced withmenu.trusted_str
/menu.not_trusted_str
.
If the menu.command
uses rofi
, rofi-tpb
will use rofi
's -multiple-select
flag to allow for selecting multiple torrents.