Giter VIP home page Giter VIP logo

Comments (7)

y7x avatar y7x commented on June 6, 2024 2

Funny thing:

I found ### How do I download a video starting with a - ? in their FAQ (https://github.com/rg3/youtube-dl#how-do-i-download-a-video-starting-with-a---)
and it says this:

Either prepend http://www.youtube.com/watch?v= or separate the ID from the options with --:

youtube-dl -- -wNyEUrxzFU
youtube-dl "http://www.youtube.com/watch?v=-wNyEUrxzFU"

I think I'll ask them in the IRC if they really don't see a different solution.

from mumbledj.

matthieugrieger avatar matthieugrieger commented on June 6, 2024

Ooh, good find! What happens if you just use the existing command and put
quotes around the ID?
On Feb 19, 2015 8:51 PM, "y7x" [email protected] wrote:

Hi,

When I !add https://www.youtube.com/watch?v=-w-58hQ9dLk, I get the "The
audio download for this video failed. YouTube has likely not generated the
audio files for this video yet. Skipping to the next song!" error message.

The problem seems to be that youtube-dl doesn't recognise video IDs that
start with a -.
youtube-dl -w-58hQ9dLk doesn't work because it confuses the ID with a
command line option.
The audio files definitely exist on youtube.

youtube-dl "ytsearch:'-w-58hQ9dLk'" doesn't find any results either, so
it looks like youtube-dl can't handle it when we only give it a video ID
which starts with a -.

I worked around it for now by changing line 83 in song.go from
cmd := exec.Command("youtube-dl", "--output",
fmt.Sprintf(~/.mumbledj/songs/%s.m4a, s.youtubeId), "--format", "m4a",
s.youtubeId)
to
cmd := exec.Command("youtube-dl", "--output",
fmt.Sprintf(~/.mumbledj/songs/%s.m4a, s.youtubeId), "--format", "m4a",
fmt.Sprintf(https://www.youtube.com/watch?v=%s, s.youtubeId))

It works of course if you do youtube-dl -- -w-58hQ9dLk or use the whole
URL for example, but I don't think you or the youtube-dl devs want to have
to handle such cases manually (if possible).

Thought I'd let you know of this. Do you think the youtube-dl devs would
like to know about this issue or am I missing some obvious solution to this
problem?


Reply to this email directly or view it on GitHub
#46.

from mumbledj.

y7x avatar y7x commented on June 6, 2024

Then it's just youtube-dl "-w-58hQ9dLk"
and produces the same error output:

Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: no such option: --

still recognised as command line option "w-58hQ9dLk" which youtube-dl obviously doesn't have.

edit: and if you mean putting quotes around s.youtubeId on line 83: that doesn't work since it then always puts literally "s.youtubeId" as ID into the command.

from mumbledj.

matthieugrieger avatar matthieugrieger commented on June 6, 2024

Huh, that's strange. I don't think that's supposed to happen. Maybe submit
an issue for youtube-dl?
On Feb 19, 2015 9:22 PM, "y7x" [email protected] wrote:

Then it's just youtube-dl "-w-58hQ9dLk"
and produces the same error output:

Usage: youtube-dl [OPTIONS] URL [URL...]

youtube-dl: error: you must provide at least one URL

still recognised as command line option "w-58hQ9dLk" which youtube-dl
obviously doesn't have.


Reply to this email directly or view it on GitHub
#46 (comment)
.

from mumbledj.

y7x avatar y7x commented on June 6, 2024

I'll do that then.

from mumbledj.

 avatar commented on June 6, 2024

This is simply standard practice on how command line flag are parsed; I think youtube-dl does the right thing here.

MumbleDJ can be easily modified so all video IDs are accepted:

cmd := exec.Command("youtube-dl", "--output", fmt.Sprintf(`~/.mumbledj/songs/%s.m4a`, s.youtubeId), "--format", "m4a", "--", s.youtubeId)

from mumbledj.

matthieugrieger avatar matthieugrieger commented on June 6, 2024

@bontibon: I was going to do exactly that. Just haven't gotten to it yet. :)

from mumbledj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.