Getting a rating for a song with Apple Music API - ios

I am trying to get the rating for a song via the Apple Music API, as it describes here.
Hence, the URL I am using is:
https://api.music.apple.com/v1/me/ratings/songs/493341471
493341471 is the playbackStoreID (of the MPMediaItem) of the song 'Born to Die'. I have this song in my library, and I have added it to my "loved" list both on iTunes on my computer and on my iPhone. Yet, when I make this GET request, I get back a 404 Resource not Found error from Apple.
I also tried the same url but using the MPMediaItem property persistentId (its persistentID is 2932020188133715832), and that didn't work either.
The documentation says the url format is
https://api.music.apple.com/v1/me/ratings/songs/{id}
and their example gives a 9 digit id, exactly as the playbackStoreID I used above.
I tried searching the Apple Music catalogue for this song, and the id that was returned was indeed 493341471.
Yet, no matter what I do, I get a resource not found. Anyone have any idea what "id" the documentation here may be referring to?

Seems like you have to like/dislike a specific song with your apple music account then you can get an HTTP 200 response.

Related

YouTube data API change video id

I need to change video I'd, so the URL got changed. Is it possible? As far as I can see from docs - its not supported... So is there any other way to change video URL programmatically?
Example:
When I uploaded video i received URL: youtube.com/watch?v=EMSGJdnDN8U Now (next day) I want to keep uploaded video on server, but i don't want URL youtube.com/watch?v=EMSGJdnDN8U to be available anymore, but the original video should be available on youtube.com/watch?=nEwUrL100500 (new url) and so on...
Of course I know that i can reupload video and delete original one but i dont like that solution.
Sorry, I don’t think so. The video id is a very important identifier for YouTube and it’s very unlikely that they give you control over it.

How to get video id from new share url pattern

I see YouTube app updated new function to share videos with the url like this:
https://www.youtube.com/shared?ci=8A940MXKFmQ
My app is using YouTube API/videos/list to get video informations and it required the Video ID field.
How can we get youtube video id from the url above.
Thanks
This is maybe not a good way to do it, but since there seems to be no API for that, check this:
https://github.com/rg3/youtube-dl/commit/4080530624eda994d535e1a01c38ddd6d9aa3805
What they do is fetching the content and search for the meta tag with the name videoId. Again: Not a good way, maybe this approach stops working in a month or a year or maybe never.

Getting twitter user's actual name, not screen_name

Using Twitter's API, I am able to get the list of tweets and so forth in the following format:
#Beyonce | I released a new music video today, check it out!
I am using "#{$status->user->screen_name} and that works fine, however I wanted to get the name of the account, ie in this case it would be Beyoncé Knowles.
I can't find anything that specifies in the documentation which parameter gets the name so I could use the following format:
Beyoncé Knowles #Beyonce | I released a new music video today, check it out!
Whoops, never mind! Just found it ;)
Use {$status->user->name}

Is it possible to set the content rating using the YouTube .NET API w/ Direct Upload?

If I'm upload some items that should have a content rating, how can I set that via the API?
Here's some tidbits of the code:
Dim newVideo As Video = Nothing
newVideo = New Video()
newVideo.Title = title
That's a part of it, can we set the rating ourselves within the API or is that functionality not there yet?
Also, if a video is blocked or flagged worldwide, do YouTube provide that in the upload successfully response, if a video uploads okay, I can get the ID, but can I also check to see if there's any complaints? I will ignore the Duplicate response for now. But I am more worried about the flagged or block as you only get three strikes.
Setting content rating isn't supported via the API.
If a video is not playable for any reason, including the reasons you mention, it will have an explanation of the problem in yt:state:
https://developers.google.com/youtube/2.0/reference#youtube_data_api_tag_yt:state

fbcdn An error occurred while processing your request

Some videos uploaded to facebook using iOS Facebook SDK give me the error "An error occurred while processing your request"
Checkout this fbcdn video
I'm trying to play that video on a MPMoviePlayerViewController. Some videos work fine, some videos just don't. The video plays just fine on Facebook, so it's not something related to its data.
Can't find any documentation about what this error is related to.
I came across this error page too, on the iOS on an iPhone 4 when using the Facebook app.
To play the video even if it comes up expired, locate the post you want and instead of tapping on the embedded video, choose the post date. If the post reads:
John Doe shared Jane Doe's video: December 1, 2012 at 9:30pm.
...then you tap the date & time on the post -the "December 1, 2012 at 9:30pm" part- and it will take you to the video without using the expired link. The video should play that way.
Good luck.
This means the link to the video is expired, usually it works for a 2 days period then it gets expired and you have to query the facebook graph API again to get a new link.
I replaced 'v' with 'embed' in url. It worked.
VideoUrl = VideoUrl.replace("/v/", "/embed/")

Resources