Im looking for a way to download a torrent file but i can get it to work.
I found couple of similar question here and tried the solutions but i cant get it to work. Heres what i have:
def get_torrent(site):
results = site
url = "https://nyaa.si/user/HorribleSubs?f=0&c=0_0&q=HorribleSubs+%5B720p%5D&p={}"
opener = urllib.request.build_opener()
opener.addheaders = [('User-Agent', 'CERN-LineMode/2.15 libwww/2.17b3')]
urllib.request.install_opener(opener) # NOTE: global for the process
for line in results:
name = "[HorribleSubs] " + line + " [720p].mkv"
urllib.request.urlretrieve(url, name)
The function gets a list of episodes that are new and need to be downloaded, here is an example: Isekai Shokudou - 11, Koi to Uso - 11.
I then add the rest of the link styling and try to download the links but all the above code does is download the whole sites html code inside the below files:
[HorribleSubs] Isekai Shokudou - 11 [720p].mkv
and
[HorribleSubs] Koi to Uso - 11 [720p].mkv
So i need a way to download the actual .torrent files from the site mentioned in the code