adding some additional setup files and updating readme

master
lance allen 8 years ago
parent d029caed14
commit 886bd2c4c8

@ -0,0 +1,2 @@
#
*/5 * * * * /opt/thepirate/thepirate-satellite.py

@ -6,7 +6,7 @@ Add torrents to your Transmission download queue from anywhere, either via Pushb
- -
Default behavior parses HTML pages on [ThePirateBay](https://thepiratebay.se) based on a search string provided, then passes the magnet link to a locally running Transmission-Daemon (localhost or same LAN). Default behavior parses HTML pages on [ThePirateBay](https://thepiratebay.org) based on a search string provided, then passes the magnet link to a locally running Transmission-Daemon (localhost or same LAN).
Can also add direct HTML pages of the desired torrent with --url, and direct magnet links and torrent files with --file. Can also add direct HTML pages of the desired torrent with --url, and direct magnet links and torrent files with --file.
@ -21,7 +21,7 @@ This script was written in Python version 2.7. Version 3 compatibility requires
* Client setup * Client setup
* Server setup * Server setup
#### Client Side (thepirate) ## Client Side
3 external Python libraries needed. Please ensure the following are installed to the system 3 external Python libraries needed. Please ensure the following are installed to the system
@ -32,41 +32,69 @@ This script was written in Python version 2.7. Version 3 compatibility requires
> TIP: If pip is installed, just run the following as root: > TIP: If pip is installed, just run the following as root:
``` ```
$ pip install transmissionrpc requests beautifulsoup4 $ pip install -r requirements.txt
``` ```
Then edit the thepirate.py file, and change the __rpcserver__ variable to the server's IP/hostname (if not localhost) Then edit the thepirate.py file, and change the __rpcserver__ variable to the server's IP/hostname (if not localhost)
```
$ vim thepirate.py
# edit line 30, rpcserver variable
```
#### Server Side (transmission-daemon and thepirate-satellite.py) ## Server Side
Transmission-daemon needs to be installed for downloading torrents and TCP/9091 needs to be opened on the computer's firewall ### Transmission
Transmission-daemon needs to be installed for downloading torrents.
RHEL/CentOS/Fedora (yum) RHEL/CentOS/Fedora (yum)
``` ```
$ yum install transmission-daemon transmission-cli $ yum install transmission-daemon transmission-cli
$ firewall-cmd --add-port=9091/tcp --permanent
``` ```
Debian/Ubuntu (apt) Debian/Ubuntu (apt)
``` ```
$ apt-get install transmission-daemon transmission-cli $ apt-get install transmission-daemon transmission-cli
```
Make sure the server running Transmission (if not localhost) is accepting traffic on port 9091/tcp and RPC is enabled in the Transmission settings.json file. Set your whitelist to your LAN subnet. Read about configuring Transmission [here](https://trac.transmissionbt.com/wiki/EditConfigFiles).
![img](img/transmissionrpc_config.png)
### Firewall
Open up the Transmission port if the server is not localhost.
Firewalld
```
$ firewall-cmd --add-port=9091/tcp --permanent
```
IPTables
```
$ iptables -A INPUT -p tcp --dport 9091 -j ACCEPT $ iptables -A INPUT -p tcp --dport 9091 -j ACCEPT
``` ```
### thepirate-satellite
[pushbullet.py](https://github.com/randomchars/pushbullet.py) is needed for Pushbullet notifications. You also need transmissionrpc on the server side so it can clear completed torrents. [pushbullet.py](https://github.com/randomchars/pushbullet.py) is needed for Pushbullet notifications. You also need transmissionrpc on the server side so it can clear completed torrents.
``` ```
$ pip install pushbullet.py transmissionrpc $ pip install -r requirements.txt
``` ```
Put your PushBullet API key in api variable in the script and set a cron job to run thepirate-satellite.py every X minutes. Put your PushBullet API key in the api variable in the script and set a cron job to run thepirate-satellite.py every X minutes.
Make sure the server running Transmission (if not localhost) is accepting traffic on TCP/9091 and RPC is enabled in the Transmission settings.json file. Set your whitelist to your LAN subnet. Read about configuring Transmission [here](https://trac.transmissionbt.com/wiki/EditConfigFiles). ```
$ vim thepirate-satellite.py
# edit line 26, variable api
$ crontab cron.txt
```
![img](img/transmissionrpc_config.png)
### Usage ### Usage

@ -0,0 +1,4 @@
beautifulsoup4==4.4.1
requests==2.10.0
transmissionrpc==0.11
pushbullet.py==0.10.0

@ -25,17 +25,17 @@ import transmissionrpc
################################################## ##################################################
# Variables # Variables
# Torrent server IP; can be any machine running transmission-daemon
# with a firewall inbound allowed to TCP/9091 (transmissionrpc)
rpcserver = []
# Dictionaries/Arrays for storing search results # Dictionaries/Arrays for storing search results
tpb_search_results = {} tpb_search_results = {}
tpb_torrent_links = [] tpb_torrent_links = []
user_torrent_selection = "" user_torrent_selection = ""
# Current/working PirateBay URL # Current/working PirateBay URL
tpb = "https://thepiratebay.se" tpb = "https://thepiratebay.org"
# Torrent server IP; can be any machine running transmission-daemon
# with a firewall inbound allowed to TCP/9091 (transmissionrpc)
rpcserver = []
# Squelch HTTPS insecure warnings # Squelch HTTPS insecure warnings
requests.packages.urllib3.disable_warnings() requests.packages.urllib3.disable_warnings()

Loading…
Cancel
Save