'.. http:put:: /channels/discovered/(string: channelid)/torrents
Add a torrent file to your own channel. Returns error 500 if something is wrong with the torrent file
and DuplicateTorrentFileError if already added to your channel. The torrent data is passed as base-64 encoded
string. The description is optional.
**Example request**:
.. sourcecode:: none
curl -X PUT http://localhost:8085/channels/discovered/abcd/torrents
--data "torrent=...&description=funny video"
**Example response**:
.. sourcecode:: javascript
"added": True
:statuscode 404: if your channel does not exist.
:statuscode 500: if the passed torrent data is corrupt.'

def render_PUT(self, request):

    channel = self.get_channel_from_db(self.cid)
    if (channel is None):
        return ChannelsTorrentsEndpoint.return_404(request)
    parameters = http.parse_qs(request.content.read(), 1)
    if (('torrent' not in parameters) or (len(parameters['torrent']) == 0)):
        request.setResponseCode(http.BAD_REQUEST)
        return json.dumps({'error': 'torrent    parameter    missing'})
    if (('description' not in parameters) or (len(parameters['description']) == 0)):
        extra_info = {}
    else:
        extra_info = {'description': parameters['description'][0]}
    try:
        torrent = base64.b64decode(parameters['torrent'][0])
        torrent_def = TorrentDef.load_from_memory(torrent)
        self.session.add_torrent_def_to_channel(channel[0], torrent_def, extra_info, forward=True)
    except (DuplicateTorrentFileError, ValueError, HttpError) as ex:
        return BaseChannelsEndpoint.return_500(self, request, ex)
    return json.dumps({'added': True})
