View previous topic :: View next topic |
Author |
Message |
Battlestar Gentoo l33t


Joined: 23 Dec 2004 Posts: 708 Location: Wien
|
Posted: Sat Oct 20, 2007 4:32 pm Post subject: [solved] Bashscript-Problem mit heruntergeladener Datei |
|
|
Hallo,
ich würde gerne mittel Bash-Script und youtube-dl ein gewünschtes File von dort holen, es automatisch mit ffmpeg zu avi umkonvertieren und in ein Verzeichnis verschieben.
Das Problem ist aber, dass das File, wenn ich es auf diese Weise herunterlade, offensichtlich irgendwie zerstört ist. Hier das Script:
Code: | #!/bin/bash
if [ $# -ge 2 ]; then
echo Downloading $1...
FILE=$(youtube-dl $1)
echo Converting $1 to $2.avi...
DEST=$(ffmpeg -i $FILE -sameq -aspect 4:3 -acodec mp3 $2.avi)
mv $DEST /mnt/multimedia/YouTube-Videos/$DEST
else
echo Usage: ytdownloader YOUTUBE-URL TARGET-FILENAME
fi |
welches zu dieser Ausgabe führt .....
Code: | markus@gentoo ~ $ ./ytdownloader http://www.youtube.com/watch?v=gsWqfxld9e8 Königin
Downloading http://www.youtube.com/watch?v=gsWqfxld9e8...
Converting http://www.youtube.com/watch?v=gsWqfxld9e8 to Königin.avi...
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: prefix=/usr libdir=/usr/lib shlibdir=/usr/lib mandir=/usr/share/man enable-static enable-shared cc=i686-pc-linux-gnu-gcc disable-altivec disable-debug disable-audio-oss disable-v4l disable-v4l2 disable-dv1394 disable-network disable-opts enable-libmp3lame enable-libvorbis enable-libogg enable-xvid enable-x11grab enable-libogg enable-libfaad enable-libfaac enable-gpl enable-pp disable-strip
libavutil version: 49.4.0
libavcodec version: 51.40.2
libavformat version: 51.11.0
built on May 17 2007 10:42:42, gcc: 4.1.1 (Gentoo 4.1.1-r3)
Retrieving: I/O error occured
Usually that means that input file is truncated and/or corrupted. |
Was kann ich tun? _________________ vorher: Gentoo Reptile
Last edited by Battlestar Gentoo on Sat Oct 20, 2007 6:25 pm; edited 1 time in total |
|
Back to top |
|
 |
Finswimmer Bodhisattva


Joined: 02 Sep 2004 Posts: 5467 Location: Langen (Hessen), Germany
|
Posted: Sat Oct 20, 2007 4:35 pm Post subject: |
|
|
Probiers mal mit "$1".
Damit musst du / nicht escapen.
Tobi _________________ Bitte auf Rechtschreibung, korrekte Formatierung und Höflichkeit achten!
Danke |
|
Back to top |
|
 |
Battlestar Gentoo l33t


Joined: 23 Dec 2004 Posts: 708 Location: Wien
|
Posted: Sat Oct 20, 2007 6:13 pm Post subject: |
|
|
Sorry, ich weiß nicht, was du meinst? Außerdem escape ich doch gar nichts irgendwo. Und was hat das genau mit dem beschädigten Download zu tun, hmm? _________________ vorher: Gentoo Reptile |
|
Back to top |
|
 |
Battlestar Gentoo l33t


Joined: 23 Dec 2004 Posts: 708 Location: Wien
|
Posted: Sat Oct 20, 2007 6:24 pm Post subject: |
|
|
So klappt es:
Code: |
#!/bin/bash
if [ $# -ge 2 ]; then
echo "Downloading $1..."
youtube-dl $1 -o $2.flv
echo "Converting $1 to $2.avi..."
ffmpeg -i $2.flv -sameq -aspect 4:3 -acodec mp3 $2.avi
mv $2.avi /mnt/multimedia/YouTube-Videos/$2.avi
rm $2.flv
else
echo "Usage: ytdownloader YOUTUBE-URL TARGET-FILENAME"
fi
|
Ich vergaß total, dass youtube-dl ja auch Text ausgibt, wodurch der Inhalt von "FILE" ja quasi dann kein Flash-Movie mehr ist. _________________ vorher: Gentoo Reptile |
|
Back to top |
|
 |
|