Comments (11)
Umm. OK. We'll accept seconds part only case.
The spec says the followings are valid formats:
HH:MM:SS
H:MM:SS
MM:SS
M:SS
But the spec describes seconds part only case in the following part:
If you specify a single number as a value (without colons), the iTunes Store displays the value as seconds.
Second part only case isn't included in the above valid format list but second part only case will be valid.
from rss.
Validation in rss is based on spec not real use cases.
For example, this is based on https://github.com/simplepie/simplepie-ng/wiki/Spec:-iTunes-Podcast-RSS#itunesduration .
BTW, what does 2238
mean? 2238 seconds? 22:38
?
from rss.
If you specify a single number as a value (without colons), the iTunes Store displays the value as seconds.
2238 seconds?
from rss.
Apologies I missed your replies.
Ok, so in that case then an integer / number without colon should get converted to minutes:seconds I would think, rather than error out.
Yes, in this case that would be 37:38.
I can submit a PR if you like?
from rss.
Do you mean that RSS::Parser
should accept 2238
as a valid value? It's not acceptable because it's not a valid format.
You can parse 2238
with RSS::Parser.parse(..., validate: false)
. In this case, you get 2238
by rss.items.first.itunes_duration.second
.
If you mean that itunes_duration.minute
is 37
and itunes_duration.second
is 38
for 2238
, it's acceptable.
from rss.
Yeah - I think 2238
should be accepted as valid - any number without colons should be treated as seconds. Your quote from the spec above implies that it is valid.
My mistake above - it's actually 37.3 minutes, or 37:18 in this case. Whether the parsing returns 2238 seconds or 37:18, it just shouldn't fail based on this as the spec implies a whole number is a valid duration
.
My point is the a large amount of the podcast feeds I tried to parse failed because of this error, and I don't think it should be an error as it appears to be valid in the spec.
from rss.
@kou @jarvisjohnson Just got bitten by this yesterday. Checkout the PR and let me know if there is something you think may be improved.
from rss.
BTW the official spec (https://help.apple.com/itc/podcasts_connect/#/itcb54353390) now mentions this too:
If you specify more then two colons, Apple Podcasts ignores the numbers farthest to the right.
So following the same idea, values like 01:34:45:26
or even 01:34:45:26.423
should be valid and treated as 01:34:45
. Since I haven't found these cases in the wild, I haven't prepared a PR for them but let me know if you want to include them to stay true to the spec.
from rss.
Nice work, thanks for the PR @aitor!
from rss.
@jarvisjohnson you're welcome
from rss.
Done by #5.
from rss.
Related Issues (20)
- How to get "cap" elements?
- Parsing enc:enclosure HOT 2
- Webhook for commit-email.info HOT 3
- Cant parse media content HOT 5
- Anyway to generate content as CDATA? HOT 3
- Error parsing <itunes:duration> when value is an integer. HOT 3
- Paged feeds (RFC 5005)? HOT 2
- <a10:author> <a10:name>Some author</a10:name> </a10:author> Not prasing correctly HOT 5
- Please add support for the PodcastIndex Namespace RSS tags
- obenn:master
- How to set content? HOT 3
- Trouble setting categories for RSS 2.0 feed HOT 2
- can't parse media:thumbnail HOT 1
- readme reading example HOT 1
- Can I add namespaced attributes? HOT 1
- Missing rel=self link? HOT 2
- Parsing the <pubDate> tag fails if it is in ISO8601 format HOT 2
- itunes:image for Items::Item HOT 2
- Issues parsing RSS from academic publishers HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rss.