Temat: Bashnapi bundle - NapiProjekt Client na OpenWRT

Witam serdecznie, proszę o pomoc w instalacji Bashnapi bundle (skrypty pobierające napisy z napiprojekt) na Gargoyle. 

Instrukcja z githuba : https://github.com/dagon666/napi

Instalation
AUTOMATIC

Use the install.sh script to copy napi.sh / subotage.sh to the bin directory (/usr/bin - bu default) and napi_common.sh library to a shared directory (/usr/share/napi - bu default). If you want to install into directories different than defaults specify them in install.sh invocation (USE ABSOLUTE PATHS ONLY).

Examples $ ./install.sh --bindir /bin --shareddir /shared - this will install napi.sh & subotage.sh under /bin and napi_common.sh under /shared/napi

or

$ ./install.sh --shareddir /my/custom/directory
- this will install napi.sh & subotage.sh under /usr/bin (default path) and napi_common.sh under /my/custom/directory/napi
MANUAL napi.sh & subotage.sh share some common code from napi_common.sh. Both of them are sourcing this file. Bellow is an example installation procedure given (executables under /usr/bin, libraries under /usr/shared/napi)

Edit path to napi_common.sh in napi.sh & subotage.sh:
Search for a variable NAPI_COMMON_PATH

38  
39  # verify presence of the napi_common library
40  declare -r NAPI_COMMON_PATH=
and set it to /usr/shared/napi

38  
39  # verify presence of the napi_common library
40  declare -r NAPI_COMMON_PATH="/usr/shared/napi"
Place the napi.sh & subotage.sh under /usr/bin:

$ cp -v napi.sh subotage.sh /usr/bin

Create the /usr/shared/napi directory and place the library inside of it:

$ mkdir -p /usr/shared/napi $ cp -v napi_common.sh /usr/shared/napi

bashnapi bundle is now installed

Pakiet "napiprojekt" Cezarego ściąga tylko napisy w formacie txt. A mój TV ich nie obsługuje.

Oto moje wyniki po zastosowaniu sie do instrukcji na http://eko.one.pl/forum/viewtopic.php?id=2854

root@WD My Net N750:/usr/share# opkg install mediainfo 
ERROR: No package named mediainfo found, try updating your package lists

##tu nie znalazło mi tego pakietu :(

root@WD My Net N750:/usr/share# opkg install bash
Preparing to install the following packages, which will require 326628 bytes:
        bash

Preparing to install package bash...
        Downloading...
        Downloaded bash successfully.
        Installing bash...
        Successfully installed bash.
Installation of packages successful.

root@WD My Net N750:/usr/share# opkg install coreutils-stat 
Preparing to install the following packages, which will require 36127 bytes:
        coreutils-stat, coreutils

Preparing to install package coreutils...
        Downloading...
        Downloaded coreutils successfully.
        Installing coreutils...
        Successfully installed coreutils.
Preparing to install package coreutils-stat...
        Downloading...
        Downloaded coreutils-stat successfully.
        Installing coreutils-stat...
        Successfully installed coreutils-stat.
Installation of packages successful.

root@WD My Net N750:/usr/share# opkg install curl
Preparing to install the following packages, which will require 42482 bytes:
        curl

Preparing to install package curl...
        Downloading...
        Downloaded curl successfully.
        Installing curl...
        Successfully installed curl.
Installation of packages successful.

root@WD My Net N750:/usr/share# opkg install mediainfo 
ERROR: No package named mediainfo found, try updating your package lists

root@WD My Net N750:/usr/share# cd /tmp
root@WD My Net N750:/tmp# curl -L -o napiprojekt http://sourceforge.net/projects/bashnapi/files/latest/download
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   413    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0   327    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100 98580  100 98580    0     0  10344      0  0:00:09  0:00:09 --:--:-- 35282
root@WD My Net N750:/tmp# tar xvzf napiprojekt > /dev/null
tar: warning: skipping header 'g'
root@WD My Net N750:/tmp# cp napi*/napi.sh /usr/bin
root@WD My Net N750:/tmp# ls
TZ                       drives_found.txt         minidlna.conf            resolv.conf              sysinfo
bw_backup                etc                      mounted_usb_storage.tab  resolv.conf.auto         usb_mount
cached_basic_vars        fstab                    napi-1.3.5               run                      vsftpd
data                     hosts                    napiprojekt              share_home
dhcp.leases              lock                     opkg-lists               spool
do_webmon_backup.sh      log                      overlay                  state
root@WD My Net N750:/tmp# cd napi-1.3.5/
root@WD My Net N750:/tmp/napi-1.3.5# ls
AUTHORS         COLABORATION    GPL             LICENSE         Vagrantfile     debian          manifests       napi_common.sh  test_tools.sh
BUGS            ChangeLog       INSTALL         README.md       deb_build.sh    install.sh      napi.sh         subotage.sh     tests
root@WD My Net N750:/tmp/napi-1.3.5# cp subotage.sh /usr/bin
root@WD My Net N750:/tmp/napi-1.3.5# [ -f /usr/bin/napi.sh ]     || echo "Brakuje napi.sh"
root@WD My Net N750:/tmp/napi-1.3.5# [ -f /usr/bin/subotage.sh ] || echo "Brakuje subotage.sh"
root@WD My Net N750:/tmp/napi-1.3.5# chmod +x /usr/bin/napi.sh
root@WD My Net N750:/tmp/napi-1.3.5# chmod +x /usr/bin/subotage.sh
root@WD My Net N750:/tmp/napi-1.3.5# sed -i -e "s/g_FpsTool[ \t]*=[ \t]*\"\"/g_FpsTool=\"mediainfo\"/" /usr/bin/napi.sh
root@WD My Net N750:/tmp/napi-1.3.5# sed -i -e "s/g_SubotagePresence[ \t]*=[ \t]*0/g_SubotagePresence=1/" /usr/bin/napi.sh
root@WD My Net N750:/tmp/napi-1.3.5# sed -i -e "s/#rm[ \t]*-rf[ \t]*\"\$g_ProcTmpFile\"/rm -f \"\$g_ProcTmpFile\"/" /usr/bin/subotage.sh
root@WD My Net N750:/tmp/napi-1.3.5# ln -s /proc/self/fd /dev/fd
root@WD My Net N750:/tmp/napi-1.3.5# cd -
/tmp
root@WD My Net N750:/tmp# napi.sh

napi.sh i subotage.sh nie zostaly poprawnie zainstalowane
uzyj skryptu install.sh (install.sh --help - pomoc)
aby zainstalowac napi.sh w wybranym katalogu

root@WD My Net N750:/tmp/napi-1.3.5# install.sh --help 
-ash: install.sh: not found

root@WD My Net N750:/tmp/napi-1.3.5# install.sh 
-ash: install.sh: not found

Jak uruchomić ten skrypt install.sh ??

2

Odp: Bashnapi bundle - NapiProjekt Client na OpenWRT

./install.sh jak już.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: Bashnapi bundle - NapiProjekt Client na OpenWRT

Ok, działa. Dziękuję.

Skąd mogę pobrać ten pakiet mediainfo?

root@WD My Net N750:~# napi.sh
==============================================================
napi.sh version v1.3.5 (identifies as NapiProjektPython)
napi.sh [OPCJE] <plik|katalog|*>

   -a  | --abbrev <string> - dodaj dowolny string przed rozszerzeniem (np. nazwa.<string>.txt)
   -b  | --bigger-than <size MB> - szukaj napisow tylko dla plikow wiekszych niz <size>
   -c  | --cover - pobierz okladke
   -e  | --ext - rozszerzenie dla pobranych napisow (domyslnie *.txt)
   -F  | --forks - okresl recznie ile rownoleglych procesow utworzyc (dom. 2)
   -I  | --id <pynapi|other|NapiProjektPython|NapiProjekt> - okresla jak napi.sh ma sie przedstawiac serwerom napiprojekt.pl (dom. NapiProjektPython)
   -l  | --log <logfile> - drukuj output to pliku zamiast na konsole
   -lo | --log-overwrite - jezeli plik loga juz istnieje - nadpisz go
   -L  | --language <LANGUAGE_CODE> - pobierz napisy w wybranym jezyku
   -M  | --move - w przypadku opcji (-s) przenos pliki, nie kopiuj
   -n  | --nfo - utworz plik z informacjami o napisach (wspierane tylko z id NapiProjektPython/NapiProjekt)
   -p  | --pass <passwd> - haslo dla uzytkownika <login>
   -S  | --script <script_path> - wywolaj skrypt po pobraniu napisow (sciezka do pliku z napisami, relatywna do argumentu napi.sh, bedzie przekazana jako argument)
   -s  | --skip - nie sciagaj, jezeli napisy juz sciagniete
   -u  | --user <login> - uwierzytelnianie jako uzytkownik
   -v  | --verbosity <0..3> - zmien poziom gadatliwosci 0 - cichy, 3 - debug
       | --stats - wydrukuj statystyki (domyslnie nie beda drukowane)
   -d  | --delete-orig - Delete the original file
   -f  | --format - konwertuj napisy do formatu (wym. subotage.sh)
   -P  | --pref-fps <fps_tool> - preferowany detektor fps (jezeli wykryto jakikolwiek)
   -o  | --orig-prefix - prefix dla oryginalnego pliku przed konwersja (domyslnie: ORIG_)
       | --conv-abbrev <string> - dodaj dowolny string przed rozszerzeniem podczas konwersji formatow

Obslugiwane formaty konwersji napisow
        microdvd - {start}{stop} - Format based on frames. Uses given framerate
                (default is [0] fps)
        mpl2 - [start][stop] format. The unit is time based == 0.1 sec
        subrip - hh.mm.ss,mmm -> hh.mm.ss,mmm format
        subviewer2 - hh:mm:ss:dd,hh:mm:ss:dd format with header.
                Resolution = 10ms. Header is ignored
        tmplayer - hh:mm:ss timestamp format without the
                stop time information. Mostly deprecated

Przyklady:
 napi.sh film.avi          - sciaga napisy dla film.avi.
 napi.sh -c film.avi       - sciaga napisy i okladke dla film.avi.
 napi.sh -u foo -p bar -c film.avi - sciaga napisy i okladke do
                             film.avi jako uzytkownik foo
 napi.sh *                 - szuka plikow wideo w obecnym katalogu
                             i podkatalogach, po czym stara sie dla
                             nich znalezc i pobrac napisy.
 napi.sh *.avi             - wyszukiwanie tylko plikow avi.
 napi.sh katalog_z_filmami - wyszukiwanie we wskazanym katalogu
                             i podkatalogach.
 napi.sh -f subrip *       - sciaga napisy dla kazdego znalezionego pliku
                           po czym konwertuje je do formatu subrip

By moc okreslac FPS na podstawie pliku video a nie na
podstawie pierwszej linii pliku (w przypadku konwersji z microdvd)
zainstaluj dodatkowo jedno z tych narzedzi (dowolne)
ffmpeg
ffprobe
mediainfo
mplayer
mplayer2

root@WD My Net N750:~# opkg update
Downloading package list for attitude_adjustment source...
Package list for attitude_adjustment downloaded successfully.

Downloading package list for eko1 source...
Package list for eko1 downloaded successfully.

Downloading package list for gargoylepl_plugins source...
Package list for gargoylepl_plugins downloaded successfully.

Downloading package list for gargoylepl_packages source...
Package list for gargoylepl_packages downloaded successfully.

root@WD My Net N750:~# opkg install mplayer
ERROR: No package named mplayer found, try updating your package lists

root@WD My Net N750:~# opkg install ffprobe
ERROR: Not enough space in destination root to install specified packages:
        libffmpeg-full, ffprobe

root@WD My Net N750:~# opkg install ffmpeg
ERROR: Not enough space in destination root to install specified packages:
        libffmpeg-full, ffmpeg

root@WD My Net N750:~# opkg install mplayer2
ERROR: No package named mplayer2 found, try updating your package lists

root@WD My Net N750:~# opkg install mediainfo
ERROR: No package named mediainfo found, try updating your package lists

4

Odp: Bashnapi bundle - NapiProjekt Client na OpenWRT

Nie ma go w pakietach.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.