기본 콘텐츠로 건너뛰기

라즈베리파이 TVheadend EPG 설치로그


pi@raspberrypi:~ $ cd /home/pi/epg2xml-1.2.4
pi@raspberrypi:~/epg2xml-1.2.4 $ sudo chmod -x epg2xml.py
pi@raspberrypi:~/epg2xml-1.2.4 $ sudo chmod 755 Channel.json
pi@raspberrypi:~/epg2xml-1.2.4 $ sudo easy_install beautifulsoup
sudo: easy_install: command not found
pi@raspberrypi:~/epg2xml-1.2.4 $ python --version
Python 2.7.9
pi@raspberrypi:~/epg2xml-1.2.4 $ sudo apt-get install python-setuptools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  python-pkg-resources
Suggested packages:
  python-distribute python-distribute-doc
The following NEW packages will be installed:
  python-pkg-resources python-setuptools
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 306 kB of archives.
After this operation, 957 kB of additional disk space will be used.Do you want to continue? [Y/n] y
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-pkg-resources all 5.5.1-1 [64.4 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-setuptools all 5.5.1-1 [242 kB]
Fetched 306 kB in 1s (182 kB/s)
Selecting previously unselected package python-pkg-resources.
(Reading database ... 48897 files and directories currently installed.)
Preparing to unpack .../python-pkg-resources_5.5.1-1_all.deb ...
Unpacking python-pkg-resources (5.5.1-1) ...
Selecting previously unselected package python-setuptools.
Preparing to unpack .../python-setuptools_5.5.1-1_all.deb ...
Unpacking python-setuptools (5.5.1-1) ...
Setting up python-pkg-resources (5.5.1-1) ...
Setting up python-setuptools (5.5.1-1) ...
pi@raspberrypi:~/epg2xml-1.2.4 $ sudo easy_install beautifulsoup   Searching for beautifulsoup
Reading https://pypi.python.org/simple/beautifulsoup/
Best match: BeautifulSoup 3.2.1
Downloading https://pypi.python.org/packages/1e/ee/295988deca1a5a7accd783d0dfe14524867e31abb05b6c0eeceee49c759d/BeautifulSoup-3.2.1.tar.gz#md5=44656527ef3ac9874ac4d1c9f35f70ee
Processing BeautifulSoup-3.2.1.tar.gz
Writing /tmp/easy_install-IeKVOt/BeautifulSoup-3.2.1/setup.cfg
Running BeautifulSoup-3.2.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-IeKVOt/BeautifulSoup-3.2.1/egg-dist-tmp-a1vLIR
zip_safe flag not set; analyzing archive contents...
/usr/lib/python2.7/dist-packages/setuptools/command/bdist_egg.py:395: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  symbols = dict.fromkeys(iter_symbols(code))
Adding BeautifulSoup 3.2.1 to easy-install.pth file

Installed /usr/local/lib/python2.7/dist-packages/BeautifulSoup-3.2.1-py2.7.egg
Processing dependencies for beautifulsoup
Finished processing dependencies for beautifulsoup
pi@raspberrypi:~/epg2xml-1.2.4 $ sudo easy_install lxml
Searching for lxml
Reading https://pypi.python.org/simple/lxml/
Best match: lxml 4.1.1
Downloading https://pypi.python.org/packages/e1/4c/d83979fbc66a2154850f472e69405572d89d2e6a6daee30d18e83e39ef3a/lxml-4.1.1.tar.gz#md5=0265ad6701951347f2dbbb470e3d1512
Processing lxml-4.1.1.tar.gz
Writing /tmp/easy_install-K__Woh/lxml-4.1.1/setup.cfg
Running lxml-4.1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-K__Woh/lxml-4.1.1/egg-dist-tmp-A9V42V
Building lxml version 4.1.1.
Building without Cython.
ERROR: /bin/sh: 1: xslt-config: not found

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
warning: no files found matching '*.html' under directory 'doc'
src/lxml/etree.c:97:20: fatal error: Python.h: No such file or directory
#include "Python.h"
                    ^
compilation terminated.
Compile failed: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
/tmp/easy_install-K__Woh/lxml-4.1.1/temp/xmlXPathInit82OMAG.c:1:26: fatal error: libxml/xpath.h: No such file or directory
#include "libxml/xpath.h"
                          ^
compilation terminated.
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: Setup script exited with error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
pi@raspberrypi:~/epg2xml-1.2.4 $
pi@raspberrypi:~/epg2xml-1.2.4 $  sudo apt-get install libxml2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  libxml2-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 616 kB of archives.
After this operation, 2,276 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libxml2-dev armhf 2.9.1+dfsg1-5+deb8u6 [616 kB]
Fetched 616 kB in 1s (379 kB/s)
Selecting previously unselected package libxml2-dev:armhf.
(Reading database ... 48999 files and directories currently installed.)
Preparing to unpack .../libxml2-dev_2.9.1+dfsg1-5+deb8u6_armhf.deb ...
Unpacking libxml2-dev:armhf (2.9.1+dfsg1-5+deb8u6) ...
Processing triggers for man-db (2.7.5-1~bpo8+1) ...
Setting up libxml2-dev:armhf (2.9.1+dfsg1-5+deb8u6) ...
pi@raspberrypi:~/epg2xml-1.2.4 $ sudo apt-get install libxslt1-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  libxslt1-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 498 kB of archives.
After this operation, 2,193 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libxslt1-dev armhf 1.1.28-2+deb8u3 [498 kB]
Fetched 498 kB in 1s (342 kB/s)
Selecting previously unselected package libxslt1-dev:armhf.
(Reading database ... 49063 files and directories currently installed.)
Preparing to unpack .../libxslt1-dev_1.1.28-2+deb8u3_armhf.deb ...
Unpacking libxslt1-dev:armhf (1.1.28-2+deb8u3) ...
Processing triggers for man-db (2.7.5-1~bpo8+1) ...
Setting up libxslt1-dev:armhf (1.1.28-2+deb8u3) ...
pi@raspberrypi:~/epg2xml-1.2.4 $

pi@raspberrypi:~/epg2xml-1.2.4 $ sudo apt-get install python-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libexpat1-dev libpython-dev libpython2.7-dev python2.7-dev
The following NEW packages will be installed:
  libexpat1-dev libpython-dev libpython2.7-dev python-dev
  python2.7-dev
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 18.3 MB of archives.
After this operation, 26.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libexpat1-dev armhf 2.1.0-6+deb8u4 [115 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libpython2.7-dev armhf 2.7.9-2+deb8u1 [17.9 MB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-dev armhf 2.7.9-1 [1,188 B]
Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main libpython-dev armhf 2.7.9-1 [19.6 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main python2.7-dev armhf 2.7.9-2+deb8u1 [287 kB]
Fetched 18.3 MB in 4s (3,872 kB/s)
Selecting previously unselected package libexpat1-dev:armhf.
(Reading database ... 49208 files and directories currently installed.)
Preparing to unpack .../libexpat1-dev_2.1.0-6+deb8u4_armhf.deb ...
Unpacking libexpat1-dev:armhf (2.1.0-6+deb8u4) ...
Selecting previously unselected package libpython2.7-dev:armhf.
Preparing to unpack .../libpython2.7-dev_2.7.9-2+deb8u1_armhf.deb ...
Unpacking libpython2.7-dev:armhf (2.7.9-2+deb8u1) ...
Selecting previously unselected package libpython-dev:armhf.
Preparing to unpack .../libpython-dev_2.7.9-1_armhf.deb ...
Unpacking libpython-dev:armhf (2.7.9-1) ...
Selecting previously unselected package python2.7-dev.
Preparing to unpack .../python2.7-dev_2.7.9-2+deb8u1_armhf.deb ...
Unpacking python2.7-dev (2.7.9-2+deb8u1) ...
Selecting previously unselected package python-dev.
Preparing to unpack .../python-dev_2.7.9-1_armhf.deb ...
Unpacking python-dev (2.7.9-1) ...
Processing triggers for man-db (2.7.5-1~bpo8+1) ...
Setting up libexpat1-dev:armhf (2.1.0-6+deb8u4) ...
Setting up libpython2.7-dev:armhf (2.7.9-2+deb8u1) ...
Setting up libpython-dev:armhf (2.7.9-1) ...
Setting up python2.7-dev (2.7.9-2+deb8u1) ...
Setting up python-dev (2.7.9-1) ...
pi@raspberrypi:~/epg2xml-1.2.4 $

pi@raspberrypi:~/epg2xml-1.2.4 $ sudo pip install lxml
sudo: pip: command not found
pi@raspberrypi:~/epg2xml-1.2.4 $ sudo easy_install pip
Searching for pip
Reading https://pypi.python.org/simple/pip/
Best match: pip 9.0.1
Downloading https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
Processing pip-9.0.1.tar.gz
Writing /tmp/easy_install-Z7Zej7/pip-9.0.1/setup.cfg
Running pip-9.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Z7Zej7/pip-9.0.1/egg-dist-tmp-tyAtSO
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
  warnings.warn(msg)
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching '.landscape.yml'
warning: no previously-included files found matching 'pip/_vendor/Makefile'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'appveyor.yml'no previously-included directories found matching '.github'
no previously-included directories found matching '.travis'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'contrib'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
Adding pip 9.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
pi@raspberrypi:~/epg2xml-1.2.4 $

pi@raspberrypi:~/epg2xml-1.2.4 $ sudo pip install lxml
Collecting lxml
  Downloading lxml-4.1.1.tar.gz (2.4MB)
    10% |███▎                            | 245kB 3.4MB/s eta 0:00:0    10% |███▍                            | 256kB 3.5MB/s eta 0:00:0    11% |███▋                            | 266kB 4.1MB/s eta 0:00:0    11% |███▊                            | 276kB 4.1MB/s eta 0:00:0   
    ‎.
    ‎.
    ‎.
100% |████████████████████████████████| 2.4MB 105kB/s
Installing collected packages: lxml
  Running setup.py install for lxml ... done
Successfully installed lxml-4.1.1
pi@raspberrypi:~/epg2xml-1.2.4 $

pi@raspberrypi:~/epg2xml-1.2.4 $ sudo apt-get install python-bs4
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  python-chardet python-lxml
Suggested packages:
  python-lxml-dbg
The following NEW packages will be installed:
  python-bs4 python-chardet python-lxml
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 864 kB of archives.
After this operation, 3,453 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-bs4 all 4.3.2-2 [77.7 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-chardet all 2.3.0-1 [96.2 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-lxml armhf 3.4.0-1 [690 kB]
Fetched 864 kB in 2s (344 kB/s)
Selecting previously unselected package python-bs4.
(Reading database ... 49372 files and directories currently installed.)
Preparing to unpack .../python-bs4_4.3.2-2_all.deb ...
Unpacking python-bs4 (4.3.2-2) ...
Selecting previously unselected package python-chardet.
Preparing to unpack .../python-chardet_2.3.0-1_all.deb ...
Unpacking python-chardet (2.3.0-1) ...
Selecting previously unselected package python-lxml.
Preparing to unpack .../python-lxml_3.4.0-1_armhf.deb ...
Unpacking python-lxml (3.4.0-1) ...
Processing triggers for man-db (2.7.5-1~bpo8+1) ...
Setting up python-bs4 (4.3.2-2) ...
Setting up python-chardet (2.3.0-1) ...
Setting up python-lxml (3.4.0-1) ...
pi@raspberrypi:~/epg2xml-1.2.4 $

pi@raspberrypi:~/epg2xml-1.2.4 $ sudo /usr/bin/python /home/pi/epg2xml-1.2.4/epg2xml.py -i KT -s /home/hts/.hts/tvheadend/epggrab/xmltv.sock
Error :  requests 모듈이 설치되지 않았습니다.
pi@raspberrypi:~/epg2xml-1.2.4 $

pi@raspberrypi:~/epg2xml-1.2.4 $ sudo apt-get install python-requests
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  python-ndg-httpsclient python-openssl python-pyasn1 python-six
  python-urllib3
Suggested packages:
  python-openssl-doc python-openssl-dbg doc-base
The following NEW packages will be installed:
  python-ndg-httpsclient python-openssl python-pyasn1
  python-requests python-six python-urllib3
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 427 kB of archives.
After this operation, 1,688 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-openssl armhf 0.13.1-2 [85.5 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-ndg-httpsclient all 0.3.2-1 [20.5 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-pyasn1 all 0.1.7-1 [49.3 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-six all 1.8.0-1 [12.6 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-urllib3 all 1.9.1-3 [55.4 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-requests all 2.4.3-6 [204 kB]
Fetched 427 kB in 4s (92.6 kB/s)
Selecting previously unselected package python-openssl.
(Reading database ... 49527 files and directories currently installed.)
Preparing to unpack .../python-openssl_0.13.1-2_armhf.deb ...
Unpacking python-openssl (0.13.1-2) ...
Selecting previously unselected package python-ndg-httpsclient.
Preparing to unpack .../python-ndg-httpsclient_0.3.2-1_all.deb ...
Unpacking python-ndg-httpsclient (0.3.2-1) ...
Selecting previously unselected package python-pyasn1.
Preparing to unpack .../python-pyasn1_0.1.7-1_all.deb ...
Unpacking python-pyasn1 (0.1.7-1) ...
Selecting previously unselected package python-six.
Preparing to unpack .../python-six_1.8.0-1_all.deb ...
Unpacking python-six (1.8.0-1) ...
Selecting previously unselected package python-urllib3.
Preparing to unpack .../python-urllib3_1.9.1-3_all.deb ...
Unpacking python-urllib3 (1.9.1-3) ...
Selecting previously unselected package python-requests.
Preparing to unpack .../python-requests_2.4.3-6_all.deb ...
Unpacking python-requests (2.4.3-6) ...
Setting up python-openssl (0.13.1-2) ...
Setting up python-ndg-httpsclient (0.3.2-1) ...
Setting up python-pyasn1 (0.1.7-1) ...
Setting up python-six (1.8.0-1) ...
Setting up python-urllib3 (1.9.1-3) ...
Setting up python-requests (2.4.3-6) ...
Processing triggers for python-support (1.0.15) ...
pi@raspberrypi:~/epg2xml-1.2.4 $

댓글

이 블로그의 인기 게시물

라즈베리파이 외장하드 UUID 확인 방법

외장하드 마운트할때 유용하게 쓸수있는 명령어이다. => sudo blkid

라즈베리파이 miniDLNA 1.2.1

1. 라이브러리를 설치한다. sudo apt-get install autopoint debhelper dh-autoreconf gcc libavutil-dev libavcodec-dev libavformat-dev libjpeg-dev libsqlite3-dev libexif-dev libid3tag0-dev libogg-dev libvorbis-dev libflac-dev -y 2. 소스파일을 다운로드 받는다. wget  http://downloads.sourceforge.net/project/minidlna/minidlna/1.2.1/minidlna-1.2.1.tar.gz 만약 다운로드가 안되면 직접사이트에 들어가서 다운받는다. 3. 다운받은 파일 압축을 푼다. tar -xvf minidlna-1.2.1.tar.gz 4. minidlna 디렉토리로 들어간다. cd minidlna-1.2.1 5. configure, make, 그리고 minidlna 를 설치한다. ./configure && sudo make && sudo make install 6. 기본 설정 파일을 아래경로로 복사한다. sudo cp minidlna.conf /etc/ 7. 부팅시 자동으로 실행하게 스크립트를 등록한다. sudo cp linux/minidlna.init.d.script /etc/init.d/minidlna 8. 스크립트에 권한을 설정한다. sudo chmod +x /etc/init.d/minidlna 9. minidlna 를 기본으로 사용할 수 있게 설정한다. sudo update-rc.d minidlna defaults 10. minidlna.conf 설정하기 sudo nano /etc/minidlna.conf 아래와 같은 부분만 설정 #표시를 제거해서 주석처리를 제거한다. media_dir=V,/mnt/Tdown friendly_name=Raspberry DLNA inotify=yes media_

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 );