I'm writing a pipe to remap a few nodes in an RSS feed.
Recently a new torrent namespace was created and is being used on some sites that provide bittorrent feeds. The torrent node for each item in the feed contains magnet /URI's and I'm trying to remap this to the media content's link so my bittorrent client will default to downloading that rather than the file itself since I can almost guarantee that it can get the torrent file via DHT unlike downloading the torrent file directly due to uptime issues.
I've managed to remap it properly except that the magnet uri is stored as CDATA
in the magnetURI node. When pipes processes this it is escaping uri-specific characters like the ampersand. Is there a way to force pipes to present the data as is without escaping it?
Below is an example of an item pulled from one of the feeds:
<item>
<title><![CDATA[Some torrent title]]></title>
<link>http://www.somebittorrentsite.com/fileofinterest.torrent</link>
<pubDate>Mon, 21 Feb 2011 00:00:00 -0000</pubDate>
<description><![CDATA[A torrent file you'd like to download.]]></description>
<enclosure url="http://www.somebittorrentsite.com/fileofinterest.torrent" length="123456789" type="application/x-bittorrent" />
<guid>912554a5-dd0e-4bee-b2ed-d776e0471552</guid>
<torrent xmlns="http://xmlns.ezrss.it/0.1/">
<fileName><![CDATA[fileofinterest.torrent]]></fileName>
<contentLength>123456789</contentLength>
<infoHash>E4799FF799F9C8C26BA087C601A732DF748FDFB0</infoHash>
<magnetURI><![CDATA[magnet:?xt=urn:btih:E4799FF799F9C8C26BA087C601A732DF748FDFB0&dn=fileofinterest]]></magnetURI>
</torrent>
</item>
Once it runs through the pipe where everything is remapped you can see in media:content
the magnet uri has been escaped.
<item>
<title>Some torrent title</title>
<link>http://www.somebittorrentsite.com/fileofinterest.torrent</link>
<description>A torrent file you'd like to download.</description>
<guid isPermaLink="false">912554a5-dd0e-4bee-b2ed-d776e0471552</guid>
<pubDate>Mon, 28 Feb 2011 19:44:07 -0800</pubDate>
<media:content url="magnet:?xt=urn:btih:E4799FF799F9C8C26BA087C601A732DF748FDFB0&amp;dn=fileofinterest" type="application/x-magnet"/>
</item>
YP were designed for use with human readable text by NON programmers so converting a single
'&' to '&'
makes sense.Only thing I can suggest is passing the pipe through a replace module and swap it back that way.