Album artwork from track MPMediaItem - ios

I'm using Apple Music API's recent played endpoint which returns a list of recently played media assets.
I'm then using one of them and play it on MPMusicPlayerController.
{
"id": "1437591818",
"type": "albums",
"href": "/v1/catalog/us/albums/1437591818",
"attributes": {
"artwork": {
"width": 3000,
"height": 3000,
"url": "https://is2-ssl.mzstatic.com/image/thumb/Music118/v4/46/e9/60/46e9606c-59ec-1243-c377-2089c303dacf/00602577153884.rgb.jpg/{w}x{h}bb.jpeg",
"bgColor": "000000",
"textColor1": "faf0ee",
"textColor2": "ecd0d3",
"textColor3": "c8c0be",
"textColor4": "bca6a9"
},
"artistName": "Lil Wayne",
"isSingle": false,
"url": "https://itunes.apple.com/us/album/tha-carter-v/1437591818",
"isComplete": true,
"genreNames": [
"Hip-Hop/Rap",
"Music"
],
"trackCount": 23,
"isMasteredForItunes": true,
"releaseDate": "2018-09-28",
"name": "Tha Carter V",
"recordLabel": "Young Money Records, Inc.",
"copyright": "℗ 2018 Young Money Records, Inc.",
"playParams": {
"id": "1437591818",
"kind": "album"
},
"editorialNotes": {
"standard": "Maybe more than any other rapper in history, Lil Wayne’s output is defined by franchises. An artist should be so lucky to sustain the kind of longevity that would allow for multi-volume phases the likes of Wayne’s <i>Dedication</i>, and <i>Da Drought</i> mixtapes, let alone the series that made him into a superstar, <i>Tha Carter</i>. Though Wayne was not without projects in between, some seven years were allowed to pass between the release of the fourth and fifth installments of the lattermost. Fortunately, Wayne has rewarded his fans’ patience with 23 tracks that speak to a number of his most storied eras.<br />\n“Mixtape Weezy,” as Jay-Z famously coined, is alive and well on songs like the Swizz Beatz-produced “Uproar,” Wayne blacking out over a reinterpretation of G-Dep’s 2001 hit “Special Delivery.” The nostalgia doesn’t stop (or peak) there, as Wayne and Snoop Dogg share space over a flip of Dr. Dre’s “Xxplosive” on “Dope N*ggaz,” while Mannie Fresh revisits the Cash Money golden-era bounce of Juvenile’s “Ghetto Children” for “Start This Shit Off Right.” There are nods to the experimental Wayne of the <i>I Am Not A Human Being</i> projects (“Don’t Cry,” “Mess”) and also the rapper’s under-heralded pop wizardry (“Famous,” which features his daughter Reginae as hook singer), and even a love song built on a gospel sample, “Dope New Gospel.” In all, <i>Tha Carter V</i> is an album for anyone who’s missed Wayne—no matter which Wayne they’d missed.",
"short": "Weezy F Baby, and the F is for finally."
},
"contentRating": "explicit"
}
},
Whenever I want to access the metadata of what's currently playing, I can get it with the nowPlayingItem property which returns a MPMediaItem of the current track within the album.
The artwork property of this MPMediaItem is null, so I want to access the album's artwork. I can get the albumPersistentStoreId (3911653000682848550 for example) and I'm using it to request the album info via the Apple Music API:
https://api.music.apple.com/v1/catalog/us/albums/3911653000682848550
But this returns a "Resource not Found" error message.
Using the search endpoint (https://api.music.apple.com/v1/catalog/us/search?term=the+carter+v&limit=2&types=artists,albums) or the original recently played endpoint I see that the album ID returned in these is different than the one I get in the albumPersistentStoreId property. How can I get the proper album ID from the MPMediaItem?

You could use the playbackstoreID of the MPMediaItem - request track info from the API and get the album art from there.

Related

YouTube API - Description snippet from YouTube does not match the API / Getting "Primary" description text content

I want to use the YouTube API to get the snippet of their description. However, I want it to be the primary text snippet describing the video YouTube uses as the snippet, which is different from the data api's response.
Let me give an example to clear things up:
This video will be the demonstration: https://www.youtube.com/watch?v=ADPFEw-7FtU
At the top of this description is the text "Compress Decades Into Days. Get Dan Lok’s World-Class Training Solutions to Grow Your Income, Influence and Wealth Today. Start Here ► [redacted]"
On the YouTube data API search snippet the response is: "Compress Decades Into Days. Get Dan Lok's World-Class Training Solutions to Grow Your Income, Influence and Wealth Today.". This makes sense because they're both at the start of the description. Now this is where I get confused.
If you search the title on YouTube (not the API), you'll actually see that the description is "Have you ever thought of starting an exciting YouTube career on YouTube doing what you love? Or maybe you have started, but ..."
This is the snippet I want. I want their video's "Primary SEO Search Snippet", which describes the video. Is there anyway to calculate this or get this from the API using another method? I don't want to use any non-official API/library to do this.
What this is not:
This is not any caching that has yet to expire/update
Unique to this video. There are plenty of videos where this happens
As far as I know there isn't any official API providing the data you are looking for. Anyway if you change your mind about not using unofficial APIs, then you can proceed as follows by trying out my open-source YouTube operational API. Indeed by fetching https://yt.lemnoslife.com/search?part=snippet&q=YOUR_QUERY, you will notably get the primary SEO search snippet you are looking for in item["snippet"]["detailedMetadataSnippet"].
For instance with "How To Grow With 0 Views And 0 Subscribers" you would get:
{
"kind": "youtube#searchListResponse",
"etag": "NotImplemented",
"items": [
{
"kind": "youtube#searchResult",
"etag": "NotImplemented",
"id": {
"kind": "youtube#video",
"videoId": "ADPFEw-7FtU"
},
"snippet": {
"channelId": "UCs_6DXZROU29pLvgQdCx4Ww",
"title": "How To Grow With 0 Views And 0 Subscribers",
"thumbnails": [
{
"url": "https:\/\/i.ytimg.com\/vi\/ADPFEw-7FtU\/hq720.jpg?sqp=-oaymwEjCOgCEMoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLCKNA5T652tMTvnOw22llDniM9O6Q",
"width": 360,
"height": 202
},
...
],
"channelTitle": "Dan Lok",
"channelHandle": "DanLok",
"timestamp": "3 years ago",
"duration": 887,
"views": 4495095,
"badges": [
"CC"
],
"channelApproval": "Verified",
"channelThumbnails": [
{
"url": "https:\/\/yt3.ggpht.com\/ytc\/AMLnZu_TXnQ07ufj6eGxco9yHndCCcV5KfAizZ9jbI8vmA=s68-c-k-c0x00ffffff-no-rj",
"width": 68,
"height": 68
}
],
"detailedMetadataSnippet": "Have you ever thought of starting an exciting YouTube career on YouTube doing what you love? Or maybe you have started, but\u00a0...",
"chapters": [
{
"title": "Intro",
"time": 0,
"thumbnails": [
{
"url": "https:\/\/i.ytimg.com\/vi\/ADPFEw-7FtU\/hqdefault_25933.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLBVOtOt_jLJd1dRRt5_dj3SlGBtRA",
"width": 336,
"height": 188
}
]
},
...
]
}
},
...
]
}
I wanted to add an answer for anyone trying to do this in 2023 and onwards.
I opened a ticket on the Google Issue Tracker regarding this issue: This was their response.
Hi Conor,
I was able to reproduce this behavior, and also found that neither a search resource description nor a video resource description will display the "Primary SEO Search Snippet" that you are seeking. Thus, I have opened up a feature request with our internal team to request this functionality, but I can't guarantee this feature will be implemented. Thus for updates regarding this, I recommend keeping an eye on our revision history.
You can use the unofficial API as per Benjamin's answer, but unfortunately, that can cause other issues depending on the scale you need to use this feature.

Getting album, album art, and run time info from musicbrainz

Is there any way of getting a list of albums for an artist (band), along with a link to album art and runtime?
I've been given this endpoint, but the data it returns is confusing:
http://musicbrainz.org/ws/2/recording?query=artist:%22Queen%22%20and%20type:album&fmt=json
The data isn't really organized around albums, and the "length" data returns something like 203000. But it's better if you see it in context, so here's the first bit of it (sorry I couldn't get it indented):
{
"created": "2018-02-17T03:47:57.052Z",
"count": 9533710,
"offset": 0,
"recordings": [
{
"id": "c2e919f7-ecb9-4fdf-9162-3c26d0127fa0",
"score": "100",
"title": "Son and Daughter",
"length": 203000,
"video": null,
"artist-credit": [
{
"artist": {
"id": "0383dadf-2a4e-4d10-a46a-e9e041da8eb3",
"name": "Queen",
"sort-name": "Queen",
"disambiguation": "UK rock group",
"aliases": [
{
"sort-name": "Queen + Adam Lambert",
"name": "Queen + Adam Lambert",
"locale": null,
"type": null,
"primary": null,
"begin-date": "2011",
"end-date": null
}
]
}
}
],
"releases": [
{
"id": "bb19abaf-80b3-4a3e-846d-5f12b12af827",
"title": "Queen",
"status": "Official",
"release-group": {
"id": "810068af-2b3c-3e9c-b2ab-68a3f3e3787d",
"primary-type": "Album"
},
"date": "1994",
"country": "NL",
"release-events": [
{
"date": "1994",
"area": {
"id": "ef1b7cc0-cd26-36f4-8ea0-04d9623786c7",
"name": "Netherlands",
"sort-name": "Netherlands",
"iso-3166-1-codes": [
"NL"
]
}
}
],
"track-count": 10,
"media": [
{
"position": 1,
"format": "CD",
"track": [
{
"id": "3a26455e-2660-30dc-a652-6a2b40f1fbe5",
"number": "8",
"title": "Son and Daughter",
"length": 203400
}
],
"track-count": 10,
"track-offset": 7
}
]
},
{
"id": "1783da6a-9315-3602-a488-1738eb733a0f",
"title": "Queen",
"status": "Official",
"release-group": {
"id": "810068af-2b3c-3e9c-b2ab-68a3f3e3787d",
"primary-type": "Album"
},
"date": "1973-09-04",
"country": "US",
"release-events": [
{
"date": "1973-09-04",
"area": {
"id": "489ce91b-6658-3307-9877-795b68554c98",
"name": "United States",
"sort-name": "United States",
"iso-3166-1-codes": [
"US"
]
}
}
],
If someone can explain this data to me, then I don't need another endpoint. But I've been hunting around the musicbrainz docs and they're not super helpful.
Preferably it would be with one call, but I can do successive calls if necessary.
Thanks for your help.
First off:
Is there any way of getting a list of albums for an artist (band), along with a link to album art and runtime?
Yes, definitely.
First you will want to find the artist, say, the Queen that did Bohemian Rhapsody. They're identified with MusicBrainz Artist ID "0383dadf-2a4e-4d10-a46a-e9e041da8eb3", so you can do a browse request for Releases by this artist: https://musicbrainz.org/ws/2/release/?artist=0383dadf-2a4e-4d10-a46a-e9e041da8eb3&inc=recordings&fmt=json (note the inc=recordings)
This gives you most of what you are asking for. A list of releases and their runtime—kind of. Each Release should have one or more medium properties that in turn have a track-list with a number of tracks. The sum of the length of each of these tracks is what makes up the runtime (the length is given in milliseconds).
For cover art, you may notice that the output has a cover-art-archive property. For cover art, MusicBrainz uses Cover Art Archive which uses MusicBrainz IDs as identifiers. The cover-art-archive attribute states whether any cover art exists in Cover Art Archive and a few details about this—e.g., does CAA have any images at all (artwork)? Does it have a back image (back) and/or a front image (front)? How many images are there in all for the release (count)? If the cover-art-archive→artwork is true, we can go on and fetch cover art from the CAA. The CAA's API is really simple: to get the "front" image of a release, say the 1974 UK single "Killer Queen" that has MusicBrainz Release ID "a2d12ee8-9aeb-4d91-bfab-5c21f7a577fc", you can simply do https://coverartarchive.org/release/a2d12ee8-9aeb-4d91-bfab-5c21f7a577fc/front
You can also do https://coverartarchive.org/release/a2d12ee8-9aeb-4d91-bfab-5c21f7a577fc to get a JSON document with more details about what cover art images are available (e.g., this one has two images: one Front+Medium and one Back+Medium image).
The Cover Art Archive API is documented at https://musicbrainz.org/doc/Cover_Art_Archive/API and the MusicBrainz API/web service documentation can be found at https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2
Note that using browse requests you can page through the results using offset and vary the amount of results per query using limit, see the "Paging" section under the browse request section in the MusicBrainz WS documentation.
Secondly: Though you don't ask about this directly, you're using a search query using a generic term in your question, so I thought I'd talk about this for a bit. In MusicBrainz everything is identified using MusicBrainz identifiers (IDs). (I kind of mentioned them in the first section too.)
The reason for this is that many, many names are not unique. There are as of this writing three unique artists known as "Queen" in MusicBrainz: https://musicbrainz.org/search?query=%22queen%22&type=artist&method=advanced – not counting any of the 321 other artists that have "queen" as part of their name. Without more information, it is not possible for MusicBrainz to know which of them you want to find out information from, so your first step will likely be to somehow either narrow the search (e.g., add type:group narrows the search to 123 results, using country:gb limits to 21 results, doing both gives 11 results (see the search syntax documentation for more details)) or somehow filter afterwards.
Once you've narrowed it down to the specific artist you want, you can continue with the steps outlined above to get the details you want. The steps for narrowing it down will depend on your specific application/use case.
Finally: You seem to have some missing understanding at the asbstract level about how MusicBrainz's data is structured. E.g., all of the above is assuming that by album you mean a specific released version like the 1974 UK "Killer Queen" single, and not a more generic concept of a release like any version of the "Killer Queen" single, which in MusicBrainz terminology would be a Release Group.
https://musicbrainz.org/doc/MusicBrainz_Entity is a list of entities used in MusicBrainz. Understanding the differences between a Release Group and a Release as well as between Tracks and Recordings (and Works) will put you in a much better position to effectively use the web service and the MusicBrainz data in general.
https://musicbrainz.org/doc/MusicBrainz_Database/Schema is a introduction to how MusicBrainz is structured. Knowing how artist credits, ("advanced") relationships, and mediums play into things is also likely to save you a lot of headache later.
You need to understand the format of the data returned, copy the result in to a JSON formatting service such as https://jsonformatter.curiousconcept.com/
You will then realise you have multiple artists in the returned data, which is why it's not as simple as "albums by artist"
I’m guessing the "length" data is in milliseconds.

How to get in-app or subscription info from server side?

Is it possbile to get In-app (or subscription) information (at least price, currency) for iOS application by bundle id or product id from server side?
I know that iOS clients possible to do it using their SDK.
Maybe exists service like iTunes Lookup API?
In StoreKit you have SKProduct and there you have the price
You can check it here
https://developer.apple.com/library/ios/documentation/StoreKit/Reference/StoreKit_Collection/
I think the answer is no, they intend you to fetch the IAPs from within the app. Here is an example of what is returned from the iTunes affiliate search API. AFAIK there is no other API to query app information. They don't mention other ways in their guide to obtaining IAP information.
http://itunes.apple.com/lookup?id=828578246
{
"resultCount": 1,
"results": [
{
"isGameCenterEnabled": true,
"screenshotUrls": [
"http://a2.mzstatic.com/us/r30/Purple49/v4/67/01/ff/6701ff5c-55d3-0ea6-d868-8d803072483b/screen696x696.jpeg",
"http://a2.mzstatic.com/us/r30/Purple69/v4/7c/14/5f/7c145fc0-d7af-cfce-eede-f35ad50a779e/screen696x696.jpeg",
"http://a3.mzstatic.com/us/r30/Purple69/v4/cc/0a/43/cc0a4393-a006-f485-a4b5-59049b16da18/screen696x696.jpeg",
"http://a5.mzstatic.com/us/r30/Purple69/v4/e1/76/23/e1762373-849f-9935-7880-34b62365db8c/screen696x696.jpeg",
"http://a5.mzstatic.com/us/r30/Purple69/v4/84/2f/63/842f635e-ccb1-7802-3fc3-020024a8d786/screen696x696.jpeg"
],
"ipadScreenshotUrls": [
"http://a2.mzstatic.com/us/r30/Purple69/v4/26/ea/ca/26eacabe-8606-de7e-c49a-aeb961c44a22/sc1024x768.jpeg",
"http://a4.mzstatic.com/us/r30/Purple49/v4/11/60/5a/11605ad9-c93a-92d2-2abf-faff83c7e5e4/sc1024x768.jpeg",
"http://a4.mzstatic.com/us/r30/Purple69/v4/bb/b5/8e/bbb58e8a-f6fb-7a4d-e6b9-02ad3007d601/sc1024x768.jpeg",
"http://a2.mzstatic.com/us/r30/Purple69/v4/82/d5/34/82d53417-01aa-e6eb-f0f6-c57e76dae3d9/sc1024x768.jpeg",
"http://a4.mzstatic.com/us/r30/Purple49/v4/04/ad/f4/04adf415-1a40-58b6-6d82-6e47394668e4/sc1024x768.jpeg"
],
"appletvScreenshotUrls": [],
"artworkUrl60": "https://is4-ssl.mzstatic.com/image/thumb/Purple71/v4/14/68/e7/1468e7e9-9dc8-4493-2738-bba066cd03c4/source/60x60bb.jpg",
"artworkUrl512": "https://is4-ssl.mzstatic.com/image/thumb/Purple71/v4/14/68/e7/1468e7e9-9dc8-4493-2738-bba066cd03c4/source/512x512bb.jpg",
"artworkUrl100": "https://is4-ssl.mzstatic.com/image/thumb/Purple71/v4/14/68/e7/1468e7e9-9dc8-4493-2738-bba066cd03c4/source/100x100bb.jpg",
"artistViewUrl": "https://itunes.apple.com/us/developer/big-fish-games-inc/id292594310?uo=4",
"kind": "software",
"features": [
"gameCenter",
"iosUniversal"
],
"supportedDevices": [
"iPhone4",
"iPad2Wifi",
"iPad23G",
"iPhone4S",
"iPadThirdGen",
"iPadThirdGen4G",
"iPhone5",
"iPodTouchFifthGen",
"iPadFourthGen",
"iPadFourthGen4G",
"iPadMini",
"iPadMini4G",
"iPhone5c",
"iPhone5s",
"iPhone6",
"iPhone6Plus",
"iPodTouchSixthGen"
],
"advisories": [],
"trackCensoredName": "Gummy Drop!",
"userRatingCountForCurrentVersion": 325,
"sellerUrl": "http://www.bigfishgames.com/mobile-games/ios-games/",
"contentAdvisoryRating": "4+",
"languageCodesISO2A": [
"NL",
"EN",
"FR",
"DE",
"IT",
"JA",
"KO",
"PT",
"RU",
"ES"
],
"fileSizeBytes": "89165452",
"averageUserRatingForCurrentVersion": 4.5,
"trackViewUrl": "https://itunes.apple.com/us/app/gummy-drop!/id828578246?mt=8&uo=4",
"trackContentRating": "4+",
"minimumOsVersion": "7.0",
"formattedPrice": "Free",
"currency": "USD",
"wrapperType": "software",
"version": "2.14.0",
"artistId": 292594310,
"artistName": "Big Fish Games, Inc",
"genres": [
"Games",
"Arcade",
"Puzzle",
"Entertainment"
],
"price": 0,
"description": "Stop crushing & start squishing! Match your way around this candy world! LET’S GO GUMMY! ®\n\nTravel WHEREVER and WHENEVER you want! From Sydney to Tokyo, San Francisco, New York City, Paris, London, Rome, Berlin, New Orleans, Barcelona, Shanghai, Los Angeles, Seoul, Havana, Rio de Janeiro, St. Petersburg, Mexico City, Cape Town, Budapest, Tahiti, Cairo, Marrakesh, Dubai, Bangkok, Athens, Amsterdam, Hawaii, Hong Kong, Singapore, New Delhi, Venice and more coming soon!\n\nFEATURES\n• Play over 10,000 gummified levels across dozens of world cities – MORE levels than any other Match-3 game!\n• Travel to any city, anytime! Earn travel vouchers to unlock the city of your choice.\n• Exciting Achievements! See your accomplishments in your Passport.\n• Unique boosts! Including Shuffle, Lightning, Shovel, and more!\n• Huge rewards! Score in-game items just for playing.\n• Daily Events! Collect sweet bursts of resources and rewards.\n\nREVIEWS\nBetter than Candy Crush (5 STARS)\nLove the way the game travels around the world.\n\nFinally a Straight Up Game Experience (5 STARS)\nThis is an amazing game that is what it says - FREE. You can keep playing a challenging de-stressor without any bait and switch. Love It!!!!!!!!\n\nFun game (5 STARS)\nThis game starts easily and increases in difficulty as you get better. Fun to watch the cities grow as you add details.\n\nCan’t get enough of Gummy Drop! ? Visit our Headquarters, like us on Facebook of follow us on Twitter for sweet musings, matching tips, gummy stories, and tasty giveaways!\n\nGummy Drop! Headquarters: www.bigfishgames.com/gummyHQ \nFacebook: Search Gummy Drop \nTwitter: #GummyDrop \n \n*Note for updates - having trouble seeing your progress after an update? Try connecting with Facebook again and that should do the trick!*",
"trackName": "Gummy Drop!",
"trackId": 828578246,
"bundleId": "com.bigfishgames.worldsagaaapluniversalF2P",
"releaseDate": "2014-09-08T19:29:51Z",
"primaryGenreName": "Games",
"isVppDeviceBasedLicensingEnabled": true,
"currentVersionReleaseDate": "2016-08-23T17:26:54Z",
"releaseNotes": "Join us in the newest city, Queenstown!\nPlay over 360 brand new levels of Gummy matching fun today!\n\nOther improvements:\n•Optimizations and bug fixes to improve overall game performance.\n\nThanks for the continued support and feedback, and be sure to keep an eye out for more exciting updates!\n\nExperiencing issues? Please visit http://bigfi.sh/GummyHQ",
"sellerName": "Big Fish Games, Inc",
"primaryGenreId": 6014,
"genreIds": [
"6014",
"7003",
"7012",
"6016"
],
"averageUserRating": 4.5,
"userRatingCount": 46621
}
]
}
I found a third-party service which allows do this.
Appfigures. In docs they have the type of product inapp. Service may return price and currency. It looks like that I need.
But need to check it in practice.
If somebody know other service which possible to do that, please, share them. Thanks!

What is difference of "Posted video" and "Uploads" in YouTube Channel? And how to get them through YouTube Data v3 API?

I am in the middle of developing a YouTube client using YouTube Data v3 API, and is playing with two different channels observed:
Go Pro Channel: https://www.youtube.com/user/GoProCamera/videos
YouTube curated Sports Channel: https://www.youtube.com/channel/UCEgdi0XIXXZ-qJOFPf4JSKw/videos
In Go Pro channel, I can also choose a video filter: "Uploads", "Liked" and "Posted Videos". I am much puzzled by the "Uploads" and "Posted Videos" filter, which from my observation, on this channel, they are giving the same result. But in YouTube curated sports channel, there is only "Posted Video" option there.
For the past hours, I can not find any definitive explanation from YouTube v2/v3's API documentation, and what is more bothering me is, I can not find any API to retrieve the video entry data in those channels.
For Go Pro Channel, I could at least rely on the method mentioned here to get uploaded video: How do I get a list of uploaded videos for a certain channel with the new YouTube Data API (V3)?
But for curated channels, even this method does not work, the playlist given in channel query result is always empty:
Request
GET https://www.googleapis.com/youtube/v3/channels?part=id%2CcontentDetails%2Csnippet&id=UCEgdi0XIXXZ-qJOFPf4JSKw&key={YOUR_API_KEY}
Authorization: Bearer ya29.dwCMU6xpf5N9AxwAAABgIM94lgv7jGHw0h0oEjs6uZUdPFO28CDYhbvgXdKTjw
X-JavaScript-User-Agent: Google APIs Explorer
Response
200 OK
- Show headers -
{
"kind": "youtube#channelListResponse",
"etag": "\"WFPuK6TsnblcGPcnMex79s42ynQ/qpdedwjxXQ-COrk0dODO-8DTAx0\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#channel",
"etag": "\"WFPuK6TsnblcGPcnMex79s42ynQ/TP96YXZ0G4VPdQ7fd2IYgW79rW0\"",
"id": "UCEgdi0XIXXZ-qJOFPf4JSKw",
"snippet": {
"title": "Sports",
"description": "Sport is all forms of usually competitive physical activity which, through casual or organised participation, aim to use, maintain or improve physical ability and skills while providing entertainment to participants, and in some cases, spectators. Hundreds of sports exist, from those requiring only two participants, through to those with hundreds of simultaneous participants, either in teams or competing as individuals. Sport is generally recognised as activities which are based in physical athleticism or physical dexterity, with the largest major competitions such as the Olympic Games admitting only sports meeting this definition, and other organisations such as the Council of Europe using definitions precluding activities without a physical element from classification as sports. However, a number of competitive, but non-physical, activities claim recognition as mind sports.\nThis channel was generated automatically by YouTube's video discovery system.",
"publishedAt": "2013-12-15T20:39:04.000Z",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/i/Egdi0XIXXZ-qJOFPf4JSKw/1.jpg"
},
"medium": {
"url": "https://i.ytimg.com/i/Egdi0XIXXZ-qJOFPf4JSKw/mq1.jpg"
},
"high": {
"url": "https://i.ytimg.com/i/Egdi0XIXXZ-qJOFPf4JSKw/hq1.jpg"
}
}
},
"contentDetails": {
"relatedPlaylists": {
"likes": "LLEgdi0XIXXZ-qJOFPf4JSKw",
"uploads": "UUEgdi0XIXXZ-qJOFPf4JSKw"
}
}
}
]
}
--
Request
GET https://www.googleapis.com/youtube/v3/playlistItems?part=id%2CcontentDetails%2Csnippet&playlistId=UUEgdi0XIXXZ-qJOFPf4JSKw&key={YOUR_API_KEY}
X-JavaScript-User-Agent: Google APIs Explorer
Response
200 OK
- Show headers -
{
"kind": "youtube#playlistItemListResponse",
"etag": "\"WFPuK6TsnblcGPcnMex79s42ynQ/0ky7gu-r2KEON6-qkmzKhU77B-Q\"",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": [
]
}
It seems to me this is a dead end now, so is there any way to get videos from this kind of curated channels?
If you've already got the channel ID of the curated channel, you can just use the search endpoint to get the videos; for example, this API call will receive the 50 most recent videos added to YouTube's sports channel:
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCEgdi0XIXXZ-qJOFPf4JSKw&maxResults=50&order=date&key={YOUR_API_KEY}

trying to get youtube videos to play in an iOS app but none of the rtsp links are working

So I want to have a thumbnail of the video (that part works) and when the user clicks it, it plays the video full screen. I'm trying to put it into an MPMoviePlayerViewController. But I've tried both the h263 and the mpeg4 rtsp links and they fail (which actually crashes the app). But I've tried them in quicktime on my mac also, and they fail to load.
What's the secret?
Here is some example data:
"from_name": "epicmealtime",
"from_id": "epicmealtime",
"from_image_url": "https://i2.ytimg.com/i/Yjk_zY-iYR8YNfJmuzd70A/1.jpg?v=50cba2b0",
"message": "Bacon Beer Can Chicken - Epic Meal Time",
"create_time": 1364281243.0,
"post_id": "7DycWLAAEwY",
"post_type": "YouTube",
"description": "We like our chicks when they're drunk! NEW episodes of EpicMealTime every Tuesday, NEW episodes of Handle It every Saturday!!! Watch Episode 1 of Handle It! ...",
"video_thumbnail_url": "http://i.ytimg.com/vi/7DycWLAAEwY/default.jpg",
"rating": 4.8826127,
"h263_video_url": "rtsp://v7.cache5.c.youtube.com/CkULENy73wIaPAkGEwCwWJw87BMYDSANFEgGUgZ2aWRlb3NyIQGy7tHqcQHgzgWNsIjcB4KCDvPB7EI6RNWvHdRsUJxg5gw=/0/0/0/video.3gp",
"mpeg4_video_url": "rtsp://v7.cache5.c.youtube.com/CkULENy73wIaPAkGEwCwWJw87BMYESARFEgGUgZ2aWRlb3NyIQGy7tHqcQHgzgWNsIjcB4KCDvPB7EI6RNWvHdRsUJxg5gw=/0/0/0/video.3gp"
Thanks so much!

Resources