Closed Astromis closed 1 year ago
Hi, thanks for using this package! To better summarize you may check this comment out https://github.com/dhvcc/rss-parser/issues/34#issuecomment-1368154956
I wrote this a long time ago, so I'm rewriting it right now, I'll try to find more time by the end of the week
Great, thanks. Looking forward to updates.
Hi.
Nice parser, glad I found that.
I have an idea to improve the code. You see, when I'm parsing my rss feed, I noticed that enclosure attribute is None, but it actually presented in a tree.
Looked at the code, I saw that user defined attribute placed under exception catch block here.
https://github.com/dhvcc/rss-parser/blob/a13e8faa8676049fc79a539421a8ec57aaeac36b/rss_parser/_parser.py#L124
I think it's not a good idea to join different tags under one block, because it doesn't work unless all tags are presented. In my case there are no
itunes:image
tag butenclosure
is.As minimum, I suggest moving a processing of enclosure tag in separated
if
statement before exception like thisIt is a general solution because I don't know what the
item
actually is. As I got from the specification,enclosure
tag is optional, but if it's presented, it must contain those three fields. It seems that the field presence initunes
tag are completely user-defined, though.