Skip to main content

Wraps the Torrent Stream http://torrentstream.org/

Project description

Wraps the Torrent Stream http://torrentstream.org/

Installation

Install a stable version:

pip install django-torrent-stream

Or install an alpha version:

pip install -e git://github.com/adw0rd/django-torrent-stream.git#egg=torrent_stream

Add to settings.py:

INSTALLED_APPS = (
    ...
    'torrent_stream'
)

TORRENT_STREAM_AFFILIATE_KEY = "<HASH>"
TORRENT_STREAM_ZONE_ID = <DIGIT>

# You can specify size of player
TORRENT_STREAM_PLAYER = {
    'width': '650px',
    'height': '342px',
}

These KEY and ID you can get on a page http://acestream.net/affiliate/

Usage

For example, you have a model Torrent:

class Torrent(models.Model):
    name = models.CharField(max_length=300, blank=True)
    content = models.FileField(upload_to="torrents/torrents", blank=True)

You can display the button, when clicked, will be available to the player:

{% load torrent_stream %}
{% torrent_stream_button torrent.filename %}

Or you can display a player at once:

{% load torrent_stream %}
{% torrent_stream_player torrent.filename %}

How to get CONTENT_ID

Sometimes you need to get CONTENT_ID, you can do so:

from app.models import Torrent
from torrent_stream.helpers import get_content_id

torrent_obj = Torrent.objects.get(pk=42)

# Enough to transmit the content of the torrent file
content_id = get_content_id(torrent_obj.content.read())

# Or you can also pass the name of the torrent, and the duration to display the data in the player
content_id = get_content_id(torrent_obj.content.read(), torrent_obj.name, duration_in_seconds)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-torrent-stream-0.5b.tar.gz (19.6 kB view details)

Uploaded Source

File details

Details for the file django-torrent-stream-0.5b.tar.gz.

File metadata

File hashes

Hashes for django-torrent-stream-0.5b.tar.gz
Algorithm Hash digest
SHA256 c994a6cb9ecb8e1aad193788ce7538e684bfa1fbed631abf634ccdd301f56087
MD5 013ee04d1e0e57ae9e4a2ef67eb8b367
BLAKE2b-256 2a6e57ca05b991b913a5307bee1a65a5c7edafa96d43b2de975dabc338a248ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page