Created
May 23, 2013 13:43
-
-
Save qrtt1/5636173 to your computer and use it in GitHub Desktop.
Lab For VideoDownloader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.demo; | |
import org.apache.commons.logging.Log; | |
import org.apache.commons.logging.LogFactory; | |
public class Main { | |
static Log logger = LogFactory.getLog(Main.class); | |
public static void main(String[] args) { | |
if (args == null || args.length != 2) { | |
logger.warn("It needs two args: filename and video-url"); | |
return; | |
} | |
String filename = args[0]; | |
String youtubeUrl = args[1]; | |
VideoUrlParser parser = new VideoUrlParser(); | |
String url = parser.parse(youtubeUrl); | |
if (url != null) { | |
VideoDownloader downloader = new VideoDownloader(); | |
downloader.saveVideo(filename, url); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment