how do i download youtube video through developers tools - javascript

This question is basically more about how does youtube player works...from network activity in chrome developer tools, i can see that something is streaming/octet...so flash player is taking stream and showing it.
But the video also gets cached so how can i download that file. It has to be somewhere. I have searched through internet all examples point to some flv file that doesn't exist anymore and the one that is in network is something else and not what i am looking for, main video file.

Summary: (I'm skipping some basics, assuming familiarity with chrome-like dev tool panels) Visit network tab, search 'video' or 'audio', find a request videoplayback?..., copy its request link, remove range=... params, paste into browser. See more details at https://www.hongkiat.com/blog/download-youtube-media-without-tools

Related

How to get webcam feed in chrome extension persistently when chrome is open?

I am trying to make a chrome extension where I need access to the webcam feed once the user has allowed permission and has toggled on button in the extension popup. The feed should (and the extension) should keep running persistently until the user has stopped the feed via the control in the popup or has exited chrome.
Unfortunately, there's not sufficient information as to how to do this, let alone access webcam from the extension. I did read the related answer where its mentioned to use content scripts but there's no example code for it. (And no documentation as well).
Also, unfortunately I don't have enough working code to give insight of my progress.

Is it possible to detect whether a browser tab is playing audio or not?

I am looking for a way to detect whether a sound is being played in the current tab of Chrome. I would like to emphasize that the context is a web app and not a chrome extension nor a single audio element. My assumption is that the browser "knows" that the tab is playing sound by displaying an audible icon in the tab header, so I am guessing that there is some kind of browser HTML5 API for that.
Simple answer: no
Long answer:
Some-what-ish would be the best case in this context.
Chrome has a dev-only API for it's browser that hooks on audio devices connected, but it's not possible to use this in a real environment. (source)
The chrome.audio API is provided to allow users to get information
about and control the audio devices attached to the system. This API
is currently only implemented for ChromeOS.
There is also an interesting solution answered by Jared Sohn, the principle is that a plugin (should be web possible as well) scans the webpage for files playing audio. You could rewrite something like this for your webpage (by grabbing all possible sources for audio and checking them individually). (source)
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

Playing audio and streaming issues in Chrome

I have made a music player by JS. However I have noticed that in Chrome it does not load some songs, basically any song except the one that loaded with the page.
Using inspect tool, I noticed the http request stays in "pending" status and never load the track. even tho the song is in the right folder.
if the song playes if i put its full address in the browser: www.site.com/music/song.mp3
but it does not load it in the music player.
I tried to stream songs from other websites and the player in Chrome works perfectly, such as this: https://media.rdjavan.com/media/mp3/Masih-Arash-AP-Be-Hame-Begoo.mp3.
The above address works fine n the player, so somehow it is streamable.
In safari it works fine, basically it is slow since it has to download the song but then it works. But in Chrome it stays in the status and never loads.
I was wondering is it related to MIMEs? or does my code have to do something with servers? I have tried it on an actually server and also on Xammp and both have same result. I have not fixed htaccess but it seems unrelated to my issue.
UPDATE:
I have noticed that Chrome is even slow in loading the directories. for example it takes ages of chrome to open localhost/AudioPlayer/audio/. So i believe it is a similar problem to why my music player does not load tracks.
Any idea?
jPlayer songs not loading correctly using MVC method
Look at the answer I gave in this thread above. This may or may not be your problem.
I had problems with chrome and my music player, you have to allow content-range requests.
These are enabled default in other browsers. Reason why it works in .mp3 url's is because it's using default <audio> </audio> tags which support content-range requests I think

How to use youtube API in firefox extension?

My question concerns running script that exists on the page the user is loading. For example on a youtube video if you go to the console and type:
player = document.getElementById('movie_player');
You can then interact with the player by using :
player.getDuration();
or
player.playVideo();
But I searched and researched for a way to do this from a firefox extension and all I could find find was a reference to XPCNativeWrapper but no real solution.
So let's say I want to get the video duration from the firefox extension, in my main.js code I use page-mod to detect a youtube video page loading. Then in the contentScriptFile I get the Id of the embeded flash player but I can't interact with it. In fact in extension devolopement console I get an error saying that the function getDuration() does not exists. From what I read on other post this has to do with Xray vision (XPCNativeWrapper).
My problem is I don't know how to use Xray vision to send commands to the content of the webpage I do not own.
PS: I am new to firefox extension programming and it might seem very easy for you but I would really be grateful for any help or lead.
Sorry for asking I found the answer next to my question on the right side panel!
For those who are looking for the same problem :
var player = document.getElementById('movie_player').wrappedJSObject;
should do the trick.

Audio recording with HTML5

I'm trying to implement audio recording in a website. Basically the user should be able to press a button and speak something into the microphone. The recorded audio should then be sent to the server for further processing. I realise that you can do this with Flash, but for now I'm trying to avoid that.
I found several resources on the internet about it (i.e. link) but as it seems, this functionality is not widly supported yet. I experienced differences betweet the used browser and between the used operating system. For instance, the Chrome Browser doesn't seem to access any microphone on Linux correctly. So i was wondering if anyone knows a good resource to dive into this. Or maybe someone tried to set up something like this himself, and can help with some suggestions about where the limitations of HTML5 and the JavaScript Web Audio API are right now.
Thanks!
As of Chrome Version 27.0.1453.56 beta Mac, audio recording works with this demo application https://github.com/mattdiamond/Recorderjs
This app returns back a WAV file for the user which can be uploaded to the server.
If you want a truly robust solution that works on most desktop web browsers, you may need to resort to Flash.
This article covers up pretty well the current state of audio video capture possibilites using HTML5:
http://hdfvr.com/html5-video-recording
Also for just audio capture, here's a gitHub project that records audio to mp3 directly from the browser:
https://github.com/nusofthq/Recordmp3js

Categories

Resources