fixed torrent ext, but still not doing what we want

This commit is contained in:
raspbeguy 2016-05-24 17:45:38 +02:00
parent 2b597a6dee
commit 6076574150
2 changed files with 4 additions and 2 deletions

2
.gitignore vendored
View file

@ -10,3 +10,5 @@ feedgen/tests/tmp_Rssfeed.xml
tmp_Atomfeed.xml tmp_Atomfeed.xml
tmp_Rssfeed.xml tmp_Rssfeed.xml
build/**

View file

@ -44,7 +44,7 @@ class TorrentEntryExtension(BaseEntryExtension):
''' '''
enclosure = etree.SubElement(entry, '{%s}enclosure' % TORRENT_NS) enclosure = etree.SubElement(entry, '{%s}enclosure' % TORRENT_NS)
guid = etree.SubElement(entry, '{%s}guid' % TORRENT_NS) guid = etree.SubElement(entry, '{%s}guid' % TORRENT_NS)
torrent = etree.SubElement(entry, '{%s]torrent' % TORRENT_NS) torrent = etree.SubElement(entry, '{%s}torrent' % TORRENT_NS)
enclosure.attrib['type'] = 'application/x-bittorrent' enclosure.attrib['type'] = 'application/x-bittorrent'
@ -66,7 +66,7 @@ class TorrentEntryExtension(BaseEntryExtension):
if self.__torrent_hash: if self.__torrent_hash:
torrent_hash = etree.SubElement(torrent, '{%s}infohash' % TORRENT_NS) torrent_hash = etree.SubElement(torrent, '{%s}infohash' % TORRENT_NS)
torrent_hash.text = self.__torrent_hash torrent_hash.text = self.__torrent_hash
torrent.magnet = etree.SubElement(torrent, '{%s}magneturi' % TORRENT_NS) torrent_magnet = etree.SubElement(torrent, '{%s}magneturi' % TORRENT_NS)
torrent_magnet.text = 'magnet:?xt=urn:btih:' + self.__torrent_hash torrent_magnet.text = 'magnet:?xt=urn:btih:' + self.__torrent_hash