Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podcasts By Feed ID endpoint /podcasts/byfeedid accepts non-numeric ids #111

Open
ericpp opened this issue Sep 9, 2023 · 4 comments
Open

Comments

@ericpp
Copy link

ericpp commented Sep 9, 2023

The Podcasts By Feed ID endpoint seems to accept whatever id you throw at it as long as it has a number in it somewhere

For instance: https://api.podcastindex.org/api/1.0/podcasts/byfeedid?id=value4value

Returns results for id=4:

{
  "status": "true",
  "query": {
    "id": "4"
  },
  "feed": {
    "id": 4,
    "podcastGuid": "7fba92fb-42eb-56da-b562-cef9d2cf2546",
    "medium": "podcast",
    "title": "IdiotSpeakShow",
    "url": "https://feeds.soundcloud.com/users/soundcloud:users:150466516/sounds.rss",
    "originalUrl": "http://feeds.soundcloud.com/users/soundcloud:users:150466516/sounds.rss",
    "link": "https://soundcloud.com/idiotspeakshow",
    "description": "Podcast by IdiotSpeakShow",
    "author": "IdiotSpeakShow",
    "ownerName": "IdiotSpeakShow",
    "image": "https://i1.sndcdn.com/avatars-000143391344-h7vuir-original.png",
    "artwork": "https://i1.sndcdn.com/avatars-000143391344-h7vuir-original.png",
    "lastUpdateTime": 1684301388,
    "lastCrawlTime": 1694229180,
    "lastParseTime": 1694229187,
    "lastGoodHttpStatusTime": 1694229180,
    "lastHttpStatus": 200,
    "contentType": "application/rss+xml; charset=utf-8",
    "itunesId": 1000035657,
    "itunesType": "episodic",
    "generator": "",
    "language": "en",
    "explicit": false,
    "type": 0,
    "dead": 0,
    "chash": "3414348449422fc0970d059cc680d0ab",
    "episodeCount": 2,
    "crawlErrors": 0,
    "parseErrors": 0,
    "categories": null,
    "locked": 0,
    "imageUrlHash": 794829127
  },
  "description": "Found matching feeds."
}
@daveajones
Copy link
Contributor

That’s right. I use an alpha filter to just suck the numbers out of the input. Do you think it should be an error instead?

@stevencrader
Copy link
Collaborator

I think it should be rejected. What it does now is undefined behavior. I'm a fan of strong type enforcement.

@ericpp
Copy link
Author

ericpp commented Sep 10, 2023

It seemed a little strange that the API returned a result for value4value. I would've expected it to either return no results or complain that id isn't an integer.

@daveajones
Copy link
Contributor

I can change it. I remember now why I did that. It’s because Apple’s api accepts feed id’s as “id123456789” and strips the “id” part off so I was mimicking that behavior. It’s not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants