karan / TPB

:cloud: Python API for ThePirateBay.
MIT License
331 stars 66 forks source link

Fix Torrent.files when file list is not available #78

Open themylogin opened 9 years ago

themylogin commented 9 years ago

thepiratebay is back! But some torrents are still unavailable (e.g. https://thepiratebay.se/torrent/7384920 => https://thepiratebay.se/ajax_details_filelist.php?id=7384920) which produces the error that has been fixed in this PR.

themylogin commented 9 years ago

self.assertTrue(len(torrent.files) > 0) fails because e.g. https://thepiratebay.se/torrent/8118777/TPB_AFK_Youtube_Rip_1080p_(English_SUB)#filelistContainer shows "File list not available"

themylogin commented 9 years ago

New purl encodes URL path component which results in requesting http://thepiratebay.se/ajax_details_filelist.php%3Fid%3D11807049 instead of http://thepiratebay.se/ajax_details_filelist.php?id=11807049 (and file list does not work)