javascript to discover .flv url from any embedded flash video? - javascript

Is there any javascript library out there that can find the url to the flash video file (.flv) on current page where it has an embedded flash video player? Ex. opens collegehumor.com video link, shows flash video url.
I have been looking through codes from chrome extensions which discovers flash video links for download but no dice.

Browser extensions can look into Flash internals and monitor your HTTP activity to see where data is being pulled from, however Javascript running in the document does not have permission to read either of those.
Some Flash apps expose some of their internals to Javascript, but they need to specifically write in that functionality, and for third parties this would be documented, presumably as an API. As far as I can tell, collegehumor doesn't provide any of that.

Related

How does Spotify mask the audio URL and also prevent download of song mp3

I'm looking to mask the audio playing on my site so people can't download the audio files and also don't know what the url for the actual file (mp3) is
Simple answer,
YOU CAN'T
If they are listening to your audio, they have it already
You can slow them down but can't stop them.
The only thing you can do is obfuscate the process. But why bother at all?
The browsers were designed to: Serve content - which means give the content to the user. To show you how easy it is, here's how I usually grab video/audios on virtually any streaming site:
Prepare the network tab of your preferred browser debugger and let the video/audio load. Then look for it in the loaded resources. Videos are usually streamed in .flv or .mp4, and audio in .mp3. When you spot the url, open a new tab/window and open the link there. The browser will then download the file.

chrome extension: how to mute all audio from certain tab

I have been searching for something in chrome extension reference to find anything that would allow me to manipulate audio level of a tab. Only option that has come to my mind is make script have it go through all elements in page and either remove them or mute them if possible.
But i feel there has to be a way to reroute all audio streams to nothing, like break them from output which is speakers if using audio api of html5...however no avail either with chrome extension apis or web audio api.
Goal: mute all sounds on page (flash, audio element, etc.)
You cannot do this now, although this will hopefully change in the near-term future.
At the moment, there is nothing in the Chrome APIs, although I did propose a tabaudio API back in February (and am working on a new draft -- as well as an implementation -- right now.)
Can you give me an idea as to what you want this functionality for? (They ask for potential uses when proposing APIs.)
Perhaps the closest that you can do is something similar to what the MuteTab Chrome extension does (written by me, http://www.github.com/jaredsohn/mutetab), which basically scans the page for object, embed, audio, video, and applet tags and hides them from the page. Unfortunately, this misses web audio. Also, instead of muting, it "stops" it by removing it from the page, which could block the video or game associated with the sound. Alternatively, if you just care about HTML5 video or audio or Flash that has an API (such as YouTube), you could could use JavaScript to pause or mute things.
There's now a Chrome extension allowing to mute websites by URL using blacklist/whitelist approach called "Mute Tabs by URL".
It does require you to allow it to read your 'browsing history', but description swears that it doesn't store your URLs anywhere, and event points to a location of source code, so you can verify it for yourself

Third party video detection with javascript?

I am building an HTML5 video player with a fall back to flash. The problem is that the videos are served by a variety of third parties.
Some of the third parties are serving the video based on user agent.
e.g the url will look like this
http://www.vidserver.com/files/video?key=XXXXXXXXXX
If you are on iOS it will serve mp4, which works fine.
But some third parties are only serving flv to desktop. This means I cannot easily fall-back to flash and will have to force the fall-back with javascript.
Is there a way I can test a url with javascript to determine what video will be served?
Can you use a XMLHttpRequest to fetch the page and look at what's returned?
See an example here.

Can I play iTunes song previews in an HTML page?

I need to show on my site search results from the iTunes Store, including previews of audio tracks.
I could use the iTUnes search api to return JSON info with cover image, title and other info. But for previews url I have problems (like following http://a5.mzstatic.com/us/r1000/007/Music/2f/18/8c/mzm.dsmmvsnn.aac.p.m4a).
It is not direct link to file but to some streaming server (not sure it is RTSP, network sniffer shows some other). It could not be dowloaded directly by browser, flash and HTML5 players don’t support it, and it couldn't be opened even using QuickTime Player. So I haven't found any way to embed it to site web page like I do for regular audio/video links.
The only program that could open such urls is iTunes. But as far as I could see it couldn't be used as embed/object in browser/web page.
Any ideas how it could be implemented?
As far as I understand iTunes not allows previews to be played for countries with no iTunes store.
So preview plays in Itunes application and not in quick time or any other player. So such case really difficult to catch (if it will not play in itunes app it will be clear and easy to detect, but in this case not).
After using proxy or just testing from other location all become working. And could be integrated using many flash players.

how to intercept flash contents requests

I am writing a small JavaScript to download videos from a site. The site doesn't contain the link to the file to played. It downloads a flash file from which the flash file requests a URL to the file on remote server.
So finally when embedded flash opens a URL, how can we intercept/capture the URL request?
It's impossible to intercept any content from Browser Plugins through JavaScript, since you don't have full access of Web Browser API (the case of embedded JavaScript via script tags or bookmarklet).
If you make Firefox extension, you can act like Firebug or DownthemAll (Media-Sniffing mode, see https://github.com/nmaier/DownThemAll/blob/master/modules/support/contenthandling.jsm)
There only one alternative. Reverse engineering location of video, for example read flashvars, but some website like youtube are more complicated.

Categories

Resources