TPB2RSS
Attention
I'm no longer maintaining this repository.
More info here.
A python script to generate a RSS feed from a The Pirate Bay search
Usage
from tpb2rss import ThePirateFeed
feed = ThePirateFeed(input_string, force_most_recent, tpburl, agent)
Input:
-
input_string
(required): search term or URL (string) -
force_most_recent
(optional,True
by default): ignores any info on pagination and ordination from the given URL, forcing it to return the most recent items by upload date (boolean) -
tpburl
(optional,https://thepiratebay.se
by default): set a mirror to use (string) -
agent
(optional,Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36
by default): set an User Agent when downloading the page (string)
Output:
-
feed.xml
: the requested page formatted as XML following the RSS 2.0 specification (string orNone
) -
feed.status.code
: HTTP status code returned byurllib
(integer) -
feed.status.reason
: description of the HTTP status code (string)
Installing on OpenShift
-
Create a
Python 3.3
application -
Clone the application you created.
-
Clone this repository inside your application's repo.
git clone https://github.com/camporez/tpb2rss.git tpb2rss
-
Move the required files to the root of your application's repo.
mv tpb2rss/*.py . rm -rf tpb2rss
-
Commit and push your changes.
git add . git commit -m "Installing TPB2RSS." git push