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

How to return formats without url for some m3u8 playlists? #25172

Closed
tarhan opened this issue May 7, 2020 · 1 comment
Closed

How to return formats without url for some m3u8 playlists? #25172

tarhan opened this issue May 7, 2020 · 1 comment
Labels

Comments

@tarhan
Copy link

@tarhan tarhan commented May 7, 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

I'm developing extractor for additional site (wetv.vip) to be exactly.
Videos there are in m3u8 media playlist without m3u8 master playlist.

When you request metadata of any video you select desired quality level in one of http headers.
In response you will receive several urls for same m3u8 media playlist (those which contains #EXT-X-TARGETDURATION tag).
Also there list of all available qualities for this video (usually same for all videos on site but not always). Only information this list contains in name of quality which you can use to request different quality.

Is it possible to return some entry within formats field in info_dict which will have no url?
In this case for --list-formats I want to output just list of formats (url is not needed for this).
If I do not enter --skip-download I could check parameter --format via self._downloader.params.get('format').
If user enter named format I will just request it and return url.
If user enter format not from list (best for example) after checking if default quality does not matched with videos metadata I will make another request this best quality from returned quality list.

@tarhan tarhan added the question label May 7, 2020
@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 7, 2020

Is it possible to return some entry within formats field in info_dict which will have no url?

No.

In this case for --list-formats I want to output just list of formats (url is not needed for this).

Not possible.

If I do not enter --skip-download I could check parameter --format via self._downloader.params.get('format').
If user enter named format I will just request it and return url.
If user enter format not from list (best for example) after checking if default quality does not matched with videos metadata I will make another request this best quality from returned quality list.

This is error prone as this requires partial reimplementation of format selection mechanism at extractor level that is overkill. This almost definitely won't work properly in all cases.

Unless there is a severe throttling/limitations from a site itself you should not bother with such optimisations at all and just extract all formats available making all necessary request in a standard extraction run.

@dstftw dstftw closed this May 7, 2020
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.