OfflineBay Bash Version
#1
So before i begin i just want to say that i do not wish to get any kind of recognition for this offlinebay nor any responsibility for what it may be used for
i wrote this because the other version of the offlinebay requires you to go through a lot of trouble which is completely unnecessary (and don't get me started on the last one that required you to install java)

offlinebay.sh (423 bytes)
Code:
grep -ia "$1" torrent_dump_full.csv | while read -r line; do printf "\n" && echo "$line"  | head -n1 | cut -d ";" -f1 && echo "magnet:?xt=urn:btih:"$(echo $(echo "$line"  | head -n1 | cut -d ";" -f2) | xargs | base64 -d -i | hexdump -v -e '/1 "%02x" ' && printf "\n") && echo "$line" | head -n1 | cut -d ";" -f3 && echo $(echo "$line" | head -n1 | cut -d ";" -f4) | xargs | numfmt --to=iec-i --suffix=B && printf "\n"; done
it really doesn't require you to install anything else but maybe numfmt which is only used to format the total size of the torrent, i would suggest that you put this script in the same directory as the torrent-dump_full.cvs, otherwise if you don't want to, you should add the correct location of the file, also it is fair to say that this could probably remade in a much simpler way so if any of you were to do a mod to the script please make it available it for everyone,

Usage:
$ sh offlinebay.sh foobar


Input


Quote:2015-Oct-22 18:10:38;Azaqm1vs0KpeYE1ct9Me20TZ4Hg=;"foobar2000 Complete Encoder Pack v3";17803861
2015-Feb-26 23:02:55;hqp4aQmuJhs4lfE3MplLhR698Zg=;"foobar2000 Complete Encoder Pack";12707174

Output
Quote:2015-Oct-22 18:10:38
magnet:?xt=urn:btih:0336aa9b5becd0aa5e604d5cb7d31edb44d9e078
"foobar2000 Complete Encoder Pack v3"
17MiB


2015-Feb-26 23:02:55
magnet:?xt=urn:btih:86aa786909ae261b3895f13732994b851ebdf198
"foobar2000 Complete Encoder Pack"
13MiB

let me know what you guys think
Reply
#2
Nice idea! I'll try something in Windows, maybe a miniature pirate Access97 app.
Reply
#3
So before i begin i just want to say that i do not wish to get any kind of recognition for this offlinebay nor any responsibility for what it may be used for
i wrote this because the other version of the offlinebay requires you to go through a lot of trouble which is completely unnecessary (and don't get me started on the last one that required you to install java)


gitlab link
https://gitlab.com/throwaway111111/offlinebay-bash


offlinebay.sh (423 bytes)
Code:
grep -ia "$1" torrent_dump_full.csv | while read -r line; do printf "\n" && echo "$line"  | head -n1 | cut -d ";" -f1 && echo "magnet:?xt=urn:btih:"$(echo $(echo "$line"  | head -n1 | cut -d ";" -f2) | xargs | base64 -d -i | hexdump -v -e '/1 "%02x" ' && printf "\n") && echo "$line" | head -n1 | cut -d ";" -f3 && echo $(echo "$line" | head -n1 | cut -d ";" -f4) | xargs | numfmt --to=iec-i --suffix=B && printf "\n"; done
it really doesn't require you to install anything else but maybe numfmt which is only used to format the total size of the torrent, i would suggest that you put this script in the same directory as the torrent-dump_full.cvs, otherwise if you don't want to, you should add the correct location of the file, also it is fair to say that this could probably remade in a much simpler way so if any of you were to do a mod to the script please make it available it for everyone,

Usage:
$ sh offlinebay.sh foobar


Input


Quote:2015-Oct-22 18:10:38;Azaqm1vs0KpeYE1ct9Me20TZ4Hg=;"foobar2000 Complete Encoder Pack v3";17803861
2015-Feb-26 23:02:55;hqp4aQmuJhs4lfE3MplLhR698Zg=;"foobar2000 Complete Encoder Pack";12707174

Output
Quote:2015-Oct-22 18:10:38
magnet:?xt=urn:btih:0336aa9b5becd0aa5e604d5cb7d31edb44d9e078
"foobar2000 Complete Encoder Pack v3"
17MiB


2015-Feb-26 23:02:55
magnet:?xt=urn:btih:86aa786909ae261b3895f13732994b851ebdf198
"foobar2000 Complete Encoder Pack"
13MiB

let me know what you guys think

(i've reposted this thread only because i don't know how or why the original post got deleted)
Reply
#4
BotNot a bad idea. I will try to make my own batch file, as I'm on WinDOS. There's some win-grep similar which is cut for it. Or just runtime Access.
Reply
#5
(Mar 02, 2019, 21:19 pm)throwaway111111..... Wrote: and don't get me started on the last one that required you to install java

It seems like you're not updated at all. Not every day to day user is comfortable with using command line/console applications. The usefulness of a properly executed GUI is indescribable. I'm all for new ideas and improvements. But pretty sure you can do those things without bashing alternatives/predecessors.
Reply
#6
TT, your GUI is of great value, and greatly simplifies acquiring torrents.

But scripts are simply more powerful. They can be used to interact with OTHER programs.

The ideal app would have full GUI fuctions. with each scriptable from the command line.

Also: I dunno if Win users can run that script well without Cygwin installed. Highly recommend Cygwin in any case as it supplies many needed Posix functions and apps lacking lacking in Win (Perl,bash,pyhon, ruby, etc)
Reply
#7
Under normal conditions Unix scripts won't run, syntax error. WindowsXP had the "Posix subsystem" hidden under the hood and newer versions have the command prompt Powershell that should be compatible, but I couldn't know.
Reply
#8
Some folks might have had some Linux functions on XP, but as part of other programs that installed Python/Perl to make them work.

Powershell seems to go out of its way to avoid the Unix names and does provide Win specific abilities.

Cygwin is a fully functional Linux operating under the Win microkernel. You can even run the basic KDE/Gnome GUI within it. Compile with it, also. It has the full set of Linux commands, but some may not be as 'efficient' as the Linux kernel in piping commands together, and poerhaps, process control.
NB: It runs invisibly on a Win system, and comes only when called. And *must* be added to the PATH for it to automatically find the Linux apps.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] OfflineBay v2 - Open source and No more Java dependency techtac 55 328,563 Apr 01, 2022, 13:42 pm
Last Post: UnknownIdot
  [Release] OfflineBay 1.0.2 - Download torrents from thePirateBay offline. techtac 128 334,274 Jun 04, 2018, 06:55 am
Last Post: techtac
  Which version of Visual Studio will support C++ developement? arcvector 2 19,326 Aug 04, 2016, 04:12 am
Last Post: arcvector



Users browsing this thread: 1 Guest(s)