import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
public class TestGetVideoInfo {
/**
* @param args
*/
public static void main(String[] args) {
TestGetVideoInfo getvideoinfo = new TestGetVideoInfo();
String url = "http://cdn.52itv.cn/?data=list&tid=1&item=&area=&year=&top=&page=&num=4815";
try {
getvideoinfo.download_list(url);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void download_list(String url) throws IOException {
URL website = new URL(url);
ReadableByteChannel rbc = Channels.newChannel(website.openStream());
String newfilename = url.replace("http://cdn.52itv.cn/?", "");
FileOutputStream fos = new FileOutputStream("/home/yulin724/tmp/"
+ newfilename);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
}
}