Accessing video content from a website - java

I need to download lecture videos from mediasite.com. Using this guide, I have been able to do so by saving the site locally and then getting the video url from the "manifest.js" file. However, since this method is long and convoluted, I would like to just be able to script the whole thing.
What tools do I need to complete these three steps:
Go to the lecture site
Extract video url from manifest.js file
Download the video
I've been told that using cURL or the .net lib in java might do the trick but I honestly don't know where to start. Would appreciate any help. Thanks

Firebug + Fiddler2 to find direct links.

Related

Java - Live Streaming Video which uploaded to Database

I think the title says all, but here's what I've done so far:
I managed to upload video to MySQL with Large Blob
Currently, I also managed to stream the video, but this way take 2 steps, which is:
First: I extract the blob into local directory
Second: I use that directory path as src in my video playing page.
Now that my lecturer wants it without extracting to local disk first, he wants to live streaming from database. I only managed to do this if it's a picture, but a video I don't get any clue.
I hope anybody could help me or at least give me clues, thanks in advance :)
I think this should be a good place to start from:
this
Also, if you are just downloading the file, this link might help.
And if you have your own software on the clients side to show the stream, I would suggest that you will open a socket between the client and server and then just sent the video in pieces.

How to download a video from website given direct URL

I am currently in the process of developing a Java program that downloads/streams some anime videos:
I want to download the video from:
https://animetwist.net/a/swordartonline/25
I was able to find the direct link to the video:
https://animetwist.net/mount/swordartonline/swordartonline25.mp4
but I have no idea how I could download or stream that video from this java application I'm creating. I have no idea where to start and all the questions I find are related to YouTube videos and not other videos.
What I know/have tried:
VGet - Only for Youtube/Vimeo only...
Xuggler - I tried but don't understand how I could use it to download videos
Any help or a point in the correct direction would be much helpful. I don't exactly understand how it would work. The perfect solution would be something in pure java, but using addons are fine as well.
Sorry if my question is unclear, post a comment below and I'll try to answer it as best I can, thanks for your time.
If you just want to download a file from a URL you do it like any other file in Java. There are several good options for accomplishing this task here.

Java Screenshot of multiple webpages

i'm not going to post any code here because i don't know how to start doing it. Actually I need your help...
I am working with java (using netbeans, btw) and I have a database with multiple urls in a table (MySQL), and i want to get a screenshot of every url listed there, save it to my pc and then insert that screenshot (jpeg) in the url table. I was looking here on stackoverflow but i had no answer (not an automatic one, because i have to open a web browser and the aplication is supposed to be a standalone app) (The other option i found in this article -> (this) is unavailable.
In the same article i've read about the Flying Saucer Project, and maybe is the best option, but i have no idea of how to use it and i don't want to waste valious time reading every single thing that the project can do... so i'd appreciate a quick tutorial of how to use it.
Please, if u can post some code here would be great, but at least i'd like an answer of how to do this, or mambe some suggestions, that would be nice too. THANKS EVERYBODY.
You should take a look at CutyCapt:
CutyCapt is a small cross-platform command-line utility to capture WebKit's rendering of a web page into a variety of vector and bitmap formats, including SVG, PDF, PS, PNG, JPEG, TIFF, GIF, and BMP. See IECapt for a similar tool based on Internet Explorer.
Just execute the application from within your Java application. See Running Command Line in Java. The result would be something like::
p = Runtime.getRuntime().exec(String.format("./CutyCapt --url=%s --out=%s",
url, path));

How can I get the correct url to the video file from an embedded video?

I want to get the actual Video File Url from an embedded video on any website. It essentially is not YouTube. It can be any website.
I am coding for android on Java.
For Example :
The thing I want to do is same as this IDM button does :
[Actually not the same because the button there captures a network stream when it gets started by the player. But I want to get the file straight from the player.]
Is there a way to attain this? Can Any external Library [e.g. Jsoup] do this?
I am already using Jsoup to get some other contents of the page but I have no idea how to do this.
If your using jsoup you can get the url quite easily. Just use jsoup to select all the possible video tags (<iframe>, <videos>, <embed>, etc). Then get the src attribute and store that where you want it:
Example
//Standard Jsoup search
Elements iframes = body.select("iframe");
/*Gets the src of all the iframes or other tag, and if you have
multiple videos you might have to do this in a for loop.*/
String videoURL = iframes.attr("src");
As you may know that different website have different video downloading strategies, some might give a real url in html file for directly download, others may just return video stream while click button or touch screen.
while so many different strategies on video download its really hard for you to find a universal way to fetch a real url to start a download task. But here I have an idea, not so smart, it can be very dumb:
1.play a video in the background(to let browser download that video in browser cache).
2.find that cache file and extract video file which you want.
for myself, I usually have some videos that I want but can not be downloaded straightly, thus I will use IE to play that video and find that video in IE temporary folder.
wish I could help you!

java JSP coding in learning management system

I am working on a project named as LMS (Learning management system) and the modules allocated to me are:-
The uploaded course content saved as ppt,doc ,pdf or audio/video file should be opened in the same window.The application by which file needs to be opened should be embedded in the context window itself.
The uploaded course content saved as ppt,doc ,pdf file can be converted to audio/video file.
I have to code them in JSP.
Being new to java i am not getting how to do these. Can you plz plz help me out by showing me some direction? I shall be very thankful to you.
I will be waiting for your reply desperately.
Thanks and regards
swati
First I have to ask do you already have a transformation server/code to do the conversion in point nbr2 or do you ask for guidance on that to? If that's the case maybe you can look into HTML5 for this otherwise use something like flash.
I would say use HTML5 for video and the other things I would require the users to install the correct plug in adobe reader ... I think it's reasonable to put requirements on the user when using an enterprise app.
Almost all of this could be done in HTML JavaScript inside your jsp.

Categories