You can also iterate over the Torrents object just by calling it in a for loop (see example above). The search function returns a Torrents object, which is a list-like collection of the torrents found. printOptions () # Similarly for the sort order ORDERS. printOptions () # Or just a subset of categories, like VIDEO CATEGORIES. ALL, last_48 = True ) Categories and Sort Order # To print all available categories, use the classmethod printOptions CATEGORIES. ALL ) # Customize with category and restriction to torrents from the last 48h torrents = t. DES ) Top from tpblite import TPB, CATEGORIES t = TPB () # Get the top recent torrents torrents = t. VIDEO ) # Customize the page number and sort order torrents = t. magnetlink ) Browse # You can browse all of the torrents from a single category torrents = t. getBestTorrent ( min_seeds = 30, min_filesize = '500 MiB', max_filesize = '4 GiB' ) # Or select a particular torrent by indexing torrent = torrents # Get the magnet link for a torrent print ( torrent. MOVIES ) # Get the most seeded torrent based on a filter torrent = torrents. search ( 'public domain', page = 2, order = ORDERS. format ( len ( torrents ))) # Iterate through list of torrents and print info for Torrent object for torrent in torrents : print ( torrent ) # Customize your search from tpblite import CATEGORIES, ORDERS torrents = t. search ( 'public domain' ) # See how many torrents were found print ( 'There were torrents found.'. Search # Quick search for torrents, returns a Torrents object torrents = t. N.B Before using you should check which ThePirateBay domain works for you, as this varies from country to country. Usage from tpblite import TPB # Create a TPB object with a domain name t = TPB ( '' ) # Or create a TPB object with default domain t = TPB () Unofficial Lightweight Python API for ThePirateBay
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |