Skip to content

Commit

Permalink
We'll start from here.
Browse files Browse the repository at this point in the history
  • Loading branch information
idlesign committed Jan 30, 2012
0 parents commit 2a9b721
Show file tree
Hide file tree
Showing 13 changed files with 1,491 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
v0.1
----
+ Initial release.
27 changes: 27 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2012, deluge-updatorr project
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3. Neither the name of the deluge-updatorr project nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include README
include LICENSE
include CHANGELOG
recursive-include updatorr/data *
recursive-include updatorr/tracker_handlers *
99 changes: 99 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
deluge-updatorr
===============
http://github.com/idlesign/deluge-updatorr


What's that
-----------

*deluge-updatorr is a Deluge plugin for automatic torrents updates.*

If you're periodically checking your favourite torrent tracker site,
on which torrents are organized as articles (forum-like trackers),
to verify whether a specific torrents have been updated (e.g. torrent
bundling some TV-series is updated with a new episode), then Updatorr
is might be of use.

You activate Updatorr plugin, set autoupdate period and trackers sites
credentials, choose torrents to be updated from Deluge torrents list,
and Updatorr will do checks for you. When torrent update is available,
Updatorr will replace old torrent with an updated one, and download
new files from new torrent.

Automatic updates are available for:

* RuTracker.org (ex torrents.ru) - http://rutracker.org/

*Deluge is a lightweight, Free Software, cross-platform BitTorrent client.*
Download it at http://deluge-torrent.org/


Installation
------------

Open Deluge, go to "Preferences -> Plugins -> Install plugin" and choose
Updatorr .egg file.

If you are to build .egg file from source code yourself use
`python setup.py bdist_egg` command in source code root directory.


Trackers Handlers
-----------------

*The information below is intended for those wishing to
enable Updatorr autoupdates for their favourite tracker site.*

In order to perform automatic updates Updatorr should be instructed
how to perform those, as different torrent tracking sites require
different machinery to get updated torrents.

Tracker handlers are nothing more as relatively simple scripts
in great Python programming language.

To create a tracker handler class one needs to:

0. Have essential knowledge in Python programming;
1. Get Updatorr source code from http://github.com/idlesign/deluge-updatorr/;
2. Create ``hander_{mytracker}.py`` file under `updatorr/tracker_handlers/`;
3. In that file subclass ``BaseTrackerHandler`` and implement
its ``get_torrent_file()`` method;
Note: See base class properties and methods, as they might be of use.
4. In that file register you class with ``register_tracker_handler()``.

Tracker handler sample `updatorr/tracker_handlers/handler_mytrack.py`::

from updatorr.handler_base import BaseTrackerHandler, register_tracker_handler

class MyTrackHandler(BaseTrackerHandler):

# Let's suppose that tracker site doesn't require authorization.
login_required = True

def get_torrent_file(self):
# Here one should implement .torrent file download and
# save into filesystem. See BaseTrackerHandler fo helper methods.
torrent_filepath = '/somewhere/in/my/filesystem/new.torrent'
return torrent_filepath

register_tracker_handler('mytrackaurl.com', MyTrackHandler)
register_tracker_handler('yotr.su', MyTrackHandler

See `updatorr/tracker_handlers/handler_rutracker.py` and `updatorr/handler_base.py` for reference.
Read docstrings of Updatorr.


Get involved into deluge-updatorr
---------------------------------

**Submit issues.** If you spotted something weird in application behavior or want to propose a feature you can do that at https://github.com/idlesign/deluge-updatorr/issues

**Write code.** If you are eager to participate in application development, fork it at https://github.com/idlesign/deluge-updatorr, write your code, whether it should be a bugfix or a feature implementation, and make a pull request right from the forked project page.

**Spread the word.** If you have some tips and tricks or any other words in mind that you think might be of interest for the others — publish it.


The tip
-------

You might be interested in considering other Deluge plugins at http://dev.deluge-torrent.org/wiki/Plugins/
50 changes: 50 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import os
from setuptools import setup, find_packages
from updatorr import VERSION


f = open(os.path.join(os.path.dirname(__file__), 'README'))
readme = f.read()
f.close()

__plugin_name__ = 'Updatorr'
__version__ = '.'.join(map(str, VERSION))
__description__ = 'Deluge plugin for automatic torrents updates'
__long_description__ = readme
__author__ = "Igor 'idle sign' Starikov"
__author_email__ = '[email protected]'
__license__ = 'BSD License'
__url__ = 'http://github.com/idlesign/deluge-updatorr'
__pkg_data__ = {__plugin_name__.lower(): ['tracker_handlers/*', 'data/*']}

setup(
name=__plugin_name__,
version=__version__,
description=__description__,
long_description=__long_description__,
author=__author__,
author_email=__author_email__,
url=__url__,
license=__license__,
install_requires=['setuptools'],
zip_safe=False,

classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Plugins',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
],

packages=[__plugin_name__.lower()],
package_data=__pkg_data__,

entry_points='''
[deluge.plugin.core]
%s = %s:CorePlugin
[deluge.plugin.gtkui]
%s = %s:GtkUIPlugin
''' % ((__plugin_name__, __plugin_name__.lower())*2)
)
20 changes: 20 additions & 0 deletions updatorr/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from deluge.plugins.init import PluginInitBase


VERSION = (0, 1)


class CorePlugin(PluginInitBase):

def __init__(self, plugin_name):
from core import Core as _plugin_cls
self._plugin_cls = _plugin_cls
super(CorePlugin, self).__init__(plugin_name)


class GtkUIPlugin(PluginInitBase):

def __init__(self, plugin_name):
from gtkui import GtkUI as _plugin_cls
self._plugin_cls = _plugin_cls
super(GtkUIPlugin, self).__init__(plugin_name)
Loading

0 comments on commit 2a9b721

Please sign in to comment.