Jump to content

Recommended Posts

KA Torrents
Download at Packal

Version: 1.0

Unfortunately, the Piratebay is now down. Whether it will remain down, and if not for how long remains to be seen. I had been using Florian's fantastic Piratebay workflow to easily search and download files. With the servers down, I needed another backend and so another workflow. IMO, KickAss torrents is the best aggregator out there now that Piratebay is gone. So, I wrote a simple workflow to search and download torrents from KickAss.

There is only one keyword filter: torrent. Type that then your query. If you select a result, it will open the magnet link, meaning that your torrent client will automatically open to start downloading. Fast, easy. No whistles.

Enjoy!

Link to comment

At this moment, I don't plan on expanding it, as I personally don't use any of those features. I'm a man with simple torrent tastes :)

Obviously, though, some people do use those features. And seeing as how Piratebay just might not come back ever, working something up with KA seems like a good idea. I'm busy with other things right now, but I'm willing to help in small bits. Tho, from what I remember, your Piratebay workflow was written in PHP, which I don't know. So, I guess I'm saying, you can take all of my code and build on it and I'm willing to help when I can. Or you can make my workflow obsolete :)

Either way, I'll be fine.

Link to comment

Hi again Stephen,

 

Here is the log for the error I'm getting

 

Thanks,

D. 

 

 

Starting debug for 'KA Torrents'
 
[ERROR: alfred.workflow.input.scriptfilter] Code 1: 19:34:27 workflow.py:1892 ERROR    'NoneType' object has no attribute 'text'
Traceback (most recent call last):
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.E62FD2DC-97FA-4060-B970-A124ADFE4FC4/workflow/workflow.py", line 1890, in run
    func(self)
  File "torrents.py", line 69, in main
    for item in scrape_torrent_site(query):
  File "torrents.py", line 29, in scrape_torrent_site
    label_text = normalise_whitespace(soup.find('tr').text)
AttributeError: 'NoneType' object has no attribute 'text'
19:34:27 workflow.py:1907 DEBUG    Workflow finished in 2.328 seconds.
[ERROR: alfred.workflow.input.scriptfilter] Code 1: 19:34:30 workflow.py:1892 ERROR    'NoneType' object has no attribute 'text'
Traceback (most recent call last):
  File "/Users/Damiennew/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.E62FD2DC-97FA-4060-B970-A124ADFE4FC4/workflow/workflow.py", line 1890, in run
    func(self)
  File "torrents.py", line 69, in main
    for item in scrape_torrent_site(query):
  File "torrents.py", line 29, in scrape_torrent_site
    label_text = normalise_whitespace(soup.find('tr').text)
AttributeError: 'NoneType' object has no attribute 'text'
19:34:30 workflow.py:1907 DEBUG    Workflow finished in 2.432 seconds.
Link to comment

Ok. TBH, I am beginning to suspect that your internet connection is wonky. The workflow runs clean for me every time. The error you are reporting says essentially that there is nothing there. Now, the request went through, so it's not that your internet is off. But the workflow isn't getting anything from the response.

This might also explain the ZotQuery export errors. Can you check your internet connection? Obviously you are getting online, to post here, but the error just doesn't make sense otherwise.

In the meantime, I will try to make a version with some logging so that I can see what's happening in the intermediate steps.

Link to comment
  • 4 weeks later...
  • 5 months later...

Is it possible to restrict porn and filthy content from showing up?

 

Not in any sensible way that I can of. I personally don't really see any of that, but I'm mostly searching for TV episodes and movies. Is there some way to tell easily? I could filter results, but I would need to know what to filter on.

Link to comment

Not in any sensible way that I can of. I personally don't really see any of that, but I'm mostly searching for TV episodes and movies. Is there some way to tell easily? I could filter results, but I would need to know what to filter on.

 

Thanks for the reply, a lot of times when I search for almost anything there would be some content that it of that category.

Can you restrict the whole porn branch of the website?

If not maybe you can restrict by a keyword list. If you are able to do that I would be thankful to you. Here is a sample list http://pastebin.com/gpHmA8X5

Link to comment
  • 1 month later...

Screen_Shot_2015_08_27_at_15_44_19.png

 

Class of magnet link anchor on kat.cr page has changed, so perhaps you should remove 'imagnet ' from the following: 

magnet = item.find('a', {'class': 'imagnet icon16'}).get('href')

Seems to work when I remove it.

 

EDIT:

The following change seems to work properly, by opening a magnet link in torrent application:

magnet = item.find('a', {'title':'Torrent magnet link', 'class': 'icon16'}).get('href')

Debug output below:

Starting debug for 'KA Torrents'

[ERROR: alfred.workflow.input.scriptfilter] Code 1: 15:34:26 workflow.py:1892 ERROR    'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/Users/.../Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.xxx/workflow/workflow.py", line 1890, in run
    func(self)
  File "torrents.py", line 69, in main
    for item in scrape_torrent_site(query):
  File "torrents.py", line 39, in scrape_torrent_site
    magnet = item.find('a', {'class': 'imagnet icon16'}).get('href')
AttributeError: 'NoneType' object has no attribute 'get'
Edited by dwd
Link to comment
  • 2 weeks later...
  • 1 month later...
  • 4 months later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...