Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get URL from the "-F" list. #26812

Open
5c0tt-b0t opened this issue Oct 5, 2020 · 4 comments
Open

get URL from the "-F" list. #26812

5c0tt-b0t opened this issue Oct 5, 2020 · 4 comments
Labels

Comments

@5c0tt-b0t
Copy link

@5c0tt-b0t 5c0tt-b0t commented Oct 5, 2020

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

First, THANK YOU! this is amazing & its really appreciated!

I stream music daily using the -g option, e.g:

mpv --no-video $(youtube-dl -f bestaudio "ytsearch: --match-title 'ArtistName SongName'" -g)

Its great, thank you! 👍

Personal problem:
I live in an area with terrible internet connection and I am unable to do anything about it, no matter what provider I use, its the area.

When I stream, its a shame that sometimes the track can be 20mb+ when I all I want is the audio, no video.
So instead, I started to use -F worstvideo which can sometimes help out alot, others times... not really, I lose audio-quality and it still uses way too much bandwidth for an audio track.

Then I found -F, used with grep like so:

youtube-dl -F "ytsearch: --match-title 'ArtistName SongName'" | grep 'audio only'

This is great! it shows me the audio-only files, they are all tiny and 99% of the time, the audio-quality is higher than -f worstvideo produces... I am closer to bliss!

Problem:
I am unable to stream these as they do not return a link like the -g option does, I have tried to use them together with no luck, it seems that either -F & -g do not work together.

The actual question... finally!

Is it possible to return the URL of one of the entries listed with -F ?
If not, please consider this a feature-request!
It would allow users to stream and/or get the URL from the -F list, allowing users to stream audio-only files!, saving bandwidth and still getting great audio-quality too.

BLISS!

Once again, thank you.

@5c0tt-b0t 5c0tt-b0t added the question label Oct 5, 2020
@JChris246
Copy link
Contributor

@JChris246 JChris246 commented Oct 5, 2020

Try using -f instead ... youtube-dl -gf format-code url

@5c0tt-b0t
Copy link
Author

@5c0tt-b0t 5c0tt-b0t commented Oct 5, 2020

Try using -f instead ... youtube-dl -gf format-code url

Thanks for the suggestion, but as I stated earlier, I have already done this and also stated:

bandwidth

worse audio quality

non interactive (options not listed)

I need to youtube-dl -F | grep 'no video' or just get a URL from any entry using -F

@JChris246
Copy link
Contributor

@JChris246 JChris246 commented Oct 5, 2020

-f and -F are different. -F will list the available formats, whereas -f will take a param (format-code). So for example

youtube-dl -gf 140 https://www.youtube.com/watch?v=l9nh1l8ZIJQ

would return the url for m4a audio

@pukkandan
Copy link

@pukkandan pukkandan commented Oct 17, 2020

What is the issue with -f bestaudio? It only downloads the audio.

But if you really want to get the urls of each format, you can use -j to get the json and then extract the relevent info using jq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.