YouTube API v3.0: How do you determine if a video is 'pay-per-view'? - api

I am using the YouTube Python API (v3.0) to query YouTube with specific video IDs, and I would like to know which ones of the videos listed in the results are paid-content (there are some TV-shows in there).
I have gone through the 'video' object parameters (https://developers.google.com/youtube/v3/docs/videos), but I have not been able to find anything useful:
'contentDetails.licensedContent' flag does not seem to match non-free videos
'status.license' seems to be almost always set to 'youtube'
'status.embeddable' also does not seem to depend on free/not-free
Any suggestions or solutions are welcome!

There's no field in the youtube#video object that represents whether a specific video costs money. You could use a rough proxy, like the presence of youtube#video.contentRating, as a clue that the video might be something that's television/film content, but that doesn't necessarily mean that it's paid content.

Related

Sonos Api: Is there a way to understand which Sonos favorite is playing?

I want to understand which favorite playlist is currently playing on my Sonos speaker.
I've tried the following options:
There's no favorite ID in playbackMetadata and in playbackStatus. So, matching with favorite ID doesn't work
There's containerId in playbackMetadata, which sort of gives information about provider-specific playlist identifiers. Yet, there's no same identifiers in getFavorites response. So, matching containerId won't work either.
Tried loadingFavorite (both with and without playOnComplete set), then getting playbackMetadata in order to build a mapping of favorite ID to containerId. No luck either. Even with 2s delay between two calls to give some space for favorite to be loaded, playlistMetadata returns old containerId (or it might be new, only it doesn't get changed for a new favorite).
Is there a straightforward option? Or not that straightforward, but working?
It is not possible, at least at the UPnP level. When a Favorite is submitted for playback, nothing is included that would allow tracking it back to its origin.

Twitter API Standard Search: Can I get hidden replies?

I am trying to get as much data as a I can out of the Twitter API for an academic research project. Even though I only have access to the Standard API the data should be as accurate as possible. I am building myself a "wrapper" around Twarc and other utilities in Python that gets me most of the data I want in just the format I need. A big problem was getting all the replies, but I was able to solve it with a bit of trickery: Searching from the tweet in question onwards and then checking if the tweets in the obtained sample have the original tweet ID in "in_reply_to_tweet_id". Rinse and repeat with those newly obtained tweets.
Then I noticed the new moderation feature Twitter implemented in March. Now the moderated comments under "More replies" do not show up in my search output.
Example: https://twitter.com/NDRreporter/status/1113353224730365952
I find all replies except the following: Under "More replies" ("Mehr Antworten" in German), there is a reply chain started by a extreme right leaning (possibly troll) account ("#Der Steuerzahler") that got moderated and shoved down there. This does not show up in API searches, even if I let the code iterate for over an hour just looking for replies to this particular original tweet.
My question is pretty general: Aside from getting replies as they come in (i.e. before they are moderated) via Filter API, is it possible to find these moderated tweets via the Standard Search API? Not looking for a ready-made solution, general pointers suffice. If I can't find them via Search, then I obviously won't try it with that anymore.
Thanks in advance.

How to find only original tracks on soundcloud

I am using soundcloud API for a project but the problem is I get remix of the original songs or cover version, its okay if I get remix and cover version but is there any mechanism that the original one comes as first song in the search result ? I tried searching on Google and read the API documentation but found nothing in this context.
The track object in soundcloud's API actually has the track_type property which has possible values of 'original' and 'remix' among other things. Sadly like most valueable metadata the track object has, content providers neglect to fill the field. So unless content providers start putting more effort into filling in the metadata fields the only option you have is giving songs priority based on words in the title or tags.

instagram api search hashtags isn't reliable - so can I do this?

I'm looking to somehow tell users to upload a picture and do something, either tag or # our company so we are notified in real time, i just need to fetch the url of the photo that was uploaded and tagged or # or ANYTHING.
the hashtag search doesn't seem to work correctly, i've tried multiple hashtags and they wont retrieve them in any type of real time or at all.
the real-time subscription only notifies me that there is a new photo tagged that i subscribed to, so i have api search for a list of new media with that tag, which goes back to point 1, its not accurate or reliable.
so do i have any options at all on instagram?
If not do I have any options on facebook? any real time keyword search to grab the url of the photo they uploaded with a unique tag.
Check out https://github.com/chapmanu/hummingbird, it might be what you're looking for.
My experience with the Instagram Real-Time API is, that it is rather reliable.
When you get a real-time ping and then call the endpoint for your hashtag, the results are ordered newest first.
You can then paginate until you hit the last known result.
Maybe this tutorial helps: http://www.mtrinitaria.com/mykhel/tutorial-instagram-real-time-photo-update-api-with-php/

Instagram: sort photos with a specific tag with most likes

I'm running a contest on the web where the image with the most likes wins. It's tiresom having to go through 900 images manually so what I want to do is, sort all images with the tag lets say #computer after the amount of likes, with the most liked pics on top. I have searched the net like crazy for some program or site that does this (ExtraGram, gramhoot, statigram, webstagram) but none offer to sort by amount of likes and it drives me INSANE! It's a really relevant request.
I've tried istafeed.js but it doesn't include all images, actually it leaves out the ones with the moest likes which defies the purpose.
There's nothing I know of in the Instagram API that sends back media sorted by likes in advance. I don't think there's a tool to do this either, but writing one is relatively simple IMO and I've done it before for a contest specifically.
The simplest thing to do is to do the following:
Use the Instagram API (via a library or pure REST) to query by tag. For instance, if you only care about the most recently tagged media or you want to process by date, you can use the [/tag/tag-name/media/recent][1] enpoint.
Page through each result page by processing the next_max_id/next_max_tag_id.
Collect the results locally into a database. You will receive the "like" count for each media item. You will have to update the data if you want to track the likes over time.
Sort the results using your database or if it's a small result set, you could skip #3 and just sort in memory.
If you need to refresh the results, you need to subscribe to the Tag via the API. You can give Instagram a URL to then push updates, and then you'll have to retrieve 1 or media items and update them in your database accordingly.
You will of course need to register your application with Instagram to get an API key if you want to do this. Then you can either send them your client_id or use OAuth.
The best way to achieve this is to pull the photos in and then sort them programmatically based on the likes numeric value. I've designed a plugin that does this automatically for you for anyone interested.
Instagram Journal