amugofjava / podcast_search Goto Github PK
View Code? Open in Web Editor NEWA simple library providing programmatic access to the iTunes search API for podcasts.
License: MIT License
A simple library providing programmatic access to the iTunes search API for podcasts.
License: MIT License
The chapters parser will return an empty set of chapters if the JSON file does not match the spec exactly. Whilst chapters should match the spec the parser needs to be tollerant of small variations; specifically handling JSON files that are reported as text/plain
rather than application/json
and handling numerical time values that are presented as a String.
For some countries like france (lol) the charts errors out with
flutter: media_kit: WARNING: package:media_kit_native_event_loop not found.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: RangeError (index): Invalid value: Valid value range is empty: 0
#0 List.[] (dart:core-patch/growable_array.dart:264:36)
#1 ITunesSearch._chartsToResults
itunes_search.dart:177
<asynchronous suspension>
#2 ITunesSearch.charts
itunes_search.dart:151
<asynchronous suspension>
#3 PodcastService.search
podcast_service.dart:34
<asynchronous suspension>
when the limit is too high
Limit on 50 20 is okay :D but above 20 is too much.
Should this be handled on my side or is this indeed to handle here?
Best regards 👋
Love the ease of use on the library.
Was hoping to get individual image URL if present added to the list too (or am I doing something wrong that I cannot pick it up?).
I think I traced it down to :
episodes.add(Episode.of(
item.guid,
item.title,
item.description,
item.link,
Utils.parseRFC2822Date(item.pubDate),
item.author ?? item.itunes.author,
item.itunes?.duration,
item.enclosure?.url,
item.itunes?.season,
item.itunes?.episode));
Do let me know if this is possible, please. If you have any suggestions otherwise, I am keen to learn that too.
Hi,
At line 295 of model/podcast.dart, you assert that item.pubDate is not null [assignment of Episode.publicationDate as Utils.parseRFC2822Date(item.pubDate!),],
but the specification indicates that "<pubDate> is an optional sub-element of <item>."
See https://validator.w3.org/feed/docs/rss2.html#hrelementsOfLtitemgt
podcast_search/lib/src/model/podcast.dart
Line 295 in 026b5b7
When the code encounters this, it throws an exception when pubDate is not present on an item.
The feeds I am having trouble with publish a DublinCore dc:date field for each item, and the W3C RSS validator recommends that a feed only include one of dc:date and pubDate, since there is no official precedence between the fields.
Thanks!
Hi @amugofjava
As you might remember I use your nice package for the ubuntu app I created
To upgrade musicpod to dart3 and flutter 3.10 I need your package to be updated
To update your package we need dart-rss to be updated
Which I did here https://github.com/Feichtmeier/dart-rss
but the maintainer does not respond and is inactive since years so I doubt this PR will be merged
Since your package is published you can not use a git ref as dep (my fork of dart-rss)
what is your suggestion to do now?
Is there any plan to migrate to the new null-safety dart? Thanks!
I have created complete podcast player base on this package but from last week I got Bad Request exception and it dosent load from feed of the podcast , its not matter which! not every podcast load from feed url and episodes not showing
my provider function which load podcast from feed URL
Future<podcast.Podcast> loadPodcastFromFeed({required String feedUrl}) async {
return await podcast.Podcast.loadFeed(url: feedUrl);
}
this is where I got bad request
. flutter : 3.16.5
. podcast_search: ^0.6.1
The RSS parser is looking for either an <author>
or <itunes:author>
tag in the RSS feed as the channel author; however, <author>
is an item level tag which can result in the wrong author begin returned for the podcast.
To reproduce this, load a podcast that uses item level authors such as 'What Is Money?':
The country name "costarica(code: 'cr')," is displayed as "Costarica" when the correct one is "Costa Rica"
My question is just that, can the top podcasts be paginated? I don't think podcast_search should take care of the pagination aspect but can we just pass in an offset variable that can be used to get a specific page?
I couldn't find any documentation of that top podcasts api from itunes online so I couldn't confirm if this is even possible? Can you please look this up and let me know? Because it'd be much more useful to get a paginated response from itunes which I can directly use in my app.
For some reason, when I search for the term Jenny
, the podcast_search
package has an internal error.
My guess is that one of the results in the response has something unexpected (null
where it should be String
). The StackTrace is pointing to this line.
Example code:
final podcastSearch = Search();
final result = await podcastSearch.search('Jenny');
Example StackTrace:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'String'
#0 Item._fromItunes (package:podcast_search/src/model/item.dart:148:39)
#1 new Item.fromJson (package:podcast_search/src/model/item.dart:120:11)
#2 new SearchResult.fromJson.<anonymous closure> (package:podcast_search/src/model/search_result.dart:85:25)
#3 MappedListIterable.elementAt (dart:_internal/iterable.dart:425:31)
#4 ListIterator.moveNext (dart:_internal/iterable.dart:354:26)
#5 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27)
#6 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#7 new List.of (dart:core-patch/array_patch.dart:39:18)
I want to pass from backend to frontend, and it would be easier if they would serialize to json.
I am getting this error after using the example provided. I have checked for internet connection of my device and it seems this library is the only one having issues.
Hi, thank you for providing this package! It is very handy. I have noticed that in some cases, there is a duplication of podcasts in the response from podcast_search
which is not present in the iTunes API response.
Request:
Search().search("Startup Therapy")
Duplicates (with different collectionId
and trackId
):
Request:
curl -X GET \
"https://itunes.apple.com/search?entity=podcast&term=Startup%20Therapy"
Response:
{
"resultCount": 3,
"results": [
{
"wrapperType": "track",
"kind": "podcast",
"collectionId": 1450325643,
"trackId": 1450325643,
"artistName": "Startups.com",
"collectionName": "Startup Therapy",
"trackName": "Startup Therapy",
"collectionCensoredName": "Startup Therapy",
"trackCensoredName": "Startup Therapy",
"collectionViewUrl": "https://podcasts.apple.com/us/podcast/startup-therapy/id1450325643?uo=4",
"feedUrl": "https://feeds.transistor.fm/startup-therapy",
"trackViewUrl": "https://podcasts.apple.com/us/podcast/startup-therapy/id1450325643?uo=4",
"artworkUrl30": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/f5/ea/ec/f5eaec73-76fb-f051-2b9e-6ac3f32ad2df/mza_12740194947879630385.jpg/30x30bb.jpg",
"artworkUrl60": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/f5/ea/ec/f5eaec73-76fb-f051-2b9e-6ac3f32ad2df/mza_12740194947879630385.jpg/60x60bb.jpg",
"artworkUrl100": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/f5/ea/ec/f5eaec73-76fb-f051-2b9e-6ac3f32ad2df/mza_12740194947879630385.jpg/100x100bb.jpg",
"collectionPrice": 0.0,
"trackPrice": 0.0,
"collectionHdPrice": 0,
"releaseDate": "2024-03-04T10:00:00Z",
"collectionExplicitness": "notExplicit",
"trackExplicitness": "cleaned",
"trackCount": 248,
"trackTimeMillis": 1912,
"country": "USA",
"currency": "USD",
"primaryGenreName": "Business",
"contentAdvisoryRating": "Clean",
"artworkUrl600": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/f5/ea/ec/f5eaec73-76fb-f051-2b9e-6ac3f32ad2df/mza_12740194947879630385.jpg/600x600bb.jpg",
"genreIds": ["1321", "26"],
"genres": ["Business", "Podcasts"]
},
{
"wrapperType": "track",
"kind": "podcast",
"collectionId": 1049614170,
"trackId": 1049614170,
"artistName": "Kyle Meades",
"collectionName": "Speech Therapy Private Practice Startup Podcast",
"trackName": "Speech Therapy Private Practice Startup Podcast",
"collectionCensoredName": "Speech Therapy Private Practice Startup Podcast",
"trackCensoredName": "Speech Therapy Private Practice Startup Podcast",
"collectionViewUrl": "https://podcasts.apple.com/us/podcast/speech-therapy-private-practice-startup-podcast/id1049614170?uo=4",
"feedUrl": "https://www.privateslp.com/feed/podcast/",
"trackViewUrl": "https://podcasts.apple.com/us/podcast/speech-therapy-private-practice-startup-podcast/id1049614170?uo=4",
"artworkUrl30": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/3b/68/6e/3b686ede-640e-b4c5-414d-1a518743f1c6/mza_11185660219265413148.jpg/30x30bb.jpg",
"artworkUrl60": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/3b/68/6e/3b686ede-640e-b4c5-414d-1a518743f1c6/mza_11185660219265413148.jpg/60x60bb.jpg",
"artworkUrl100": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/3b/68/6e/3b686ede-640e-b4c5-414d-1a518743f1c6/mza_11185660219265413148.jpg/100x100bb.jpg",
"collectionPrice": 0.0,
"trackPrice": 0.0,
"collectionHdPrice": 0,
"releaseDate": "2020-06-14T17:47:00Z",
"collectionExplicitness": "notExplicit",
"trackExplicitness": "cleaned",
"trackCount": 50,
"trackTimeMillis": 2292,
"country": "USA",
"currency": "USD",
"primaryGenreName": "Business",
"contentAdvisoryRating": "Clean",
"artworkUrl600": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/3b/68/6e/3b686ede-640e-b4c5-414d-1a518743f1c6/mza_11185660219265413148.jpg/600x600bb.jpg",
"genreIds": ["1321", "26", "1304", "1500"],
"genres": ["Business", "Podcasts", "Education", "Self-Improvement"]
},
{
"wrapperType": "track",
"kind": "podcast",
"collectionId": 1491615628,
"trackId": 1491615628,
"artistName": "Startups.com",
"collectionName": "Startup Therapy",
"trackName": "Startup Therapy",
"collectionCensoredName": "Startup Therapy",
"trackCensoredName": "Startup Therapy",
"collectionViewUrl": "https://podcasts.apple.com/us/podcast/startup-therapy/id1491615628?uo=4",
"feedUrl": "https://feeds.transistor.fm/startup-therapy",
"trackViewUrl": "https://podcasts.apple.com/us/podcast/startup-therapy/id1491615628?uo=4",
"artworkUrl30": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/86/7b/2e/867b2eb1-be68-6db2-b77b-4b16e8971297/mza_17708346996430747403.jpg/30x30bb.jpg",
"artworkUrl60": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/86/7b/2e/867b2eb1-be68-6db2-b77b-4b16e8971297/mza_17708346996430747403.jpg/60x60bb.jpg",
"artworkUrl100": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/86/7b/2e/867b2eb1-be68-6db2-b77b-4b16e8971297/mza_17708346996430747403.jpg/100x100bb.jpg",
"collectionPrice": 0.0,
"trackPrice": 0.0,
"collectionHdPrice": 0,
"releaseDate": "2024-03-04T10:00:00Z",
"collectionExplicitness": "notExplicit",
"trackExplicitness": "cleaned",
"trackCount": 248,
"trackTimeMillis": 1912,
"country": "USA",
"currency": "USD",
"primaryGenreName": "Business",
"contentAdvisoryRating": "Clean",
"artworkUrl600": "https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/86/7b/2e/867b2eb1-be68-6db2-b77b-4b16e8971297/mza_17708346996430747403.jpg/600x600bb.jpg",
"genreIds": ["1321", "26"],
"genres": ["Business", "Podcasts"]
}
]
}
See the Podcast Feed GUID spec.
The Podcast.loadFeed
method returns a Podcast
object, which does not seem to have any guid
property.
How can we use this library to get to the guid
from the RSS feed of a Podcast?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.