Commits

falsetru committed 7ba2feb

Some script contains no header, mp3 link

  • Participants
  • Parent commits 58c9ebb

Comments (0)

Files changed (4)

File apps/update.py

 
 def download_and_save_link(link):
     script = link.fetch(download)
+    if not script:
+        return
     keyname = key_name_from_title(script.title)
     if script and Script.get_by_key_name(keyname) == None:
         result = Script(key_name=keyname,

File test/20111225-2.html

+	
+
+
+
+
+
+
+
+
+
+
+
+<html>
+
+<head>
+  <title>KBS</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <meta http-equiv="imagetoolbar" content="no">
+  <link rel="stylesheet" href="http://kbbs.kbs.co.kr/images/skin/2/bbs.css"  type="text/css">
+  <script language="javascript" src="http://kbbs.kbs.co.kr/javascript/common.js"></script>
+  <script language="javascript" src="http://kbbs.kbs.co.kr/javascript/iframe_add.js"></script>
+  <script>
+  <!--
+	  function original(attachmentId) {
+          window.open("image.view.do?boardName=2fm_lgcgmp_vboard18&attachmentId="+attachmentId,"image",
+              "fullscreen=no,titlebar=no,toolbar=no,directories=no,status=no,menubar=no, scrollbars=yes, resizable=no, width=615,height=650,top="+(screen.availheight-650)/2+",left="+(screen.availheight-615)/2);
+      }
+//iframe 자동 높이 조절 수정 시작
+
+	window.onload = function(){
+			  var height = document.body.scrollHeight + 50 ;
+			  if(height > 499){
+				 document.getElementById('innerHeightiframe').src = 'http://www.kbs.co.kr/etc/iframe_resize.php?height=' + height;
+			  }
+	}
+
+//iframe 자동 높이 조절 수정 시작
+  //-->
+  </script>  
+</head>
+
+<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
+
+
+<center>
+<table><tr><td><div align="center"><font color="336699"><B>
+  ● 굿모닝 뉴스 ●</b></font><br>
+  <br>
+  <font color="336699">
+  <strong>GMN '굿모닝뉴스'가 썬데이!스페셜!이라는 타이틀을 달고 <br>
+  S~GMN!으로 다시 돌아옵니다! <br>
+  매주 일요일에 함께하는 굿모닝 뉴스 <br>
+  앞으로도 많은 기대 부탁드려요 ~~ </strong></font><br><br>
+  
+  하루 전에 뉴스 스크립트와 원음이 올라갑니다.  <br>
+  미리 예습도 해보시고, 방송 듣고 난 후 다시 확인해 보세요.</div>
+  </font></td></tr>
+</table>
+</center> 
+
+<form name="viewForm" method="get">
+      
+  <input type="hidden" name="boardName" value="2fm_lgcgmp_vboard18">
+
+  <input type="hidden" name="messageId" value="31891054">
+  
+
+  <input type="hidden" name="searchType" value="title">
+  <input type="hidden" name="searchText" value="">
+  <input type="hidden" name="searchDays" value="0">
+
+  <input type="hidden" name="lastPageFlag" value="false">
+
+  <input type="hidden" name="messageCategoryId" value="0">
+
+  <input type="hidden" name="startId" value="zzzzz~">
+  <input type="hidden" name="curPage" value="1">
+  <input type="hidden" name="startPage" value="1">
+  
+  <input type=hidden name="currentPage" value="0">    
+</form>
+
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td> 
+
+        <!-- contents -->
+        
+        <table width="100%" id="view" cellspacing="0" cellpadding="0">
+          <tr> 
+            <td height="1" colspan="4"bgcolor="#FFFFFF"></td>
+          </tr>
+          <tr> 
+            <td colspan="4" class="Title">
+                          
+                &nbsp;
+              
+              <strong></strong>
+              Good Morning News 2011/ 12/ 25일 (2) 이태석 신부님(7) 
+
+                                     
+              
+              
+              
+                                                            
+            </td>
+          </tr>
+          <tr> 
+            <td height="1" colspan="4"bgcolor="#FFFFFF"></td>
+          </tr>
+          <tr> 
+            <td class="Name">작성자</td>
+            <td class="Value">
+              굿모닝             
+            </td>
+            <td class="Name">조회</td>
+            <td class="Value">635</td>
+          </tr>
+          <tr> 
+            <td height="1" colspan="4"bgcolor="#FFFFFF"></td>
+          </tr>
+                              
+          <tr> 
+            <td class="Name">작성일</td>
+            <td colspan='3' class="Value">2011년 12월 23일 11:08:08</td>
+                                    
+          </tr>
+          <tr> 
+            <td height="1" colspan="4"bgcolor="#FFFFFF"></td>
+          </tr>
+          
+          
+          <tr> 
+            <td colspan="4" class="Textfild">
+              
+              
+
+
+
+
+
+
+            
+
+
+    
+
+              
+              <div id="DocCont" >
+                <P><!--StartFragment--> </P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '굴림'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: '굴림'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt"></SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '굴림'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: '굴림'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">&gt; 성탄절 아침엔 초대석이 있습니다. </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '굴림'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: '굴림'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">뉴스는 이태석 신부님만 다루도록 하겠습니다. </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '굴림'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: '굴림'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">GMP가족 여러분~ 모두 메리크리스마스!!!! ^^ </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '굴림'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: '굴림'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt"><BR></SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '바탕'; COLOR: #000000; FONT-SIZE: 10pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 16pt; FONT-FAMILY: '바탕'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 10pt">▶ Contents </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '굴림'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: '굴림'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">Sudan was at war. Villages were desolate and run-down with shattered houses. People seemed to be in the worst condition on the earth. People were skin and bones, some with no arms or legs, scrawny little kids doing nothing all day, and women walking for hours for water.</SPAN> </P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '굴림'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: '굴림'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt"><BR></SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '바탕'; COLOR: #000000; FONT-SIZE: 10pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 16pt; FONT-FAMILY: '바탕'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 10pt">▶ Translations </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">수단은 전쟁 중이었습니다. / 마을은 황량하고 황폐했습니다... </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">산산이 부서진 집들과 함께... / 주민들은 최악의 상태에 있는 것처럼 </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">보였습니다... 지구상에서... / 주민들은 피골이 상접했고... </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">어떤 이들은 팔이나 다리가 없었습니다... 뼈만 앙상한 아이들은... </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">아무것도 하지 않았습니다... 하루 종일... 그리고 여자들은... </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">몇 시간이나 걸었습니다... 물을 얻기 위해...&nbsp; </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="HWP-TAB: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN></SPAN> </P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt; FONT-WEIGHT: bold">수단은 전쟁 중이었습니다. / 산산이 부서진 가옥들로 마을은 황량하고 </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt; FONT-WEIGHT: bold">황폐했습니다. / 주민들은 지구상에서 최악의 상태에 있는 것 같았습니다. </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt; FONT-WEIGHT: bold">주민들은 피골이 상접했고, 팔이나 다리를 잃은 이들도 있었고, 뼈만 </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt; FONT-WEIGHT: bold">앙상한 아이들은 하루 종일 빈둥거리며 시간을 보냈고, 여자들은 </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt; FONT-WEIGHT: bold">물을 얻기 위해 몇 시간이나 걸어야했습니다. //&nbsp; </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt; FONT-WEIGHT: bold"><BR></SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: -79.96pt; MARGIN: 0pt 0pt 0pt 79.96pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt; FONT-WEIGHT: bold"><SPAN style="HWP-TAB: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="HWP-TAB: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN></SPAN><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="HWP-TAB: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN></SPAN><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt; FONT-WEIGHT: bold"><SPAN style="HWP-TAB: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>&nbsp;</SPAN> </P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '바탕'; COLOR: #000000; FONT-SIZE: 10pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 16pt; FONT-FAMILY: '바탕'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 10pt">▶ Key Expressions </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">1) desolate: 황량한, 적막한 </SPAN><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: '굴림'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt"></SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">2) run-down: 황폐한, 부진한 </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">3) shattered: 산산이 부서진, 완전히 지친, 엄청난 충격을 받은 </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '08서울한강체 L'; COLOR: #000000; FONT-SIZE: 12pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 19.2pt; FONT-FAMILY: 08서울한강체 L,한컴돋움; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 12pt">4) scrawny: 뼈만 앙상한, 거죽만 남은 </SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '바탕'; COLOR: #000000; FONT-SIZE: 10pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 16pt; FONT-FAMILY: '바탕'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 10pt"><BR></SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '바탕'; COLOR: #000000; FONT-SIZE: 10pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 16pt; FONT-FAMILY: '바탕'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 10pt"><BR></SPAN></P>
+<P style="TEXT-ALIGN: justify; LINE-HEIGHT: 160%; TEXT-INDENT: 0pt; MARGIN: 0pt; FONT-FAMILY: '한컴바탕'; COLOR: #000000; FONT-SIZE: 10pt"><SPAN style="TEXT-ALIGN: justify; LINE-HEIGHT: 16pt; FONT-FAMILY: '한컴바탕'; LETTER-SPACING: 0pt; COLOR: #000000; FONT-SIZE: 10pt"><BR></SPAN></P>
+              </div>
+            </td>
+          </tr>
+          <tr> 
+            <td height="1" colspan="4"bgcolor="#FFFFFF"></td>
+          </tr>
+          
+          <tr> 
+            <td height="1" colspan="4"bgcolor="#FFFFFF"></td>
+          </tr>
+                    
+        </table>
+        
+        <!-- //contents -->
+        
+      </td>
+  </tr>
+  <tr>
+    <td height="5"></td>
+  </tr>
+  <tr> 
+    <td > 
+    
+        <!-- view navigation -->    
+    
+        
+
+
+
+
+
+
+
+
+<script>
+<!--    
+    function prev(messageId){
+        viewForm.action="view.do";      
+        viewForm.messageId.value=messageId;     
+        viewForm.method="GET";
+        viewForm.submit();
+    }
+    
+    function next(messageId){
+        viewForm.action="view.do";      
+        viewForm.messageId.value=messageId;
+        viewForm.method="GET";
+        viewForm.submit();
+    }   
+//-->
+</script>         
+
+<table width="100%" border="0" cellspacing="0" cellpadding="0" id="viewList">
+  <tr> 
+    <td class="List"> 
+      <table width="100%" border="0" cellspacing="0" cellpadding="0" >
+
+        <tr> 
+          <td class="Font"><img src="http://kbbs.kbs.co.kr/images/user/back.gif"> 이전 :</td>        
+          <td class="Value">&nbsp;&nbsp;이전 글이 없습니다.</td>
+        </tr>
+
+      </table>
+    </td>
+  </tr>
+  <tr> 
+    <td>   
+      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
+
+        <tr>     
+          <td class="Font"><img src="http://kbbs.kbs.co.kr/images/user/next.gif"> 다음 :</td>
+          <td class="Value">
+            &nbsp;
+              
+              
+                
+                  
+                  
+                    <a href="javascript:next('31869003')"><font color='##000000'>Good Morning News 2011/ 12/ 18일 (2) 이태석 신부님(6) </font></a>
+                                  
+                
+                          
+          </td>
+        </tr>
+                             
+      </table>
+    </td>
+  </tr>
+</table>
+
+
+          
+        <!-- //view navigation -->          
+          
+      </td>
+  </tr>
+  <tr> 
+    <td>
+      
+        <!-- button -->
+      
+        
+
+
+
+
+
+
+
+
+<script>
+<!--
+    function deleteTopFlag(){
+        if( confirm("최상위 메시지로 공지를 취소 하시겠습니까?   ")){
+            viewForm.action="top.message.do";
+            viewForm.submit();      
+        }
+    }
+    
+    function insertTopFlag(){
+        if( confirm("최상위 메시지로 공지하시겠습니까?   ")){
+            viewForm.action="top.message.do";
+            viewForm.submit();      
+        }
+    }
+
+    function deleteBestFlag(){
+        if( confirm("베스트 메시지로 공지를 취소 하시겠습니까?   ")){
+            viewForm.action="best.message.do";
+            viewForm.submit();      
+        }
+    }
+    
+    function insertBestFlag(){
+        if( confirm("베스트 메시지로 공지하시겠습니까?   ")){
+            viewForm.action="best.message.do";
+            viewForm.submit();      
+        }
+    }
+    
+    function approve(){
+        if( confirm("승인처리하시겠습니까?   ")){
+            viewForm.action="approve.do";
+            viewForm.submit();      
+        }
+    }    
+
+    function recommendation(){
+        
+            alert("이미 추천 하셨습니다.   ");
+        
+    }
+    
+    function write(){
+	    //비 로그인 사용자에게도 버튼을 노출하도록 수정함. 2008.06.13 이성희
+	    
+
+			var ssoLogin   = "http://asx.kbs.co.kr/login/SSOLogon2.php?from_url=";
+    		var returnUrl = "http://kbbs.kbs.co.kr/board/message/view.do?boardId=56164";
+				returnUrl = returnUrl + "&messageId=31891054";
+				returnUrl = returnUrl + "&searchType=title";
+				returnUrl = returnUrl + "&searchText=";
+				returnUrl = returnUrl + "&searchDays=0";
+				returnUrl = returnUrl + "&lastPageFlag=false";
+				returnUrl = returnUrl + "&startId=zzzzz~";
+				returnUrl = returnUrl + "&curPage=1";
+				returnUrl = returnUrl + "&startPage=1";
+            location.href  = ssoLogin + encodeURIComponent(returnUrl);
+        
+    }
+            
+    function reply(){
+    	//비 로그인 사용자에게도 버튼을 노출하도록 수정함. 2008.06.13 이성희
+    	
+
+			var ssoLogin   = "http://asx.kbs.co.kr/login/SSOLogon2.php?from_url=";
+    		var returnUrl = "http://kbbs.kbs.co.kr/board/message/view.do?boardId=56164";
+				returnUrl = returnUrl + "&messageId=31891054";
+				returnUrl = returnUrl + "&searchType=title";
+				returnUrl = returnUrl + "&searchText=";
+				returnUrl = returnUrl + "&searchDays=0";
+				returnUrl = returnUrl + "&lastPageFlag=false";
+				returnUrl = returnUrl + "&startId=zzzzz~";
+				returnUrl = returnUrl + "&curPage=1";
+				returnUrl = returnUrl + "&startPage=1";
+            location.href  = ssoLogin + encodeURIComponent(returnUrl);
+        
+    }           
+    
+    function update(){
+	    //비 로그인 사용자에게도 버튼을 노출하도록 수정함. 2008.06.13 이성희
+    	
+
+			var ssoLogin   = "http://asx.kbs.co.kr/login/SSOLogon2.php?from_url=";
+    		var returnUrl = "http://kbbs.kbs.co.kr/board/message/view.do?boardId=56164";
+				returnUrl = returnUrl + "&messageId=31891054";
+				returnUrl = returnUrl + "&searchType=title";
+				returnUrl = returnUrl + "&searchText=";
+				returnUrl = returnUrl + "&searchDays=0";
+				returnUrl = returnUrl + "&lastPageFlag=false";
+				returnUrl = returnUrl + "&startId=zzzzz~";
+				returnUrl = returnUrl + "&curPage=1";
+				returnUrl = returnUrl + "&startPage=1";
+            location.href  = ssoLogin + encodeURIComponent(returnUrl);
+        
+    }           
+    
+    function deleteMessage(){
+    	//비 로그인 사용자에게도 버튼을 노출하도록 수정함. 2008.06.13 이성희
+    	
+
+			var ssoLogin   = "http://asx.kbs.co.kr/login/SSOLogon2.php?from_url=";
+    		var returnUrl = "http://kbbs.kbs.co.kr/board/message/view.do?boardId=56164";
+				returnUrl = returnUrl + "&messageId=31891054";
+				returnUrl = returnUrl + "&searchType=title";
+				returnUrl = returnUrl + "&searchText=";
+				returnUrl = returnUrl + "&searchDays=0";
+				returnUrl = returnUrl + "&lastPageFlag=false";
+				returnUrl = returnUrl + "&startId=zzzzz~";
+				returnUrl = returnUrl + "&curPage=1";
+				returnUrl = returnUrl + "&startPage=1";
+            location.href  = ssoLogin + encodeURIComponent(returnUrl);
+        
+    }           
+    
+    function list(){
+        viewForm.method = "post";
+        viewForm.action="list.do";
+        viewForm.submit();      
+    }           
+
+    function warn() {
+    	//비 로그인 사용자에게도 버튼을 노출하도록 수정함. 2008.06.13 이성희
+	    
+
+			var ssoLogin   = "http://asx.kbs.co.kr/login/SSOLogon2.php?from_url=";
+    		var returnUrl = "http://kbbs.kbs.co.kr/board/message/view.do?boardId=56164";
+				returnUrl = returnUrl + "&messageId=31891054";
+				returnUrl = returnUrl + "&searchType=title";
+				returnUrl = returnUrl + "&searchText=";
+				returnUrl = returnUrl + "&searchDays=0";
+				returnUrl = returnUrl + "&lastPageFlag=false";
+				returnUrl = returnUrl + "&startId=zzzzz~";
+				returnUrl = returnUrl + "&curPage=1";
+				returnUrl = returnUrl + "&startPage=1";
+            location.href  = ssoLogin + encodeURIComponent(returnUrl);
+                    
+    }
+//-->
+</script>
+
+ 
+<table width="100%" border="0" cellspacing="1" cellpadding="0" height="39">
+  <tr> 
+    <td>
+      <table border="0" cellspacing="0" cellpadding="0">
+        <tr height="29"> 
+          <td width="211">
+            
+                   
+              
+            
+              
+                      
+                      
+    
+            <a href="javascript:warn();"><img src="http://img.kbs.co.kr/kbbsimg/images/skin/2/btn_report.gif" width="35" height="19" border="0" title="신고"></a>
+
+          </td>
+        </tr>
+      </table>
+    </td>
+    <td align="right">
+      <table border="0" cellspacing="0" cellpadding="0">
+        <tr height="29"> 
+          <td width="261" align="right">
+            <a href="javascript:deleteMessage()"><img src="http://img.kbs.co.kr/kbbsimg/images/skin/2/btn_delete.gif" width="35" height="19" border="0" title="삭제"></a>  
+
+            <a href="javascript:update()"><img src="http://img.kbs.co.kr/kbbsimg/images/skin/2/btn_edit.gif" width="35" height="19" border="0" title="수정"></a>
+
+                      
+
+            
+
+            
+              <a href="javascript:write()"><img src="http://img.kbs.co.kr/kbbsimg/images/skin/2/btn_write.gif" border="0" title="글쓰기"></a> 
+                                  
+          </td>
+          <td style="padding-left:4;">
+            <a href="javascript:list()"><img src="http://img.kbs.co.kr/kbbsimg/images/skin/2/btn_list.gif" width="35" height="19" border="0" title="목록"></a>
+          </td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+</table> 
+ 
+
+
+      
+        
+        <!-- //button -->        
+        
+      </td>
+    </tr>
+    <tr>
+    
+      <!-- comment -->
+    
+      
+          
+      <!-- //comment -->      
+
+    </tr>
+  </table>
+
+
+
+
+
+<iframe width='0' height='0' id='innerHeightiframe'></iframe>
+</body>
+
+</html>
+
+
+
+
+

File test/test_getscript2.py

             title='2010-05-30: ',
             content='The passengers were coming home from Dubai, where the flight originated. There were only eight survivors among the 166 passengers and crew members.',
             mp3url='http://kbbs.kbs.co.kr/board/message/file.do?CMD=GETFILE&SP=0&SVC_ID=emate&SEQ=842893'))
+    def test_no_headline(self):
+        self.assert_parse_viewpage('20111225-2.html', None)
 
 if __name__ == '__main__':
     unittest.main()

File tools/getscript2.py

         _, headline, content, _ = DocCont.split('▶', 3)
 
         # XXX
-        headline = headline.split('Headline', 1)[1]
+        fields = headline.split('Headline', 1)
+        if len(fields) == 1:
+            return
+        headline = fields[1]
         headline = headline.replace('<BR>', '\n')
         headline = htmlstrip(headline)
         headlines = [h for h in map(str.strip, headline.splitlines()) if h]