Missing 'available_countries' information on some track API requests - deezer

Some of the API requests to get track details are missing the array of available_countries in which the track can be played.
For instance this Pink Floyd track:
http://api.deezer.com/track/89569653
But when testing in the API console the available_countries are present for this track ID.
It only seems to happen for some tracks though, for instance the Daft Punk API example does have the available_countries data:
http://api.deezer.com/track/3135556
Is it an issue with the API?

The node "available_countries" is there but empty, so it just means that the track is not available in any country, it is not an issue. If you check directly in our website www.deezer.com/track/89569653, you will see that the track is not available.

Related

Azure data factory pagination doesn't work

I am working on a pipeline which executes oAuth2 flow in order to access REST API json data. Once I have the bearer token I am executing a request which returns the following structure:
As you can see, since the response is quite large, there's paging enabled and as part of the response I get a link to the next page. In order to get to that resource I need to also present MS-ContinuationToken in the headers. So, this is how I basically do it in the config of the Copy activity that I use to get the data from the REST endpoint:
and the issue here is that I only get the first 2000 rows and the next page(s) don't seem to be visited at all. Pipeline executes successfully and only the first 2000 items are fetched.
NOTE: continuationToken and links.next.headers.value have the exact same values from the initial response.
Even if you fix the other issue you’ll have an issue with the “next” URL not including “v1”. This is a known issue in the partner center api team. I’ve escalated it pretty high. But they don’t want to break backwards compatibility by changing the “next” URI to include the v1 or to be relative. They are considering other options but I wouldn’t hold your breath.
I would ditch the idea of using data factory and instead write a .NET console app using the partner center SDK
(You might think to paginate manually with loops etc but the Copy activity doesn’t return eg the http headers, so you will need a complex set up to somehow store the data in a data store and be able to look up the last page in order to get the continuation token. I couldn’t figure it out)

How to get live video id from YouTube channel

YouTube API eventType=live not working, does anyone have an idea why?
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCmyKnNRH0wH-r8I-ceP-dsg&eventType=live&type=video&key=
Without eventType was working fine (but not now):
https://www.youtube.com/embed/live_stream?channel=UCmyKnNRH0wH-r8I-ceP-dsg&autoplay=1
Looks like YouTube changed something in API, search.list really not returning live broadcast since end of last week.
If you have user's access token you can use https://www.googleapis.com/youtube/v3/liveBroadcasts?part=snippet&broadcastStatus=active&broadcastType=all
endpoint to retrieve if any broadcast is live.
If you do not have user's access token, you can try this answer
but i didn't check it if it is working
Anyway this question looks like to be a duplicate of this question
Right now the YouTube API is not working, specifically for retrieving live streams of a specific channelId. In other words if you are setting channelId in the API call, you will get 0 results.
If you're using an API key rather than OAuth (not sure if OAuth works) the only work around at the moment is to use the API to search for a specific title. Here is my query URL below.
https://www.googleapis.com/youtube/v3/search?part=id%2Csnippet&type=video&maxResults=20&order=date&q=My+Uniquely+Titled+Livestream&key=[apiKey]
The results returned by the API will be from all of YouTube. (Note: the rest is done serverside) Put the results into an array and discard any that don't match your channelId. Then check the titles in an array and only get the video ID of the one that matches your desired title. That is the basic logic and it is sort of a rigid work around that won't work for most. But at least it will get you what you need until Google fixes the API.

In the Soundcloud API, is information about a track still available after it's removed due to DMCA infringement?

I'm building an app that utilizes Soundcloud API and we came across a small problem. We archive playlists on our own servers to cut down on the amount of data needed to display tracks. So, for example, a user can create a playlist with tracks from soundcloud but we strip away the data provided by soundcloud to the minimum required to view and play said track. This data includes it's SC_ID, track name, artist, stream URL, etc. But doesn't provide the full data set SC does.
My question:
When songs are removed due to DMCA Copyright infringement, does SoundCloud keep the track ID and information available or does it remove the track entirely? What I mean by this is, say I have a track with ID 123456 and it was removed due to DMCA. Does this track still exist such that I could GET request [SC_api_url]/tracks/123456.json which would yield the track but it would not be streamable nor downloadable?
Correct my logic if I am wrong. I've searched the documentation and the best answer I can get is if you try and request a resource that is not available it throws a common 404 error but the API is not very clear on what happens when tracks are removed due to DMCA violations.
So I reached out to Soundcloud and they said that they are removed from the public facing API.
This means an error would occur if you referenced it.
This is also true for exceeding quotas.
Hope this also helps someone else too!

Soundcloud API - How to get all Favorite Sets?

Is there an official way of getting all Favorites including the favorite Sets of the user or getting all playlists including the favorite sets ?
i tried the following urls but none of them gets the job done:
/me/favorites/sets
/me/sets
/me/playlists
Any Ideas ?
You have to wait a bit, its part of their new API.
Just change the user-id to yours.
https://api-v2.soundcloud.com/users/1672444/likes?limit=10&offset=0&linked_partitioning=1

Order by playbacks when fetching tracks from SoundCloud

I am fetching a list of tracks from soundcloud's API using the following query to retrieve the 5 most popular tracks:
https://api.soundcloud.com/tracks?client_id=XXX&order=hotness&limit=5
But recently SoundCloud removed the hotness order. In the blog post they say tracks can instead be sorted by playback_count. But can this be done in the query or do they suggest I pull down the whole SoundCloud library and order them in the client? The following doesn't seem to work:
https://api.soundcloud.com/tracks?client_id=XXX&order=playback_count&limit=5
So how would one retrieve the top tracks on SoundCloud?
The solution was to use the undocumented calls for the explorer feature that SoundCloud itself uses (I used the dev tools in Chrome to check the AJAX calls).
https://api.soundcloud.com/explore/sounds/category?limit=L&client_id=XXX
This appears to use some sort of sorting on the popularity of the songs. The songs can then be filtered on only music by checking the "grouping" attribute. I then have to resolve the list of IDs to actual songs which can be done with the (documented, official) API call:
https://api.soundcloud.com/tracks?ids=1,2,3&client_id=XXX
This seems to work perfectly and I also get the added benefit of an even distribution among genres. But of course, this can stop working at any moment since the API calls are undocumented and perhaps not meant for public use.
Just wanted to provide an update. It seems soundcloud has moved to v2 of the explore API call.
Use this to get a list of categories:
https://api.soundcloud.com/explore/v2
And this to get tracks from a category:
https://api-v2.soundcloud.com/explore/metal?limit=10&offset=0
So far it seems to without a key, although I have no idea how long that will last.
EDIT: So the 2nd url doesn't seem to allow cross-origin, but so far this does work, though it only returns the trackID not the full information
https://api.soundcloud.com/explore/v2/metal?limit=50&consumer_key=XXX
check here, soundcloud removed order by hotness.
Has order by hotness been removed from Soundclouds API
so, for now, only order by date is possible.