»Ë»Ñ Æ÷·³

´ÙÀ½ À¥Å÷ ´Ù¿î·Î´õ ¼Ò½ºÀÔ´Ï´Ù.3

¸îºÐµéÀÇ ÀÇ°ßÀ» ¹Þ¾Æ¼­ Á¤»óÀûÀ¸·Î ÀÛµ¿ÇÏÁö ¾Ê´Â ¼Ò½º·Î º¯°æÇÏ¿´½À´Ï´Ù~

¾ø¾îÁø ºÎºÐÀº À̹ÌÁö¸¦ Á÷Á¢ ´Ù¿î·ÎµåÇÏ´Â ºÎºÐÀÌ´Ï ½º½º·Î ±ú¿ìÄ¡½Ã±æ..¤Ð¤Ð

Àü °í¼Ò¹Ì°¡ ¹«¼­¿ö¿ä ¤¾

================================================================================

À¥Å÷À» ÀÏÀÏÀÌ µé¾î°¡¼­ º¸±â ±ÍÂú¾Æ¼­ Áö³­ÁÖ ¸¸µé¾ú½À´Ï´Ù.

ÀϺΠÇÊ¿ä¾ø´Â ÄÚµåµéÀÌ Á» Àִµ¥ Àü Á¤¸®Çϱ⠱ÍÂú¾Æ¼­ ¾ÈÇß¾î¿ä.

¿¹Àü¿¡´Â ±×³É À̹ÌÁö ÁÖ¼Ò¸¸ ¾Ë¸é ´Ù¿î·Îµå°¡ °¡´ÉÇߴµ¥ ÀÌÁ¦´Â

³×À̹ö³ª ´ÙÀ½À̳ª Ä¿³Ø¼Ç ¿¬°áÀ» À¯ÁöÇØ¾ß µÇ´Â ºÎºÐµéÀÌ À־ Á» ±ÍÂú¾Ò³×¿ä.

Àú¹ø¿¡µµ ¼Ò½º °ø°³ÇÏ´Ï ¹Ù²î¾ú´øµ¥ ±¦È÷ °ø°³Çϴ°Š¾Æ´Ñ°¡ ÇÏ´Â »ý°¢ÀÌ µé±âµµ ÇÏÁö¸¸ ¹¹...¤¾

¼Ò½º´Â °£´ÜÇÕ´Ï´Ù. Çѹø º¸½Ã°í µ¹·Áº¸¼¼¿ä. ¶óÀ̺귯¸®´Â ¾Ë¾Æ¼­µé ÇϽʼî~~ ¤¾

±×³ªÀú³ª ³×À̹öµµ ¸¸µé±î Çϴµ¥ ±ÍÂú³×¿ä ÀÌ°Å ¤¾

PS) ´Ù¿î·ÎµåÇÑ À̹ÌÁö ÆÄÀÏÀº º¸³»µå¸®Áö ¾Ê½À´Ï´Ù~


import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import javax.swing.text.html.parser.Entity;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.HttpParams;
import org.apache.http.util.EntityUtils;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import com.github.axet.wget.WGet;
    
public class DaumWebtoon {
        public static String titleHan = "0.0mhz"; //Æú´õ¸í
        public static String titleName = "mhz"; //À¥Å÷ ID
        public static void main(String[] args) {
            DaumWebtoon ye = new DaumWebtoon();
            ye.step1();
    }
        
        public static DefaultHttpClient getThreadSafeClient(){
                DefaultHttpClient client = new DefaultHttpClient();
                ClientConnectionManager mgr = client.getConnectionManager();
                HttpParams params = client.getParams();
                client = new DefaultHttpClient(new ThreadSafeClientConnManager(params, mgr.getSchemeRegistry()), params);
                return client;
        }
        
        public void step1(){
                HttpClient httpclient = getThreadSafeClient();
                
                try {
                        String webToonUrl = "http://webtoon.daum.net/webtoon/view/"+titleName;
                        
                        HttpPost post = new HttpPost(webToonUrl);

                        post.setHeader("Connection", "Keep-Alive");
                        post.setHeader("Accept-Charset", "utf-8");
                        post.setHeader("ENCTYPE", "multipart/form-data");


                        HttpResponse response = httpclient.execute(post);
                        HttpEntity resEntity = response.getEntity();
                        
                        BufferedReader reader=new BufferedReader(new InputStreamReader(resEntity.getContent(), "UTF-8"));
                        
                        List list = new ArrayList();
                        String line = null;
                        while((line = reader.readLine())!= null) {
                                if(line.indexOf("data1.push") > -1){
                                        //System.out.println(line);
                                        String pageId = line.substring(line.indexOf("/webtoon/viewer")).split(""")[0].split("/")[3];
                                        //System.out.println(pageId);
                                        
                                        list.add(pageId);
                                }
                        }
                        
                        for(int i = 0 ; i < list.size() ; i++){<br />                                 checkPageId(list.get(i));
                        }
                        
                }catch(Exception e){
                        e.printStackTrace();
                }
        }
        
        public void checkPageId(String pageId){
                try {
                        HttpClient httpclient = getThreadSafeClient();
                        
                        String testUrl = "http://webtoon.daum.net/webtoon/viewer/"+pageId;
                        HttpPost testpost = new HttpPost(testUrl);
                        httpclient.execute(testpost);
                        
                        String postURL = "http://webtoon.daum.net/webtoon/viewer_images.js?webtoon_episode_id="+pageId;
                        HttpPost post = new HttpPost(postURL);

                        post.setHeader("Connection", "Keep-Alive");
                        post.setHeader("Accept-Charset", "utf-8");

                        HttpResponse response = httpclient.execute(post);
                        HttpEntity resEntity = response.getEntity();
                        
                        
                        String result = "";
                        if (resEntity != null) {
                                result = EntityUtils.toString(resEntity);
                        }
                        
                        JSONObject jo = JSONObject.fromObject(result);
                        //System.out.print(jo.get("episodeTitle"));
                        
                        System.out.println(result);
                        
                        JSONArray ja = JSONArray.fromObject(jo.get("images"));
                        
                        for(int i = 0 ; i < ja.size() ; i++){<br />                                 JSONObject jajo = JSONObject.fromObject(ja.get(i));
                                System.out.print(jajo.get("url"));
                                if(jajo.getString("mediaType").equals("image")){
                                        imageDown(jajo.getString("id"), jajo.getString("url"));
                                }
                        }
                        
                        
                } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        }
}

1
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
ºÏ¸¶Å©¹öÆ° °øÀ¯¹öÆ°

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ¼¼¸ð_
2014-04-28 Á¡¾ÆÀÌÄÜ
  1. ´ñ±ÛÁÖ¼Òº¹»ç

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ¹Ù´ÙÀÇÁ¦¿Õ
2014-04-28 Á¡¾ÆÀÌÄÜ
  1. ´ñ±ÛÁÖ¼Òº¹»ç

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ¹Ù´ÙÀÇÁ¦¿Õ
2014-04-28 Á¡¾ÆÀÌÄÜ
  1. ´ñ±ÛÁÖ¼Òº¹»ç
  • ¾Ë¸² ¿å¼³, »óó ÁÙ ¼ö ÀÖ´Â ¾ÇÇÃÀº »ï°¡ÁÖ¼¼¿ä.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û -¸ñ·Ïº¸±â