pipes-digital / pipes

Repository for Pipes
https://pipes.digital
GNU Affero General Public License v3.0
264 stars 21 forks source link

Allow setting arbitrary children of <channel> element #49

Closed 75th closed 5 years ago

75th commented 5 years ago

I'm using Pipes to combine the free and premium feeds of a podcast into a single feed. It works great, except that it doesn't use the channel/image element from either feed, leaving me with no cover art in my podcast player.

It'd be nice if I could just manually add that element in there to get the metadata for the entire feed just the way I like it.

onli commented 5 years ago

I will have to think about the proper new block/extension to an existing block to make this happen. Maybe we need something generic here, to extract an element (that we have) and insert it into an other feed (that is missing).

Would it work already if it just uses one of the channel/image elements of the origin feeds?

75th commented 5 years ago

That would definitely be an improvement. It'd be nice to be able to customize it however I want, but I'll take what I can get!

onli commented 5 years ago

It would use the first image it finds, that's at least a bit controllable. I agree that giving full power to the pipe creator would be better, but it's best to start with the easy solution.

Just to be sure, https://allesnetz.com/feed/mp3/ with the channel/image/url/ element is what your target feeds look like as well? Could you maybe link the free one?

75th commented 5 years ago

Sorry for the delay. Here's the free feed in question:

http://feeds.soundcloud.com/users/soundcloud:users:211911700/sounds.rss

onli commented 5 years ago

Turned out the generic solution was easier. Pipes uses the feedparser gem to normalize feeds, which is sadly missing the channel image structure and thus filtering it out. Right solution long term is to enhance the gem, short term a block to workaround was easier (and might be useful for different usecases!)

I added a block I called insert. See its section in the docs or this example pipe. Extract the channel image from the soundcloud feed and then use the insert block to add that channel image just before the pipe output. It has to happen just at the end, otherwise the normalization will remove the element again, if the data flows through a filter block for example.

Please note to set OuterXML as the attribute to extract, that way it will grab the whole block and not just its content.

The block can of course still be changed if its behavior is not as expected.

75th commented 5 years ago

Well, this is definitely an improvement, but what I'd really like to do is make my own image hosted on my own server and use that. I guess I could create a dummy RSS feed that only has that image element, but that seems overcomplicated.

75th commented 5 years ago

Okay, I have successfully made a dummy RSS feed on my own server and gotten the feed basically exactly how I want it. Unless you're just itching to enhance this further, I think you can mark it complete!

onli commented 5 years ago

Okay, great. My only other idea would have been to offer a block where you can enter arbitrary content, and that would have needed more time to get right. Dummy RSS feed is the best solution right now.