我試圖使用VTE模塊運行腳本的bash: 我有幾個錯誤, 其中之一是:運行腳本的bash使用VTE模塊
avconv version 9.11-6:9.11-2ubuntu2, Copyright (c) 2000-2013 the Libav developers
built on Mar 24 2014 06:12:33 with gcc 4.8 (Ubuntu 4.8.2-17ubuntu1)
: No such file or directory
這裏是一塊我的python腳本:
def download(self, a, donnees=None):
adresse = self.champ.get_text()
self.v.fork_command('./pluzz.sh', '-u', adresse) # calling the bash script
[...]
def __init__(self):
self.v = vte.Terminal()
self.v.set_emulation('xterm')
self.v.show()
self.box1.add(self.v)
和一塊的bash腳本的:
echo -e "$VERT""DEBUT DU TRAITEMENT""$NORMAL"
#Recuperation de l' ID de l' emission
UserAgent='Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0'
ID=$(wget -q -U "${UserAgent}" "${URL}" -O - | grep -E "og:url.*content.*http://*" | sed 's+.*,\([0-9]*\).*+\1+g')
#wget du json conteant les infos
echo -e "$ROSE""-->RECUPERATION DU JSON""$NORMAL"
JSON="$(wget -q -U "${UserAgent}" "http://webservices.francetelevisions.fr/tools/getInfosOeuvre/v2/?idDiffusion=${ID}&catalogue=Pluzz&callback=webserviceCallback_${ID}" -O - | sed 's+\\/+/+g')"
#Recuperation des infos
echo -e "$ROSE""-->TRAITEMENT DU JSON""$NORMAL"
DATE="$(echo "${JSON}" | sed 's+.*date_debut..\"\([^\"]*\)\".*+\1+g')"
PROG="$(echo "${JSON}" | sed 's+.*code_programme..\"\([^\"]*\)\".*+\1+g')"
M3U="$(echo "${JSON}" | sed 's+.*url..\"\([^\"]*m3u8\)\".*+\1+g')"
#Recuperation du master M3U et traitement
echo -e "$BLEU""-->RECUPERATION DU FICHIER VIDEO""$NORMAL"
M3U2="$(wget -q -U "'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0'" "${M3U}" -O - | grep -E ".*index_2.*")"
avconv -i "${M3U2}" -vcodec copy -acodec copy "${PROG}_${ID}.mkv"
的BAS^h腳本在控制檯運行良好:
:~./pluzz.sh http://pluzz.francetv.fr/videos/coluche_un_clown_ennemi_d_etat.html
DEBUT DU TRAITEMENT
-->RECUPERATION DU JSON
-->TRAITEMENT DU JSON
-->RECUPERATION DU FICHIER VIDEO
avconv version 9.11-6:9.11-2ubuntu2, Copyright (c) 2000-2013 the Libav developers
built on Mar 24 2014 06:12:33 with gcc 4.8 (Ubuntu 4.8.2-17ubuntu1)
[hls,applehttp @ 0x1ebfe00] max_analyze_duration reached
Input #0, hls,applehttp, from 'http://ftvodhdsecz-f.akamaihd.net/i/streaming-adaptatif_france-dom-tom/2014/S18/J5/101152365-20140502-,398,632,934,k.mp4.csmil/index_2_av.m3u8?null=':
Duration: 00:56:10.00, start: 0.100667, bitrate: 0 kb/s
Stream #0.0: Video: h264 (Main), yuv420p, 704x396 [PAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0.1: Audio: aac, 48000 Hz, stereo, fltp
Stream #0.2: Data: [21][0][0][0]/0x0015
我希望我的解釋是明確的...... 感謝
編輯: 我已經找到了解決辦法:更換
self.v.fork_command('./pluzz.sh', '-u', adresse)
by
self.v.fork_command(None, ['/bin/bash', '-u', './pluzz.sh', adresse])
感謝您的幫助,是的,ID不是wget的dwld。 – Guillaume
你的代碼的結果是:[code] p:l:沒有這樣的文件或目錄[/ code] – Guillaume
如果你想查看這兩個代碼的總數:https://www.dropbox.com/s/c9j0d21f4prhpaz/ dPluzz_v2.1.py.tar.gz – Guillaume