Suppose I have a video on YouTube that gets the URL https://www.youtube.com/watch?v=vWSyMuKkXXX (not a real video/ID, fwiw). If I delete that video, what are the chances that "vWSyMuKkXXX" will get reassigned to another video that somebody else puts up? 62^11 (is that right?) is a pretty large space from which to be assigning symbols, but YouTube must be doing some uniqueness test to avoid duplicates. The question, I guess, would then be whether they're including deleted IDs in that test (at least, given the way I'm guessing what they're doing internally).
This question is all about how much work I have to do to figure out whether the video corresponding to an ID exists and that it is the video that I think it is -- whether I can get away with using a simple call to http://www.youtube.com/oembed?... , or whether I need to get authentication and the APIs involved (which might still not resolve the question). Any thoughts? Thanks!
If YouTube were to ever reuse IDs, it would cause problems such as old links now pointing to new (possibly unlisted) videos. There is no advantage in reusing IDs, only problems including privacy problems. It would be an ugly bug.
To support unlisted videos, the IDs cannot be sequential. They must come from a large space of possible values.
how much work I have to do to figure out whether the video corresponding to an ID exists
You must send a query to YouTube.
and that it is the video that I think it is
How do you define "the video that I think it is"? By ID? By watching the transcoded video at your current resolution -- where the individual pixels might not match the uploaded pixels?
Related
I am curious to know what would be the most efficient way to walk the youtube website. My goal is to eventually index all videos on youtube (hypothetically) and the only way I can think of is to go channel by channel indexing all of the videos. I am not very familiar with the v3 APi, so if there is a better way to accomplish this, please let me know. This gives rise to a few problems I can think of:
Where to begin? Channels and videos are accessed using random string IDs, so if I simply start with IDs beginning with 'A' I am going to run into a lot of null values. Not sure how IDs are assigned, but this also may keep the indexing in a certain segment/section of video types if it is based on the ID alphanumerics.
I am hoping to move methodically through the youtube directory, trying to avoid accidently indexing the same channel/video.
Should I somehow seperate the videos into groups and request them based on other parameters? A grouped scheme may be easier to work with, update, etc.
I won't know if the video has anything I am interested in indexing before accessing it.
First you need to understand that there are way too many videos for you to do this without having access to the stack directly, which you do not have and will not get.
As to automate the selection of video's, you can try to use the video ID's.
They are 11 characters long, consisting of only "a-z A-Z _ and - " . So that would reduce (still is 54 to the power of 11) the indexing/scanning if a video exists. Then save that ID (with related info) and move on.
Not a perfect option, but best I can see with your options and requirements.
It's been a while since I first started looking into this and I still haven't found any feasible solutions, here's to hoping someone might have some suggestions/ideas...
The situation: We currently have a couple of live streams streaming mixed source content (some of the streams are being streamed as file playlists that are modified to change the files in the playlist, while others are streamed as live video directly from input). For each new live stream we usually just end up setting up a new streamer... it's feels rather counterproductive and wasteful.
The question: Does there exist a hardware or software solution (LINUX or Windows) that would allow to live stream multiple, for example, two (independent of each other) file playlists and optionally one or two live A/V inputs, from the same encoder?
According to my findings, with the help of FFMPEG library, it is possible to stream multiple live A/V inputs and even stream file playlists ... but it requires too much hacking to get it working and playlists have to be redone by hand and restarted every time changes have been made. This might work for me personally, but this won't do for a less tech-sawy people...
I'm basically looking for a way to reduce the computer hardware instead of allowing it to exponentially grow with each addition of a new live streaming source/destination.
Thank you for all your input and all the posted solutions. By sheer luck I found the solution I was originally looking for.
For anyone else looking for this or similar solution, the combo of systems that can combat our unusual requirements (and that can be integrated into our existing workflow by adjusting the hardware/software to meet our needs instead of us adjusting to hardware/software requirements/limitations) are: Sorenson Squeeze Server 3.0, MediaExcel Hero Live and MediaExcel File
I need to get a list of current live broadcasts in a given category from the YouTube Data API, ordered by number of viewers currently watching.
It looks like the liveStreamingDetails (which contains the concurrentViewers property) are only exposed on the individual video level. However, grabbing all the current streams, then making separate calls for each stream to get the number of viewers, then ordering that list is woefully inefficient and costly.
Feels like there must be a better way! Any ideas?
Currently there is no better way. Please file a feature request at https://code.google.com/p/gdata-issues/issues/list?q=label:APi-YouTube to keep track.
I query the YouTube v2 api for category=music videos with safeSearch=strict option set. Previous to 10/03/2013 many music videos were coming through on the safeSearch=strict option, but starting on 10/03/2013 it seems these restrictions became much stricter filtering out many results that it did not yesterday. Is this an error? I don't know where to reach out to YouTube on this. Two example queries:
https://gdata.youtube.com/feeds/api/videos?q=katy+perry+roar&v=2&safeSearch=strict
versus
https://gdata.youtube.com/feeds/api/videos?q=katy+perry+roar&v=2
return different results than it did previous to 10/03/2013. Yesterday the official video was the first result using safeSearch=strict and today it is not. The video is still the same identifier and the content did not change. This is happening for about 85% of content that my query strings have hit today. In my opinion, the content I'm querying is no where meeting their safeSearch thresholds. Can anyone shed some light or maybe point me to some resources I can read up on why this large change happened?
After struggling with getting Ytd to work for a couple of days I'm about to dive into Youtube Direct Lite which looks much friendlier to set up.
My first question is about the playlist size limit. Once a playlist is full (200 videos?) what would happen with further video submissions? Would the oldest be dropped or is it just impossible to add any more, effectively breaking the widget for that playlist?
I expect I would need to use multiple playlists and manually make new playlists and widgets if there's a lot of videos, but is there a best practice kinda way to do this for a large number of videoslso?
Also, would it be possible to automate the submission approvals programmatically if there's a lot of videos or is this beyond the scope of ytd-lite.
Thought it's better to ask these questions now before starting the process of setting this up for my site. Ytd-lite looks like a great project.
thanks.
from the Doc:
https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists#Adding_a_playlist
Note: Playlists contain a maximum of 200 videos. As such, you will not be able to add a video to a playlist that already contains that many videos.
I dont'n try to force this situation but I expect an error.
I believe that to automate the submission approvals programmatically you can modify the source code of YouTube Direct Lite, and with a little logic in the server side of your app you can do what you want.