기본 콘텐츠로 건너뛰기

8월, 2018의 게시물 표시

413 (Request Entity Too Large)

• 파일업로드 오류시 nginx 업로드사이즈변경 1. 설정파일을 연다. sudo nano /etc/nginx/nginx.conf 2. http구문안에 아래내용을 삽입한다. http {   # Set client upload size - 100Mbyte   client_max_body_size 100M;   ...   ..   . } 3.업로드 크기가 설정되었으니 nginx를 재시작한다. nginx -s reload 또는 service nginx restart

NodeJs 를 이용한 EPG 정보가져오기

* 나의 환경 정보 장비 : 라즈베리파이 3 b OS : 라즈비안 Jessie 사용 프로그램 : NodeJs v.8.11.3 방송사 : KT 올레TV 필요한 NODE 모듈은 아래와 같다. var cheerio = require ( 'cheerio' ),      request = require ( 'request' ),      iconv = require ( 'iconv-lite' ),      charset = require ( 'charset' ),      fs = require ( 'fs' ),      shell = require ( 'shelljs' ); * 순서 1. node로 웹크롤링을 해와서 방송 정보 xml파일을 만든다. 2. 만들어진 xml파일을 socat 을 이용하여 tvheadend xmltv.sock 로 전송해준다. * 소스 1. request 를 이용한 스크래핑 request . post ({          uri: epg2xml [ gISP ],          headers: { 'content-type' : 'application/x-www-form-urlencoded' },          body: require ( 'querystring' ). stringify ( postData ),          encoding: null         }, function ( err , res , body ){              if ( err ){                  throw err ;             }              var enc = charset ( res . headers , body );              var rst = iconv . decode ( body , enc );