| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Do this only if ytdl-format was not set at all.
Fixes: #6636
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some failures by youtube-dl prompt the user to submit a bug report.
If such a failure occurs, we can compare youtube-dl's version to the
current calendar date to see how old it is. We don't make this check
on every youtube-dl failure, as failing to extract an URL is quite
common, and waiting for a second blocking python interpreter startup
for every such case would be a bit unpleasant.
Here the assumption is made that any youtube-dl version older than
3 months is probably severely out of date. Users will be warned about
this.
We also output the trimmed stderr of youtube-dl with msg.error, as this
appeared to have been the behaviour of utils.subprocess without stderr
capturing. Since this uses mp.command_native now, we'll have to do this
ourselves where appropriate.
|
|
|
|
| |
We had some dangling references to this option.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the singly linked list hack, replace it with a slightly more
proper data structure. This probably gets rid of a few minor bugs along
the way, caused by the awkward nonsensical sharing/duplication of some
fields.
Another change (because I'm touching everything related to timeline
anyway) is that I'm removing the special semantics for parts[num_parts].
This is now strictly out of bounds, and instead of using the start time
of the next/beyond-last part, there is an end time field now.
Unfortunately, this also requires touching the code for cue and mkv
ordered chapters. From some superficial testing, they still seem to
mostly work.
One observable change is that the "no_chapters" header is per-stream
now, which is arguably more correct, and getting the old behavior would
require adding code to handle it as special-case, so just adjust
ytdl_hook.lua to the new behavior.
|
|
|
|
|
|
|
|
|
|
|
|
| |
I noticed that some ytdl streams have a start time other than 0. There's
currently no mechanism inside of the EDL stuff that determines this
start time correctly, so it can happen that if the start time is high,
demux_timeline.c tries to clip off the entire video and audio, resulting
in failure of playback.
As a counter measure, use the no_clip header, which entirely disables
clipping against time ranges in demux_timeline.c. (It's basically a
hack.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Init fragments are not a necessity for DASH, but this code assumed so.
Maybe the check was to prevent worse. But using normal EDL here leads to
very shitty behavior where it tries to open hundreds or thousands of
fragments, each with its own demuxer and HTTP connection. (This behavior
is fine for normal uses of EDLs, but completely unacceptable when
emulating fragmented streaming protocols. I'm not sure why the normal
EDL code is needed here, but I think someone claimed some obscure sites
just need it.)
This happens in the same situation as the one described in the previous
commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise we'd just use the base URL as media URL, which would fail with
a 404 error.
Not sure if there's a deeper reason why the audio path was explicitly
different from the video one. But this actually works now for a video
that returned fragmented DASH audio with the default format selection.
(This affects streams on that well known site of a big evil Silicon
Valley company. Typically happens after live stream gets converted to a
normal video, though after some time passes, this fragmented version is
deleted, and replaced by a non-fragmented one. I've observed this
several times and this seems to be the "normal" behavior.)
|
|
|
|
| |
(Yes, a bit odd how this header is needed only for the first stream.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This merges separate audio and video tracks into one virtual stream,
which helps the mpv caching layer. See previous EDL commit for details.
It's apparently active for most of evil Silicon Valley giant's streaming
videos.
Initial tests seem to work fine, except it happens pretty often that
playback goes into buffering immediately even when seeking within a
cached range, because there is not enough forward cache data yet to
fully restart playback. (Or something like this.)
The audio stream title used to be derived from track.format_note; this
commit stops doing so. It seemed pointless anyway. If really necessary,
it could be restored by adding new EDL headers.
Note that we explicitly don't do this with subtitle tracks. Subtitle
tracks still have a chance with on-demand loading or loading in the
background while video is already playing; merging them with EDL would
prevent this. Currently, subtitles are still added in a "blocking"
manner, but in theory this could be loosened. For example, the Lua API
already provides a way to run processes asynchronously, which could be
used to add subtitles during playback. EDL will probably be never
flexible enough to provide this. Also, subtitles are downloaded at
once, rather than streamed like audio and video.
Still missing: disabling EDL's pointless chapter generation, and
propagating download speed statistics through the EDL wrapper.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ytdl wrapper can resolve web links to playlists. This playlist is
passed as big memory:// blob, and will contain further quite normal web
links. When playback of one of these playlist entries starts, ytdl is
called again and will resolve the web link to a media URL again.
This didn't work if playlist entries resolved to EDL URLs. Playback was
rejected with a "potentially unsafe URL from playlist" error. This was
completely weird and unexpected: using the playlist entry directly on
the command line worked fine, and there isn't a reason why it should be
different for a playlist entry (both are resolved by the ytdl wrapper
anyway). Also, if the only EDL URL was added via audio-add or sub-add,
the URL was accessed successfully.
The reason this happened is because the playlist entries were marked as
STREAM_SAFE_ONLY, and edl:// is not marked as "safe". Playlist entries
passed via command line directly are not marked, so resolving them to
EDL worked.
Fix this by making the ytdl hook set load-unsafe-playlists while the
playlist is parsed. (After the playlist is parsed, and before the first
playlist entry is played, file-local options are reset again.) Further,
extend the load-unsafe-playlists option so that the playlist entries are
not marked while the playlist is loaded.
Since playlist entries are already verified, this should change nothing
about the actual security situation.
There are now 2 locations which check load_unsafe_playlists. The old one
is a bit redundant now. In theory, the playlist loading code might not
be the only code which sets these flags, so keeping the old code is
somewhat justified (and in any case it doesn't hurt to keep it).
In general, the security concept sucks (and always did). I can for
example not answer the question whether you can "break" this mechanism
with various combinations of archives, EDL files, playlists files,
compromised sites, and so on. You probably can, and I'm fully aware that
it's probably possible, so don't blame me.
|
| |
|
|
|
|
| |
Suggested in IRC by sfan5.
|
|
|
|
|
|
|
| |
Fixes `--ytdl-format="dash-fastly_skyfire-video-363357330+dash-fastly_skyfire_sep-audio-363357330" https://vimeo.com/108650530`
This happened because the video track also had audio available and after
adding it expecting an audio-only track, there were no more tracks with video.
|
| |
|
|
|
|
|
|
|
|
| |
Only youtube playlists return ID-only urls. Other extractors may
return "<extractor>:<ID>" so those still need the ytdl:// prefix.
Reproduced with
http://www.cbc.ca/burdenoftruth/videos/trailers-promos/burden-of-truth-returns
|
|
|
|
|
|
|
|
|
|
|
| |
Disable by default.
This feature was added in 7eb342757, which allowed stream selection
in runtime. Problem with this atm is that FFmpeg will try to demux
every first packet of every track leading to noticeable delay opening
the URL.
This option can be changed to enabled by default or removed when
HLS/DASH demuxers are improved upstream.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Still needs `--ytdl-raw-option=yes-playlist=` because this only
works for youtube.
This was requested in a few issues:
https://github.com/mpv-player/mpv/issues/1400
https://github.com/mpv-player/mpv/issues/2592
https://github.com/mpv-player/mpv/issues/3024
For #1400 to be completely implemented would need ytdl_hook to
re-request the same playlist with the last video's ID for the mix to
continue indefinitely which would probably too hackish to work reliably.
|
| |
|
|
|
|
|
|
|
|
| |
Remove obsolete comment about FFmpeg ignoring non-http proxies
which was repeated in ytdl_hook before the feature was added.
Remove unnecessary conditions for not nil. Lua tables will always
return nil for non-existent keys.
|
|
|
|
|
| |
This was overlooked when doing the whitelisting for video and audio to
fix #5456.
|
|
|
|
|
|
|
| |
This is important if backporting by grabbing the latest version of
the script without backporting the commit that added the property:
828bd2963cd10a851e0a977809687aed4d377dc3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FFmpeg only suppports http proxies and ignores it if
the resulting url is https. Also, no SOCKS.
Use it like `--ytdl-raw-options=proxy=[http://127.0.0.1:3128]` so
it doesn't confuse mpv because of the colons.
You need to pass it as an option because youtube-dl doesn't give
us the proxy.
Or just set `http_proxy` environment variable as recommended before.
Added example using -append, which doesn't need escaping.
|
| |
|
|
|
|
| |
Close #5453
|
|
|
|
|
|
|
| |
This makes all the video/audio variants available for selection.
Might break with non-hls/dash, or even with dash if FFmpeg wasn't
compiled with the demuxer.
|
| |
|
|
|
|
| |
lua isn't javascript.
|
|
|
|
|
|
| |
Not very clean since there's a lot of potential unsafe urls that youtube-dl
can give us, depending on whether it's a single url, split tracks,
playlists, segmented dash, etc.
|
|
|
|
|
|
| |
Uses track tbr instead of track disposition id for dash selection
Works just as expected because youtube-dl also takes tbr from the manifests.
|
|
|
|
|
|
|
|
| |
package.config is available in 5.1, 5.2, 5.3 and luajit, so should be fine.
The first character is the path separator, so it's '\' on windows and '/'
on *nix.
This should also prevent cases where users download the wrong binary.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Should only make a difference if most of the URLs you open need
youtube-dl parsing.
|
| |
|
|
|
|
|
|
|
| |
If this breaks another site again, remove this whole if and just leave them as
separate playlist items.
Close #5364
|
| |
|
| |
|
|
|
|
| |
Close #5313
|
|
|
|
| |
Faster and more efficient than string concat with large playlists.
|
|
|
|
| |
Close #5003
|
|
|
|
|
|
| |
Apparently, this breaks youtube live and possibly other things.
This reverts commit 06519aae5837312437b07e8bfef10c025ec2f688.
|
|
|
|
|
| |
Using youtube-dl's metadata ends up with stupid things like missing
variant streams, or missing audio streams entirely.
|
|
|
|
|
| |
FFmpeg/mpv don't do it automatically.
See #4827
|
|
|
|
|
|
|
| |
Unbreaks segmented DASH with the change in
https://github.com/rg3/youtube-dl/commit/1141e9104 which made each
segment URL only use relative path from fragment_base_url with a
different key.
|
|
|
|
|
|
| |
youtube-dl supports bypassing some geographic restrictions by
setting X-Forwarded-For header when used with geo-bypass and
geo-bypass-country.
|
|
|
|
|
| |
Also, comma-separated list doesn't actually work, even quote-surrounded.
Switch to using | instead.
|
|
|
|
|
|
|
|
|
| |
This is more of a niche usecase than --ytdl-format and --ytdl-raw-options,
so a simple script option should be enough.
Either create lua-settings/ytdl_hook.conf with
'exclude=example.com,sub.example.com' option or
"--script-opts=ytdl_hook-exclude=example.com,sub.example.com"
|
|
|
|
| |
Not really important, but still interesting to know.
|
|
|
|
| |
Available since 2017.05.07 but only on certain extractors.
|
|
|
|
| |
This affects resuming playback from a watch_later directory so that you can resume playback even for URLs that have a start parameter.
|
| |
|
|
|
|
| |
Seems much more resource efficient than concatenating a string.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Seen with a VOD of a recently ended livestream on Youtube.
They seem to use segmented DASH but unlike normal Youtube
segmented DASH, the segments don't seem to need the initialization
segment.
The video actually fails to start to play if the init segment is
prepended with a lot of 'Found duplicated MOOV Atom. Skipped it' errors
popping up.
|
|
|
|
| |
They're unsupported only in MP4 DASH mode.
|
|
|
|
|
| |
All entries must be separated by ";" or "\n". The parser just doesn't
enforce it if an entry uses quoting.
|
| |
|
|
|
|
|
|
|
|
|
| |
We use the metadata provided by youtube-dl to sort-of implement
fragmented DASH streaming.
This is all a bit hacky, but hopefully a makeshift solution until
libavformat has proper mechanisms. (Although in danger of being one
of those temporary hacks that become permanent.)
|
| |
|
|
|
|
|
|
| |
Only used once for now.
Also, support switched format strings, like bestaudio+bestvideo.
|
| |
|