How can I use youtubeinmp3 in my app? - java

I want to create an mp3 downloader application,After some research i found a solution which is YoutubeinMp3 API but I don't know how can i use this api. API official link is as follow https://www.youtubeinmp3.com/api/

"I need know how can I use API of the youtubeinmp3... Can you give me an example?"
The API link you provided is the manual with example. Scroll down to Direct Links section an read that for reference (the fetch part of URL gives you the MP3 data). You simply access your link as:
https://www.youtubeinmp3.com/fetch/?video=https://www.youtube.com/watch?v=12345
where you replace the 12345 with actual video ID for required video (eg: iOWamCtnwTc). Example :
https://www.youtubeinmp3.com/fetch/?video=https://www.youtube.com/watch?v=iOWamCtnwTc
And it will return the bytes of mp3 (in desktop browser testing this will begin downloading to hard drive). So in Android you simply receive the bytes to a ByteArray and then save those bytes as file in your storage location.
You can check some tutorials like Download from Internet and save to SD but actually any tutorial about saving file from internet (whether image or MP3 or whatever) can be adjusted to instead use your the API link as download source.

Related

Is it possible to write an image directly to Google Drive?

I have searched Google Drive API reference as well as the Internet for an answer but I haven't found any.
Is it possible to write an image directly to Google Drive from Java app?
I know that you can upload files to Google Drive from local file system via Java app, but that is not what I want.
I have a Java app that is creating an image - BufferedImage object. To save in the local file system, I use javax.imageio.ImageIO.write method and it works well.
However, what I would like to do, is to somehow write that BufferedImage directly to my Google Drive so I don't have to write it to the local file system and then upload it to Google Drive.
Thanks for help :]

How to capture (record) video stream that enters to my browser?

Imagine you watch sports live in your browser. It means you receiving a video stream, right? I need to record this stream and save to disk. The problem is that I don't have a clue from where to start. I'm not new to programming, but have a little experience in live video streaming.
I see this problem divided into this parts:
1) Parse html page and find live source URL. (? sounds silly, I'm not sure it is easy to find URL)
2) When I have URL everything else becomes easy. I would use Java for example, to receive and record stream.
So the main problem is to find live source URL. Does anybody know how to do that?
a) From HTML5 video player
b) From flash player
I had similar concerns before the best think I can suggest would be ;
For the first option :
open browser developer tools or wireshark and monitor the network while watching the video this is the most efficient way of locating the video source than you can just download the stream from the link
The second option :
there are some java libraries(jentpcap,jpcap ) for capturing ip packets after capturing the network adapter a while, you can filter them by type such a mpeg and get destination url note:some servers are sending these video samples as fragments you might need to merge them after downloading.
one more suggestion is gstreamer , as far as I know it has java wrappers and it is very useful for recording live videos to a file.
If the sport you are watching has any sort of value then it will most likely be protected by DRM and you will not be able to do what you are suggesting on your PC/laptop.
You can still capture the file but as it is encrypted you won't be able to play it back.
If it is not protected by DRM then finding the URL from the source can work - it depends on the video file type and whether the server is using any sort of authentication before mapping the URL sent from the browser to the URL of the actual video.
You also likely need to understand the type of URL - not all videos play in all devices, and some video URL's actually point to a manifest or 'index' file which then contains the actual URL's for the individual video and audio streams.

How to specify StorageEncrypted when creating new assets from a transcode in Azure media services

I'm following along with the Using AES-128 Dynamic Encryption and Key Delivery Service tutorial. I am using the Azure java SDK and I can't find a way to use the StorageEncrypted option for newly created assets (i.e. assets created as a result of transcoding). When I upload my high-quality source file I'm able to use setOptions(AssetOption.StorageEncrypted) when creating the Azure asset. I see in the Encode the asset containing the file to the adaptive bitrate MP4 set portion of the tutorial that it is possible to tell Azure I want to use StorageEncrypted on my new asset from the following C# code:
encodeTask.OutputAssets.AddNew(String.Format("{0} as {1}", inputAsset.Name, encodingPreset), AssetCreationOptions.StorageEncrypted);
I found a few vague mentions of encryption in the Task.CreateBatchOperation JavaDocs but it is unclear what they are used for or what values might make sense.
So, my question is: how do I tell Azure to use StorageEncrypted when creating new assets from a transcode using the Java SDK?
I believe I've found the solution in the REST API docs. Basically just add a assetCreationOptions='1' attribute on your outputAsset element in the taskBody.
I'm thinking the Java SDK simply isn't on par with .Net (which makes sense given the source). You might be better off just using the REST API directly as there are several missing pieces in the Java SDK.

Video Conversion Automated Application

I am trying to create an application where you are able to convert video's to different formats where the video is saved on a web server so that the user can access it once the conversion is complete. What would you recommend as the best way of approaching this?
Example:
-Download a video from a particular website.
-Be able to convert it to MP4 and save the file on a web server.
-Send a notification to the user with the link of the MP4 video.
-Access and download the MP4 video from the link.
So basically the user downloads a video (in ARF format). My program should take that ARF video and convert it to MP4. Once converted, the mp4 saved on a web server and the user informed (i.e. by email) that the conversion has been completed. The user should then be able to view the link and download the MP4 video. I also want to make sure that the program works on Windows, Linux and Mac.
Users can manually specify the file to be converted. I am most confident with Java so is there a way this can be achieved using some of Java's API Libraries & Web Applications?
I was thinking of using JAVE libraries to do the conversion but am not too sure how to then save the video on a web server.
There are several Java libraries for working with various media formats. A prominent one is JFFMPG:
http://jffmpeg.sourceforge.net/
There is also JAVE, which you may find easier to user, depending on your needs:
http://www.sauronsoftware.it/projects/jave/index.php

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!

Categories