TorrentLeech Removed

Topics related to Couchpotato and its features
wickedpenguin
Junior Member
Posts: 5
Joined: 06 Sep 2014 21:01
Status: Offline

TorrentLeech Removed

Postby wickedpenguin » 22 Oct 2014 00:17

It seems that TorrentLeech has now been removed, however for me it has been working perfectly for a while.

https://github.com/RuudBurger/CouchPota ... 7#commitco

I have attempted to readd the files, but the provider isn't appearing on restart.

Has any had any luck re-adding this provider. Or is there a good alternative, I find the other free providers keep downloading completely unrelated movies.

peer
Junior Member
Posts: 28
Joined: 01 Jul 2014 10:26
Has thanked: 2 times
Been thanked: 3 times
Status: Offline

Re: TorrentLeech Removed

Postby peer » 22 Oct 2014 07:57

I will try this myself when I get the time. Will post my results here.

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: TorrentLeech Removed

Postby clinton.hall » 22 Oct 2014 22:19

In custom_plugins add a file named torrentleech.py, in it put this; http://pastebin.com/xDbgtNDh and restart CouchPotato

codered
Junior Member
Posts: 12
Joined: 29 Mar 2013 18:20
Contact:
Status: Offline

Re: TorrentLeech Removed

Postby codered » 23 Oct 2014 19:47

Anyone know why TorrentLeech has been removed?

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: TorrentLeech Removed

Postby clinton.hall » 24 Oct 2014 01:39

because is kept spitting up errors and Therefore RuudBurger was wasting too much time trying to fix it.

peer
Junior Member
Posts: 28
Joined: 01 Jul 2014 10:26
Has thanked: 2 times
Been thanked: 3 times
Status: Offline

Re: TorrentLeech Removed

Postby peer » 24 Oct 2014 07:51

Anyone got it working?

Placed the pastbin content in a torrentleech.py and put it in custom_plugins:

$ ls -l custom_plugins/
total 20

Code: Select all

-rwxr-xr-x. 1 peer peer   24 Feb 15  2014 __init__.py
-rw-rw-r--. 1 peer peer 5770 Oct 24 07:42 torrentleech.py
-rw-rw-r--. 1 peer peer 5673 Oct 24 07:43 torrentleech.pyc


Still get:

Code: Select all

10-24 07:46:36 ERROR [core.media._base.searcher] There aren't any providers enabled for your downloader (torrent,torrent_magnet). Check your settings.


Also, how is the credentials handled now when it's removed from couch? Anyone knows?

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: TorrentLeech Removed

Postby clinton.hall » 24 Oct 2014 08:16

try creating a folder named TorrentLeech in your custom_plugins folder, now inside that folder create 2 files, as per the below,
__init__.py

Code: Select all

from .main import TorrentLeech

def autoload():
    return TorrentLeech()

config = [{
    'name': 'torrentleech',
    'groups': [
        {
            'tab': 'searcher',
            'list': 'torrent_providers',
            'name': 'TorrentLeech',
            'description': '<a href="http://torrentleech.org">TorrentLeech</a>',
            'wizard': True,
            'icon': 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAACHUlEQVR4AZVSO48SYRSdGTCBEMKzILLAWiybkKAGMZRUUJEoDZX7B9zsbuQPYEEjNLTQkYgJDwsoSaxspEBsCITXjjNAIKi8AkzceXgmbHQ1NJ5iMufmO9/9zrmXlCSJ+B8o75J8Pp/NZj0eTzweBy0Wi4PBYD6f12o1r9ebTCZx+22HcrnMsuxms7m6urTZ7LPZDMVYLBZ8ZV3yo8aq9Pq0wzCMTqe77dDv9y8uLyAWBH6xWOyL0K/56fcb+rrPgPZ6PZfLRe1fsl6vCUmGKIqoqNXqdDr9Dbjps9znUV0uTqdTjuPkDoVCIfcuJ4gizjMMm8u9vW+1nr04czqdK56c37CbKY9j2+1WEARZ0Gq1RFHAz2q1qlQqXxoN69HRcDjUarW8ZD6QUigUOnY8uKYH8N1sNkul9yiGw+F6vS4Rxn8EsodEIqHRaOSnq9T7ajQazWQycEIR1AEBYDabSZJyHDucJyegwWBQr9ebTCaKvHd4cCQANUU9evwQ1Ofz4YvUKUI43GE8HouSiFiNRhOowWBIpVLyHITJkuW3PwgAEf3pgIwxF5r+OplMEsk3CPT5szCMnY7EwUdhwUh/CXiej0Qi3idPz89fdrpdbsfBzH7S3Q9K5pP4c0sAKpVKoVAQGO1ut+t0OoFAQHkH2Da/3/+but3uarWK0ZMQoNdyucRutdttmqZxMTzY7XaYxsrgtUjEZrNhkSwWyy/0NCatZumrNQAAAABJRU5ErkJggg==',
            'options': [
                {
                    'name': 'enabled',
                    'type': 'enabler',
                    'default': False,
                },
                {
                    'name': 'username',
                    'default': '',
                },
                {
                    'name': 'password',
                    'default': '',
                    'type': 'password',
                },
                {
                    'name': 'seed_ratio',
                    'label': 'Seed ratio',
                    'type': 'float',
                    'default': 1,
                    'description': 'Will not be (re)moved until this seed ratio is met.',
                },
                {
                    'name': 'seed_time',
                    'label': 'Seed time',
                    'type': 'int',
                    'default': 40,
                    'description': 'Will not be (re)moved until this seed time (in hours) is met.',
                },
                {
                    'name': 'extra_score',
                    'advanced': True,
                    'label': 'Extra Score',
                    'type': 'int',
                    'default': 20,
                    'description': 'Starting score for each release found via this provider.',
                }
            ],
        },
    ],
}]


main.py

Code: Select all

import traceback
 
from bs4 import BeautifulSoup
from couchpotato.core.logger import CPLog
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.media.movie.providers.base import MovieProvider
from couchpotato.core.media._base.providers.torrent.base import TorrentProvider
import six
 
log = CPLog(__name__)
 
class TorrentLeech(TorrentProvider, MovieProvider):
 
    urls = {
        'test': 'https://www.torrentleech.org/',
        'login': 'https://www.torrentleech.org/user/account/login/',
        'login_check': 'https://torrentleech.org/user/messages',
        'detail': 'https://www.torrentleech.org/torrent/%s',
        'search': 'https://www.torrentleech.org/torrents/browse/index/query/%s/categories/%d',
        'download': 'https://www.torrentleech.org%s',
    }
 
    http_time_between_calls = 1  # Seconds
    cat_backup_id = None
 
    cat_ids = [
            ([13], ['720p', '1080p', 'bd50']),
            ([8], ['cam']),
            ([9], ['ts', 'tc']),
            ([10], ['r5', 'scr']),
            ([11], ['dvdrip']),
            ([14], ['brrip']),
            ([12], ['dvdr']),
        ]
 
    def buildUrl(self, title, media, quality):
        return (
            tryUrlencode(title.replace(':', '')),
            self.getCatId(quality)[0]
        )
 
    def _searchOnTitle(self, title, media, quality, results):
 
        url = self.urls['search'] % self.buildUrl(title, media, quality)
 
        data = self.getHTMLData(url)
 
        if data:
            html = BeautifulSoup(data)
 
            try:
                result_table = html.find('table', attrs = {'id': 'torrenttable'})
                if not result_table:
                    return
 
                entries = result_table.find_all('tr')
 
                for result in entries[1:]:
 
                    link = result.find('td', attrs = {'class': 'name'}).find('a')
                    url = result.find('td', attrs = {'class': 'quickdownload'}).find('a')
                    details = result.find('td', attrs = {'class': 'name'}).find('a')
 
                    results.append({
                        'id': link['href'].replace('/torrent/', ''),
                        'name': six.text_type(link.string),
                        'url': self.urls['download'] % url['href'],
                        'detail_url': self.urls['download'] % details['href'],
                        'size': self.parseSize(result.find_all('td')[4].string),
                        'seeders': tryInt(result.find('td', attrs = {'class': 'seeders'}).string),
                        'leechers': tryInt(result.find('td', attrs = {'class': 'leechers'}).string),
                    })
 
            except:
                log.error('Failed to parsing %s: %s', (self.getName(), traceback.format_exc()))
 
    def getLoginParams(self):
        return {
            'username': self.conf('username'),
            'password': self.conf('password'),
            'remember_me': 'on',
            'login': 'submit',
        }
 
    def loginSuccess(self, output):
        return '/user/account/logout' in output.lower() or 'welcome back' in output.lower()
 
    loginCheckSuccess = loginSuccess
 

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: TorrentLeech Removed

Postby clinton.hall » 24 Oct 2014 08:24

restart CP and refresh the webpage... TorrentLeech should appear under settings, searcher again and you should be able to add the settings etc... I have tested this much, But I have not tested any search/snatch.

peer
Junior Member
Posts: 28
Joined: 01 Jul 2014 10:26
Has thanked: 2 times
Been thanked: 3 times
Status: Offline

Re: TorrentLeech Removed

Postby peer » 24 Oct 2014 21:22

clinton.hall wrote:restart CP and refresh the webpage... TorrentLeech should appear under settings, searcher again and you should be able to add the settings etc... I have tested this much, But I have not tested any search/snatch.


Just tried this, and search seems to work.
Hopefully snatch will work as well.
Thanks a lot!

Code: Select all

10-24 21:21:15 INFO [hpotato.core.plugins.base] Opening url: get https://api.couchpota.to/info/tt2103281/, data: []
10-24 21:21:15 INFO [hpotato.core.plugins.base] Opening url: get http://api.themoviedb.org/3/movie/tt2103281?api_key=xxx&append_to_response=alternative_titles, data: []
10-24 21:21:15 INFO [hpotato.core.plugins.base] Opening url: get http://www.omdbapi.com/?i=tt2103281, data: []
10-24 21:21:15 INFO [ie.providers.info.omdbapi] Found: Dawn of the Planet of the Apes (2014)
10-24 21:21:15 INFO [hpotato.core.plugins.base] Opening url: get https://api.couchpota.to/eta/tt2103281/, data: []
10-24 21:21:15 INFO [core.media.movie.searcher] Search for Dawn of the Planet of the Apes in 1080p ignoring ETA
10-24 21:21:15 INFO [hpotato.core.plugins.base] Opening url: post https://www.torrentleech.org/user/account/login/, data: ['username', 'remember_me', 'login', 'password']
10-24 21:21:15 INFO [hpotato.core.plugins.base] Opening url: post https://www.torrentleech.org/user/account/login/, data: ['username', 'remember_me', 'login', 'password']
10-24 21:21:17 INFO [hpotato.core.plugins.base] Opening url: get https://www.torrentleech.org/torrents/browse/index/query/dawn+of+the+planet+of+the+apes/categories/13, data: []
10-24 21:21:17 INFO [hpotato.core.plugins.base] Opening url: get https://www.torrentleech.org/torrents/browse/index/query/dawn+of+the+planet+of+the+apes/categories/13, data: []
10-24 21:21:18 INFO [core.media.movie.searcher] Search for Dawn of the Planet of the Apes in 720p ignoring ETA

skaze
Junior Member
Posts: 5
Joined: 17 Jul 2012 12:35
Contact:
Status: Offline

Re: TorrentLeech Removed

Postby skaze » 25 Oct 2014 18:04

thanks clinton

skaze
Junior Member
Posts: 5
Joined: 17 Jul 2012 12:35
Contact:
Status: Offline

Re: TorrentLeech Removed

Postby skaze » 25 Oct 2014 18:04

thanks clinton

Birkanoff
Junior Member
Posts: 4
Joined: 25 Oct 2014 19:33
Has thanked: 5 times
Status: Offline

Re: TorrentLeech Removed

Postby Birkanoff » 25 Oct 2014 19:36

Hi,

I just tried the solution that clinton wrote but it doesn't seem to work for me.

Code: Select all

10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: filmweb
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: flickchart
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: imdb
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: letterboxd
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: moviemeter
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: moviesio
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: reddit
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: rottentomatoes
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: sharethe
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: tmdb
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: trakt
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: whiwa
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_providers_userscript: youteather
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie: searcher
10-25 19:31:22INFO[  couchpotato.core.loader] Loaded media_movie_suggestion: main
10-25 19:31:22ERROR[  couchpotato.core.loader] Can't import main: Traceback (most recent call last):
  File "/volume1/@appstore/couchpotatoserver-custom/var/CouchPotatoServer/couchpotato/core/loader.py", line 58, in run
    m = self.loadModule(module_name)
  File "/volume1/@appstore/couchpotatoserver-custom/var/CouchPotatoServer/couchpotato/core/loader.py", line 164, in loadModule
    return import_module(name)
  File "/usr/local/couchpotatoserver-custom/var/CouchPotatoServer/libs/importhelper/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/couchpotatoserver-custom/var/custom_plugins/main.py", line 1, in <module>
    from .main import TorrentLeech
ValueError: Attempted relative import in non-package
10-25 19:31:22INFO[       couchpotato.runner] Starting server on port 5053


Any tips?

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: TorrentLeech Removed

Postby clinton.hall » 25 Oct 2014 22:38

you need to have the files set out as
..../custom_plugins/TorrentLeech/__init__.py
..../custom_plugins/TorrentLeech/main.py

Birkanoff
Junior Member
Posts: 4
Joined: 25 Oct 2014 19:33
Has thanked: 5 times
Status: Offline

Re: TorrentLeech Removed

Postby Birkanoff » 26 Oct 2014 06:47

Thank you for the help clinton. of course I missed that specific line of text. However even when I have done this it won't work for me.

Code: Select all

10-26 06:28:57ERROR[  couchpotato.core.loader] Can't import TorrentLeech: Traceback (most recent call last):
  File "/volume1/@appstore/couchpotatoserver-custom/var/CouchPotatoServer/couchpotato/core/loader.py", line 58, in run
    m = self.loadModule(module_name)
  File "/volume1/@appstore/couchpotatoserver-custom/var/CouchPotatoServer/couchpotato/core/loader.py", line 164, in loadModule
    return import_module(name)
  File "/usr/local/couchpotatoserver-custom/var/CouchPotatoServer/libs/importhelper/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/couchpotatoserver-custom/var/custom_plugins/TorrentLeech/__init__.py", line 1, in <module>
    from .main import TorrentLeech
  File "/usr/local/couchpotatoserver-custom/var/custom_plugins/TorrentLeech/main.py", line 3
    from bs4 import BeautifulSoup
    ^
IndentationError: unexpected indent
10-26 06:28:57ERROR[  couchpotato.core.loader] Can't import torrentleech: Traceback (most recent call last):
  File "/volume1/@appstore/couchpotatoserver-custom/var/CouchPotatoServer/couchpotato/core/loader.py", line 58, in run
    m = self.loadModule(module_name)
  File "/volume1/@appstore/couchpotatoserver-custom/var/CouchPotatoServer/couchpotato/core/loader.py", line 164, in loadModule
    return import_module(name)
  File "/usr/local/couchpotatoserver-custom/var/CouchPotatoServer/libs/importhelper/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/couchpotatoserver-custom/var/custom_plugins/torrentleech.py", line 3
    from bs4 import BeautifulSoup
    ^
IndentationError: unexpected indent


../custom_plugins/

Code: Select all

   4 drwxr-sr-x    2 root     root          4096 Oct 26 06:27 TorrentLeech
   4 -rwxr-xr-x    1 root     root            24 Oct 25 19:21 __init__.py
  88 -rwxrwxrwx    1 root     root         89220 Oct 25 19:44 torrentleech.py


../custom_plugins/TorrentLeech/

Code: Select all

  24 -rwxrwxrwx    1 root     root         21543 Oct 26 06:27 __init__.py
  28 -rwxrwxrwx    1 root     root         28668 Oct 26 06:28 main.py

peer
Junior Member
Posts: 28
Joined: 01 Jul 2014 10:26
Has thanked: 2 times
Been thanked: 3 times
Status: Offline

Re: TorrentLeech Removed

Postby peer » 26 Oct 2014 08:37

@Birkanof:
This indicates that your paste messed it up:

Code: Select all

IndentationError: unexpected indent



I can now confirm that everything is working with torrentleech (searching and snatching both). Thanks again Clinton

Birkanoff
Junior Member
Posts: 4
Joined: 25 Oct 2014 19:33
Has thanked: 5 times
Status: Offline

Re: TorrentLeech Removed

Postby Birkanoff » 26 Oct 2014 09:23

peer wrote:@Birkanof:
This indicates that your paste messed it up:

Code: Select all

IndentationError: unexpected indent



Thank you for the input. I was a little suspicious about this as the code looked pretty messed up when pasting it into vi. I'm gonna try to clean it up manually to see if that resolves the issue.

Or am I doing this the totally noobish way? Right now I'm just copying and pasting over a SSH-connection.

Not that skilled at Unix and this is the first time I'm dealing with Python so forgive me if I seem slow :)

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: TorrentLeech Removed

Postby clinton.hall » 26 Oct 2014 10:36

for copy and paste, you may want to look at winSCP as this allows for more "visial" editing

Birkanoff
Junior Member
Posts: 4
Joined: 25 Oct 2014 19:33
Has thanked: 5 times
Status: Offline

Re: TorrentLeech Removed

Postby Birkanoff » 26 Oct 2014 11:20

It's alive!!!

Decided to go with the more inconvenient method of cleaning up the script manually by deleting a bunch of spaces that were for some reason inserted after each row that was pasted into vi. My "Del"-button got some exercise today in other words.

But totally worth it. Both search and snatch is working excellent.

Big thank you to clinton and peer for the help!

Next time I'll probably go with the SCP option though ;)

Ziggid
Junior Member
Posts: 3
Joined: 14 Oct 2014 23:15
Has thanked: 1 time
Status: Offline

Re: TorrentLeech Removed

Postby Ziggid » 02 Nov 2014 14:26

Works like a charm, thanks a lot!

whostoblame
Junior Member
Posts: 8
Joined: 16 Mar 2015 05:01
Status: Offline

Re: TorrentLeech Removed

Postby whostoblame » 16 Mar 2015 05:05

Sorry if it has been answered elsewhere but I have been searching for hours and cant seem to locate it. How would I be able to add this to freenas 9.3 and coachpotato 9.3.0. This thread is officially back from the dead. Thanks in advance.


Return to “General Discussion”