Run script when YouTube channel goes live - youtube

I want to run a specific script to check some data of a YouTube stream, like title and description, when a specific channel goes live. I'm very open on how to do this, if there already is a program that can write the YouTube live video id and title to a text file, when the stream starts, for example that would work.

You can use combination of YouTube API with shell, or execution programming language while true and sleep for each times you like.

Related

pull playlists/video from youtube by scraping or parsing the video id

my job has a youtube channel were we put our tutorials on. However we want to also put the tutorials on our company website. I know we can use the embed and embed every single one, but we don't want to have to do that every time we make a video. Is there a way that when you create a video on youtube that another website can automatically pull that video onto our website?

How to get #EXT-X-ENDLIST event when playing HLS content?

According to "Example Playlist Files for use with HTTP Live Streaming: Basic Variant Playlist", it describes snippet text below :
Note: A variant playlist is not re-read. Once the client has read the variant playlist, it assumes the set of variations isn't changing. As soon as the client sees the endlist tag on one of the individual variant, that ends the stream.
but I could not find related APIs to get event for "endlist tag" occur.
Does any one has suggestion to get this event by delegate or function?
Thank you !
Web
Safari will just fire the ended event on the HTML5 video element when playback finished.
If you are using third-party players like hls.js or Bitmovin Player you may want to check their API; Most of them provide cross-browser convenience functions for this.
Apps
For native apps on iOS the AVPlayerItemDidPlayToEndTimeNotification event might be what you want to look at.

YouTube live streaming captions - more than one language

I'm currently live streaming a tv channel (beta phase yet) using YouTube.
How do I add captions in more than 1 language for a live stream (with POST caption URL)?
Even using just one language captions, how can I change the language? (The only option to the user - on web or app - is "EN" even if the caption is in other language)
When using POST approach do send captions on live streams how/where to set/define duration of each subtitle?
Please don't refer this url link. I know it already.
AFAIK you can do only one language, if any at all. I have tried using the POST method YouTube describes on the page you link to - without success. Only get
Result 299: "Error donwloading [...] Can't parse HTTP POST body."
Tried searching all kinds of support forums, but it seems no one has any advice and YouTube never replies to questions related to live caption. Including here...
According to the docs on contentDetails.closedCaptionsType, you can embed captions in your video stream using the option closedCaptionsEmbedded and provide EIA-608 and/or CEA-708 formatted captions in your video from your encoder.
Sending multiple caption tracks muxed with your video with different languages specified by the "Language" tag on the caption stream should allow the user to switch between different captions in the web player.

Can't Download from youtube

I have a script that downloads mp4 files from youtube. What it does is to generate link of the form http://youtube.com/get_video?video_id=*VIDEO_ID*&&t=*THE_TOKEN*=&fmt=18&asv=2, but it doesn't work anymore (noticed it today). What do you think?
Instead of trying to use get_video to get the video, try parsing fmt_url_map (format-url map) instead.
You should be able to find the fmt_url_map in the same place you found the token (like in the flashvars of the YouTube flash video player or inside the YouTube page somewhere). If you can't find it, send a request to http://www.youtube.com/get_video_info?video_id=VIDEO_ID and you should get a really long result that is in the format of name=value&name=value&... Find "fmt_url_map" inside this result (search through the result for a string that starts with "&fmt_url_map=" and ends with "&").
After you get this value (you may have to url-decode it), it will be something like (without the line breaks):
22|http://blah.youtube.com/videoplayback?blah,
35|http://blah.youtube.com/videoplayback?blah,
...
where each comma-separated entry starts with the fmt value (22 or 35 in the example), followed by a pipe character, which is then followed by the URL where you can use to download the video in that format. (This URL is client-specific, so a URL for a certain client most likely won't work with another client due to YouTube checking IPs. Also, the URLs do expire after a while.)
For a list of the different fmt values, see: http://en.wikipedia.org/wiki/YouTube#Quality_and_formats and show the "Comarison of YouTube media encoding options". NOTE: not all formats may be available for all videos.
Deprecated: won't work anymore!
If you want to download to a server you can use youtube-dl which still works.
Well it seems like they have removed the fmt option. See http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs.
I've created a node.js server that can stream YouTube videos directly to the client and it works. See https://github.com/licson0729/node-YouTubeStreamer for details.

How to add YouTube videos to watching queue?

I have a list of youtube video links on a page. I want to let user mark interesting ones, programatically add them to a watching queue, and then forward a user to YouTube where they can watch all those videos in sequence. Is it possible?
I dont think youtube has a feature to access yt quicklist etc, but you can easily do it with youtube javascript api, if is it ok that the videos gonna be played inside your site.
http://code.google.com/apis/youtube/js_api_reference.html
Embed a youtube player with js api in your site, then you can make a simple js array for queue.
If this solution is ok for you, i gonna write some more details about it, if you're interested in.

Resources