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

Problems with format detection / specification #20242

Closed
forthrin opened this issue Mar 4, 2019 · 4 comments
Closed

Problems with format detection / specification #20242

forthrin opened this issue Mar 4, 2019 · 4 comments

Comments

@forthrin
Copy link

@forthrin forthrin commented Mar 4, 2019

Not sure if this is a bug or just "how it is", but there doesn't seem to be a uniform way to get the correct streaming URL for any given site.

SVTPlay has video and audio muxed. Dplay has video and audio as separate streams. The way it is now, youtube-dlmust be given a different -f parameter for each site to print the correct streaming URL.

See examples below. "YES" means the correct URL is printed. "NO" means an incorrect (or no) URL is printed. There is no command line that will work for both sites.

Is it possible to patch youtube-dl so that the correct stream URLs will be returned for both sites without having to specifying -f?

~$ S=https://www.svtplay.se/video/21247603/forsta-dejten-australien/forsta-dejten-australien-sasong-2-avsnitt-7
~$ D=https://www.dplay.no/videoer/forste-date/sesong-2-episode-5

~$ youtube-dl -g $S                          # NO
~$ youtube-dl -g -f best $S                  # YES
~$ youtube-dl -g -f bestvideo+bestaudio $S   # NO

~$ youtube-dl -g $D                          # YES
~$ youtube-dl -g -f best $D                  # NO (*)
~$ youtube-dl -g -f bestvideo+bestaudio $D   # YES

(*) "ERROR: requested format not available"

  • I've verified and I assure that I'm running youtube-dl 2019.03.01
  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser
  • Bug report (encountered problems with youtube-dl)
$ youtube-dl --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out utf8, pref UTF-8
[debug] youtube-dl version 2019.03.01
[debug] Python version 2.7.15 (CPython) - Darwin-16.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1, rtmpdump 2.4
[debug] Proxy map: {}
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 4, 2019

What do you mean by correct streaming URL in the first place? Not all formats have plain HTTP URL representing it.

All aforementioned examples are expected behavior:
1. Base URL for DASH manifest is returned.
3. Same as 1.
5. No such format best exists.

@forthrin
Copy link
Author

@forthrin forthrin commented Mar 4, 2019

@dstftw: I'd like to do vlc $(youtube-dl -g <any-page-url>) and VLC will play the video on that page, in the best available quality.

From the manual:

By default  youtube-dl  tries  to download the best available quality,
i.e.  if you want the best quality you don't need to pass  any  special
options, youtube-dl will guess it for you by default.

However, at least for SVTPlay this fails, so you have to specify a different -f depending on which site you're using. This makes it hard to use youtube-dl in a script that supports different sites.

I realise my knowledge is limited as I don't understand the purpose of a "Base URL for DASH manifest" and why -f best may fail to return a streamable URL for certain sites.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 4, 2019

I'd like to do vlc $(youtube-dl -g <any-page-url>) and VLC will play the video on that page.

That's not always technically possible since there may be only video-only and audio-only formats resulting in -g returning two URLs correspondingly.
Also even if there is an audiovideo format URL returned by -g this is also not supposed to work the way you use it since you don't pass proper cookies and headers.

at least for SVTPlay this fails

What fails? There is no promise in this citation that any media player will be able to play -g URLs alone. What it states is that youtube-dl will download best overall quality media and there is no need to specify any arguments and this indeed works in most of the cases.

@dstftw dstftw closed this Mar 4, 2019
@forthrin
Copy link
Author

@forthrin forthrin commented Mar 4, 2019

OK! Thanks for commenting on the issue.

dstftw added a commit that referenced this issue Mar 4, 2019
…0242)

For symmetry with other segmented media
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
2 participants
You can’t perform that action at this time.