From 97d7d3bc96e5ba52dba194b7aab06bd76f76b2e0 Mon Sep 17 00:00:00 2001 From: Justin Sane Date: Sat, 5 Jul 2014 05:39:16 +0100 Subject: [PATCH] Added -a option for choosing all the results --- README.md | 3 ++- pirate-get.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d3133fe..46ef746 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ https://aur.archlinux.org/packages/pirate-get-git/ ``` usage: pirate-get.py [-h] [-c category] [-R] [-l] [-t] [--custom COMMAND] - [--local DATABASE] [-p PAGES] [-0] [--color] + [--local DATABASE] [-p PAGES] [-0] [-a] [--color] [search [search ...]] Finds and downloads torrents from the Pirate Bay @@ -37,6 +37,7 @@ optional arguments: --local DATABASE An xml file containing the Pirate Bay database -p PAGES The number of pages to fetch (doesn't work with --local) -0 choose the top result + -a download all results --color use colored output ``` diff --git a/pirate-get.py b/pirate-get.py index 092b397..ecda563 100755 --- a/pirate-get.py +++ b/pirate-get.py @@ -74,6 +74,7 @@ def main(): parser.add_argument('--local', dest='database', help="An xml file containing the Pirate Bay database") parser.add_argument('-p', dest='pages', help="The number of pages to fetch (doesn't work with --local)", default=1) parser.add_argument('-0', dest='first', action='store_true', help="choose the top result", default=False) + parser.add_argument('-a', dest='download_all', action='store_true', help="download all results", default=False) parser.add_argument('--color', dest='color', action='store_true', help="use colored output", default=False) categories = {"All":"0","Audio":"100","Audio/Music":"101","Audio/Audio books":"102","Audio/Sound clips":"103","Audio/FLAC":"104","Audio/Other":"199","Video":"200","Video/Movies":"201","Video/Movies DVDR":"202","Video/Music videos":"203","Video/Movie clips":"204","Video/TV shows":"205","Video/Handheld":"206","Video/HD - Movies":"207","Video/HD - TV shows":"208","Video/3D":"209","Video/Other":"299","Applications":"300","Applications/Windows":"301","Applications/Mac":"302","Applications/UNIX":"303","Applications/Handheld":"304","Applications/IOS (iPad/iPhone)":"305","Applications/Android":"306","Applications/Other OS":"399","Games":"400","Games/PC":"401","Games/Mac":"402","Games/PSx":"403","Games/XBOX360":"404","Games/Wii":"405","Games/Handheld":"406","Games/IOS (iPad/iPhone)":"407","Games/Android":"408","Games/Other":"499","Porn":"500","Porn/Movies":"501","Porn/Movies DVDR":"502","Porn/Pictures":"503","Porn/Games":"504","Porn/HD - Movies":"505","Porn/Movie clips":"506","Porn/Other":"599","Other":"600","Other/E-books":"601","Other/Comics":"602","Other/Pictures":"603","Other/Covers":"604","Other/Physibles":"605","Other/Other":"699"} @@ -259,6 +260,9 @@ def main(): if args.first: print("Choosing first result"); choices = [0] + elif args.download_all: + print("Downloading all results"); + choices = range(0, len(mags)) else: try: l = raw_input("Select link(s): ")