Κι εγώ νόμιζα ότι έφταιγε ο youtube-dl στο μηχανημά μου... Τα options τα
πήρα όπως τα είχες στο αρχικό σου email.

Με ένα γρήγορο googlάρισμα, τα options που θες είναι μάλλον τα εξής:

'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4'

Οπότε αλλάζεις την αντίστοιχη γραμμή στο script:

youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' $url

---
Konstantinos Togias
M.Sc. in Mathematics of Computers and Decision Making
Software & Web Applications Developer

tel. (+30)6946977595
e-mail: i...@ktogias.gr
www: http://ktogias.gr


On Mon, Feb 25, 2019 at 3:13 PM Αντώνης Αντωνούλας <aanto...@otenet.gr>
wrote:

> Κωνσταντίνε έφτιαξα το script αλλά όταν το τρέχω βγάζει λάθη π.χ.:
>
> Please type the video URL:
> https://youtu.be/ONXfL6evR0Q
> [youtube] ONXfL6evR0Q: Downloading webpage
> [youtube] ONXfL6evR0Q: Downloading video info webpage
> Traceback (most recent call last):
>    File "/bin/youtube-dl", line 11, in <module>
>      load_entry_point('youtube-dl==2019.2.18', 'console_scripts',
> 'youtube-dl')()
>    File "/usr/lib/python3.7/site-packages/youtube_dl/__init__.py", line
> 472, in main
>      _real_main(argv)
>    File "/usr/lib/python3.7/site-packages/youtube_dl/__init__.py", line
> 462, in _real_main
>      retcode = ydl.download(all_urls)
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 2006, in download
>      url,
> force_generic_extractor=self.params.get('force_generic_extractor', False))
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 805, in extract_info
>      return self.process_ie_result(ie_result, download, extra_info)
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 859, in process_ie_result
>      return self.process_video_result(ie_result, download=download)
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 1601, in process_video_result
>      format_selector = self.build_format_selector(req_format)
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 1383, in build_format_selector
>      return _build_selector_function(parsed_selector)
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 1230, in _build_selector_function
>      fs = [_build_selector_function(s) for s in selector]
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 1230, in <listcomp>
>      fs = [_build_selector_function(s) for s in selector]
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 1340, in _build_selector_function
>      video_selector, audio_selector = map(_build_selector_function,
> selector.selector)
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 1230, in _build_selector_function
>      fs = [_build_selector_function(s) for s in selector]
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 1230, in <listcomp>
>      fs = [_build_selector_function(s) for s in selector]
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 1347, in _build_selector_function
>      filters = [self._build_format_filter(f) for f in selector.filters]
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 1347, in <listcomp>
>      filters = [self._build_format_filter(f) for f in selector.filters]
>    File "/usr/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line
> 1087, in _build_format_filter
>      raise ValueError('Invalid filter specification %r' % filter_spec)
> ValueError: Invalid filter specification 'm4a
>
> πράγμα που δεν συμβαίνει όταν δίνω την εντολή κανονικά δηλ. χωρίς το
> script.
>
> Καμιά ιδέα;
>
>
> Στις 25/2/19 2:39 μ.μ., ο Konstantinos Togias έγραψε:
> > Μπορείς πολύ εύκολα να το κάνεις με ένα bash shell script. Δημιουργείς
> > ένα αρχείο κειμένου με όνομα π.χ. yt.sh και εισάγεις σε αυτό το
> > παρακάτω περιεχόμενο:
> >
> > #!/bin/bash
> > # This is a bash script thus it must be interpreted by bash
> >
> > # Echo a prompt:
> > echo Please type the video URL:
> > # Read the string user types into a variable with name url:
> > read url
> > # Run youtube-dl giving it url string as its last parameter:
> > youtube-dl -f bestvideo[ext=mp4]+bestaudio[m4a] $url
> >
> > Στο τέλος θα χρειαστεί να δώσεις το execution flag στο αρχείο:
> > chmod +x yt.sh
> >
> > Ακόμα, ίσως θες να το βάλεις σε κάποιο σημείο που βρίσκεται στο PATH
> > του shell σου, ώστε να μην χρειάζεσαι τη διαδρομή του για να το
> > καλέσεις, όπως π.χ. στο ~/.local/bin/ .
> >
> > ---
> > Konstantinos Togias
> > M.Sc. in Mathematics of Computers and Decision Making
> > Software & Web Applications Developer
> >
> > tel. (+30)6946977595
> > e-mail: i...@ktogias.gr <mailto:i...@ktogias.gr>
> > www: http://ktogias.gr
> >
> >
> > On Mon, Feb 25, 2019 at 2:09 PM Αντώνης Αντωνούλας <aanto...@otenet.gr
> > <mailto:aanto...@otenet.gr>> wrote:
> >
> >     Θα ήθελα τη βοήθειά σας σε ένα θέμα που έχει σχέση με το τερματικό.
> >
> >     Χρησιμοποιώ το youtube-dl για να κατεβάσω κάποιο βίντεο από το
> >     youtube
> >     κάνοντας χρήση της εντολής:
> >
> >     youtube-dl -f bestvideo[ext=mp4]+bestaudio[m4a]
> >
> >     και ακολούθως επικολλώ το url του βίντεο δίπλα από την εντολή.
> >
> >     Υπάρχει τρόπος να δημιουργήσω κάποιο script με όνομα π.χ. yt και
> >     μόλις
> >     το πληκτρολογώ να τρέχει τη συγκεκριμένη εντολή ζητώντας μου το
> >     url ώστε
> >     η διαδικασία να γίνεται ευκολότερα;
> >
> >     Ευχαριστώ εκ των προτέρων για την όποια βοήθεια.
> >
> >
> >     --
> >     Ubuntu-gr mailing list
> >     Ubuntu-gr@lists.ubuntu.com <mailto:Ubuntu-gr@lists.ubuntu.com>
> >
> >     If you do not want to receive any more messages from the ubuntu-gr
> >     mailing list, please follow this link and choose unsubscribe:
> >     https://lists.ubuntu.com/mailman/listinfo/ubuntu-gr
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://lists.ubuntu.com/archives/ubuntu-gr/attachments/20190225/9b0e5a60/attachment.html
> >
> --
> Ubuntu-gr mailing list
> Ubuntu-gr@lists.ubuntu.com
>
> If you do not want to receive any more messages from the ubuntu-gr mailing
> list, please follow this link and choose unsubscribe:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-gr
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<https://lists.ubuntu.com/archives/ubuntu-gr/attachments/20190225/a10c63ee/attachment.html>
-- 
Ubuntu-gr mailing list
Ubuntu-gr@lists.ubuntu.com

If you do not want to receive any more messages from the ubuntu-gr mailing 
list, please follow this link and choose unsubscribe:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-gr

Απαντηση