When you right click on the video and say "show video info", there is popup that shows fps, frames dropped etc in real time with a timestamp.
I tried to look in the API documentation but couldn't find how this data could be retrieved.
I would like to store this realtime video info data in a file and do post analysis based on time to understand video streaming quality.
Thanks in advance.
You're going to have to use the new v3 API. You can sign up for a YouTube key here: https://console.developers.google.com/apis/api/youtube.googleapis.com
Documentation: https://developers.google.com/youtube/v3/docs/videos/list
To get the actual video info you can then use this URL:
https://www.googleapis.com/youtube/v3/videos?id={VIDEO_ID}&part=snippet%2CcontentDetails%2Cstatistics &key={YOUR_API_KEY}
Note that this answer no longer works. See Dex's answer below.
All the data an app can see about a video is parsed in XML (or JSON if you prefer) using this URL:
XML: http://gdata.youtube.com/feeds/api/videos/###########?v=2
JSON: http://gdata.youtube.com/feeds/api/videos/###########?v=2&alt=json-in-script
Just replace ########## with the ?v= numbers of your video. For instance: http://gdata.youtube.com/feeds/api/videos/rznYifPHxDg?v=2
Related
I've been preparing POC to integrate our music service with SONOS, I've written simple service for testing purpose. I've implemented three essential methods to play url "getMetadata", "getMediaMetadata" and "getMediaURI".
First I've tried with media type "track" and returned song url(hard coded) from "getMediaURI" method which is .mp4 format, It worked fine as expected.
Later when I've tried with 7-digital url playback fails by saying "These Songs are not available for Streaming from "APPNAME". I've tried changing mime type values also nothing seems working. Type : audio/x-m4a
Note: Same 7 digital url is playing fine on browser.
Am I doing anything wrong here? Am I missing anything? Any help is really appreciated.
Thanks.
Looking at the documentation on Sonos' developer website, it doesn't seem like that audio/x-m4a is a supported MIME type. Do you know the audio format of 7-Digital's track for sure? If its mp4 or m4a, I would try setting the MIME type to one of these - audio/mp4, audio/aac,
application/x-mpegURL, application/vnd.apple.mpegURL, audio/x-mpegurl
Also make sure that your track's sampling is supported as described in the table at the link below.
Link http://musicpartners.sonos.com/node/464
the only slightly helpful thing I could find regarding LiveLeak API was this Question on Stackexchange: CURL: grabbing liveleak video
If I only have got the Video URL (e.g. http://www.liveleak.com/view?i=numbered_videoid), is there a way to get video meta data without pulling the whole page? xml or json ideally?
Thanks!
LiveLeak's 'API' is at best their RSS Feeds.
The best I could do was to download the 'internal' page for a certain videoid by appending &ajax=1 to the url:
http://mobile.liveleak.com/view?i=100_1338007444&ajax=1
This saved 10.06 KB of bandwidth (about 32%).
Here is the original URL to get the xml awnser:
http://gdata.youtube.com/feeds/api/users/RIPPERvideos/uploads
I would like to get all the videos uploaded by this specific user (not be limitted to 20). Also I would like the data to be sorted.
I tried these params:
http://gdata.youtube.com/feeds/api/users/RIPPERvideos/uploads?orderby?v=viewCount
It only seems to be working for these kind of request:
gdata.youtube.com/feeds/api/videos?
q=football+-soccer
&orderby=published
&start-index=11
&max-results=10
&v=2
Can someone help or guide me?
thanks
The URL structure isn't correct, try this (which works):
http://gdata.youtube.com/feeds/api/users/RIPPERvideos/uploads?orderby=viewCount
I learning Objective C, and I am going to develop some apps. I have a general question: How to get text information from the Internet into your app. Say you want the current title of Yahoo News. Do I need to use some PHP, or are there Objective-C specific classes to choose from?
Help is appreciated (code as well!), just anything that can help me take te step to exploring the new possibilities!
If I understand your question, I'd say the best way to do it would be to get the HTML source from the URL of your choosing as a string, then parse it to grab an attribute such as the title. Have a look at NSString and NSXMLDocument; they both let you instantiate them from a URL.
Here's a great way to do it:
Go to Yahoo Pipes, and create your "pipe" (basically a feed of one or many different data inputs on the web).
Publish: Select a format for Yahoo to host, for example as an RSS feed or in JSON.
UIWebView can then point to your pipe's URL. (Here's a tutorial on UIWebView)
Done.
Note that you can choose to get the feed as RSS, JSON, and other formats as well. Here is an example of a pipe I set up for the National Vulnerabilities Database as RSS, and the same feed as JSON.
ASIHttpRequest Will keep you sane.
I'm look at a way of turning an iTunes podcast id into the RSS feed that the podcast producer serves.
I'm aware of the RSS generator, which can be used to generate a feed of links to podcasts, but these links are to HTML pages.
If you have iTunes open, you can manually export the list of podcasts by exporting to OPML, so we can surmise that iTunes eventually knows how to decode them (i.e. they're not exclusively going through an iTMS host).
I have looked at the Affiliate API document which gives you some nice JSON back. This gives you a collectionViewUrl which is the same as the ones given in the RSS generator, and incidentally, the iTunes Link Generator. It also give you the id, and a whole load of other things including a preview audio file which is not hosted on the phobos.
At this point, I'm looking for anything that would help me solve this question, including any language, unofficial or not.
(in actual fact, I'd prefer something vaguely supported, and in Java, that didn't involve HTML scraping).
Through a combination of answers from these two questions, I have found a way to do what I want.
Example of finding podcasts
First: grab a list of podcasts from iTunes, using the RSS generator. I'm not sure how the query parameters work yet, but here is an RSS feed for top tech podcasts in the US.
http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/toppodcasts/sf=143441/limit=25/genre=1318/xml
sf relates to country, and is optional. I would guess that this defaults to global if absent.
genre relates to genre, and is optional. I would guess that this defaults to "all genres" is absent.
limit is optional, and seems to default to 9.
This gives you an Atom feed of podcasts. You'll need to do some sperlunking with XPath to get to the ITMS id of podcast, but you're looking for the numeric id contained in the URL found at the following XPath:
/atom:feed/atom:entry/atom:link[#rel='alernate']/#href
For example, the excellent JavaPosse has an id of 81157308.
The Answer to the Question
Once you have that id, you can get another document which will tell you the last episode, and the original feed URL. The catch here is that you need to use an iTunes user-agent to get this document.
e.g.
wget --user-agent iTunes/7.4.1 \
--no-check-certificate \
"https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/com.apple.jingle.app.finance.DirectAction/subscribePodcast?id=81157308&wasWarnedAboutPodcasts=true"
This is a plist containing some metadata about the podcast, including the feed URL.
<key>feedURL</key><string>http://feeds.feedburner.com/javaposse</string>
The XPath for this could be something like:
//key[#text='feedURL']/following-sibling::string/text()
Disclaimer
Not entirely sure how stable any of this is, or how legal it is. YMMV.
As soon as you have the id you can use it in lookup as defined in
https://performance-partners.apple.com/search-api
You should get what you need by parsing the response with JSON
To elaborate on #juhariis' answer, here's the basics of extracting the feed url from the json (python3):
from urllib.request import urlopen
from urllib.parse import urlparse
import codecs
import json
podcast_url = 'https://itunes.apple.com/us/podcast/grow-big-always/id1060318873'
ITUNES_URL = 'https://itunes.apple.com/lookup?id='
parsed = urlparse(podcast_url)
id = parsed.path.split('/')[-1][2:]
reader = codecs.getreader('utf-8')
with urlopen(ITUNES_URL + id) as response:
feed = json.load(reader(response))['results'][0]['feedUrl']
print(feed)
Here's a script/module I made, that makes use of this: https://gist.github.com/theychx/f9fad123bef27bebac665847c7884cd9
I searched for a long time to deconstruct the iTunes podcast feed. It's a plist containing meta data, of which one of them is an RSS feed. My blog post How to subscribe to iTunes podcasts on Android has links to code in php and in javascript to extract the URL to the RSS feed from an individual iTunes link.