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)