Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Bashscript-Problem mit heruntergeladener Datei
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Battlestar Gentoo
l33t
l33t


Joined: 23 Dec 2004
Posts: 708
Location: Wien

PostPosted: Sat Oct 20, 2007 4:32 pm    Post subject: [solved] Bashscript-Problem mit heruntergeladener Datei Reply with quote

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
View user's profile Send private message
Finswimmer
Bodhisattva
Bodhisattva


Joined: 02 Sep 2004
Posts: 5467
Location: Langen (Hessen), Germany

PostPosted: Sat Oct 20, 2007 4:35 pm    Post subject: Reply with quote

Probiers mal mit "$1".
Damit musst du / nicht escapen.

Tobi
_________________
Bitte auf Rechtschreibung, korrekte Formatierung und Höflichkeit achten!
Danke
Back to top
View user's profile Send private message
Battlestar Gentoo
l33t
l33t


Joined: 23 Dec 2004
Posts: 708
Location: Wien

PostPosted: Sat Oct 20, 2007 6:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Battlestar Gentoo
l33t
l33t


Joined: 23 Dec 2004
Posts: 708
Location: Wien

PostPosted: Sat Oct 20, 2007 6:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum