SlyMarbo / rss

A Go library for fetching, parsing, and updating RSS feeds.
Other
400 stars 85 forks source link

Support humanize enclousure length #76

Closed LinuxSuRen closed 2 years ago

SlyMarbo commented 2 years ago

Hi @LinuxSuRen. Thanks for your contribution, I really appreciate it. Do you have any data on how widespread 'humanized' enclosure lengths are? The spec gives the length as a simple number, so I'm reluctant to accept other formats unless they are widespread. If there's only one source that gives this format, would it be possible to request the source use the correct format instead?

LinuxSuRen commented 2 years ago

hi @SlyMarbo , thanks for your quick response.

I am not familiar with the spec of RSS. Thanks for giving the link. I'm not sure if the humanized enclosure length is common. I'll try to contact the author. This is the place where my project tried to read it.

By the way, I try to cache the RSS data into a local file in my project (a CLI for podcast). Do you have any suggestions about the below changes?

https://github.com/SlyMarbo/rss/pull/76/files#diff-dacaf1fe7cb0b1b5d8877efa60fab9a9927d3d71f4219815e6f16c6c0ce7e877R35

SlyMarbo commented 2 years ago

Hi @LinuxSuRen. Could you achieve the same result by fetching the feed directly (using http.Get(rssURL)), then caching the data before calling rss.Parse(data)? I'm slightly reluctant to store the raw data in the feed object, as it will increase memory usage considerably.

LinuxSuRen commented 2 years ago

hi @SlyMarbo thanks for your suggestion. It's great!

LinuxSuRen commented 2 years ago

I'm going to close this PR until I have a better idea.