Commit Graph

49 Commits

Author SHA1 Message Date
wm4 19551200d5 ytdl_hook: fix EDL syntax
All entries must be separated by ";" or "\n". The parser just doesn't
enforce it if an entry uses quoting.
2017-02-05 16:02:22 +01:00
Ricardo Constantino 7e6b37be07 ytdl_hook: Add non-dash fallbacks to default formats 2017-02-04 22:34:47 +01:00
wm4 61202bb364 ytdl_hook, edl: implement pseudo-DASH support
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.)
2017-02-04 22:34:38 +01:00
Ricardo Constantino a46fc5e5eb ytdl: support segmented dash 2017-02-04 22:19:21 +01:00
Ricardo Constantino e017c24174
ytdl_hook: refactor edl track joining
Only used once for now.

Also, support switched format strings, like bestaudio+bestvideo.
2017-01-30 16:21:44 +00:00
Ricardo Constantino 6dafc85187
ytdl_hook: respect --no-audio, don't force-select track 2017-01-30 15:01:07 +00:00
Ricardo Constantino 2a7d2d1bc9
ytdl_hook: fix opening hitbox.tv rtmp stream
Worked with librtmp, but ffrtmp needs to set rtmp_swfurl in addition
to rtmp_swfverify, even if they're the same value.
2017-01-29 01:45:13 +00:00
Ricardo Constantino d303ebd9b6
stream_lavf: add support for data URIs
Only FFmpeg supports them and they need to be in the format data://
like other protocols or prefixed with ffmpeg:// or lavf://.

Closes #4058
2017-01-25 15:40:56 +00:00
Ricardo Constantino 03ea61c895
ytdl_hook: sort chapters by time
mpv doesn't work well with unordered chapters.
ex: https://youtu.be/DIKPUL6b4N8
2016-11-15 22:58:43 +00:00
Ricardo Constantino 13259f35c8
ytdl_hook: Add title to playlist items if available 2016-10-15 01:33:27 +01:00
Maurycy Skier e9c43258b8 ytdl_hook: add chapters by parsing video's description 2016-10-06 21:18:43 +01:00
Ricardo Constantino 6487ba4864 ytdl_hook: Set aspect ratio for anamorphic video 2016-09-28 21:16:40 +02:00
Ricardo Constantino 6ba2bbd090 ytdl_hook: temporarily force disable dash segments formats 2016-09-22 20:34:42 +02:00
Ricardo Constantino 60a0815b4c ytdl_hook: don't bother adding subtitles if duration isn't known
EDL doesn't work with subtitles with unknown length.
2016-09-13 09:23:00 +02:00
Ricardo Constantino 5edd6a8caa ytdl_hook: Support playlist entries without subtitles
Fixes missing subtitle tracks if the first entry didn't have any.

Previously it just checked for the first entry in the playlist for
requested languages and if that entry happened to not have subtitles
they also wouldn't show up for the other entries.

It will skip languages if the first entry with subs has less or
different languages than the others.

Unrelated to http_dash_segments.
2016-09-13 09:22:55 +02:00
Ricardo Constantino 5bcb22beea ytdl: Error out with http_dash_segments
Unsupported for now.
2016-07-30 19:02:39 +02:00
Ricardo Constantino 256d9d2b89 ytdl: fix brightcove urls 2016-05-30 16:57:43 +02:00
Ricardo Constantino 4ff2a60632 ytdl_hook: support multi-arc subtitles
While at it, pass durations of segments from ytdl if available.
2016-05-23 15:14:14 +02:00
Ricardo Constantino 77d50cb3cf ytdl_hook: Just check if protocol is rtmp
Partial fix to #3090
2016-05-14 11:22:25 +02:00
▟ ▖▟ ▖ f7244ebe9b ytdl_hook: handle optional format_note
some extractors don't return a format_note for their audio stream which
resulted in commandv complaining "argument 4 is not a string" (got nil).
2016-03-10 22:46:03 +01:00
Yen Chi Hsuan 459b40cc4b ytdl: Include Referer header as well
Some videos require correct Referer header for downloading, or 403
Forbidden is thrown.
2016-01-10 14:30:31 +01:00
Ricardo Constantino a02f3a5dd4 ytdl: disable --all-subs if "sub-lang" is in raw-options
Defaults stay the same (--all-subs is used if sub-lang wasn't used.)
Don't forget to also add "write-sub=" if using sub-lang or else it won't
work.
2015-10-24 17:30:22 +02:00
ChrisK2 bddd1e9e3b ytdl: Set a proper label for external audio tracks 2015-10-11 20:52:11 +02:00
ChrisK2 78caf6ae86 ytdl: Remove DASH hacks, use DASH by default
Thanks to rcombs, ffmpeg now properly supports DASH and we can
remove our hacks for it and use it by default whenever
available. If you don't like this for whatever reason, you
can get the "normal" streams back with --ytdl-format=best .

Closes #579
Closes #1321
Closes #2359
2015-10-11 00:35:35 +02:00
ChrisK2 6fb926a560 ytdl: Remove version check and minor cleanup
Closes #2370
2015-10-06 17:06:11 +02:00
ChrisK2 1b7e8ff6c5 ytdl: Don't override user-set format in no-video mode 2015-09-30 22:28:01 +02:00
ChrisK2 3c86bd2bb5 ytdl: catch bogous extractor info
Some extractors may claim to have extracted subtitles, but then
set the relevant fields to null. Try to catch those cases.

Fixes #2254
2015-08-27 13:42:04 +02:00
Ricardo Constantino 81bfe4da8f ytdl: get start_time 2015-07-29 13:20:09 +02:00
Ricardo Constantino 794dbd847a ytdl: print command in debug mode 2015-07-29 13:20:06 +02:00
wm4 1921f40db5 ytdl: don't print failure warning when youtube-dl was killed by us 2015-06-27 21:09:12 +02:00
Jaime Marquínez Ferrándiz 69abb48194 ytdl_hook: Support 'multi_video' results
They can be handled by the same codes used for playlists, most of them will use an EDL.
Fixes #2027.
2015-06-07 23:53:13 +02:00
wm4 a3f8d45fb6 ytdl: do not use deprecated option
This was missed in commit 450af053.
2015-05-23 15:15:16 +02:00
wm4 450af05338 options: rename --media-title option
Conflicts with the property.
2015-05-22 20:03:14 +02:00
wm4 9438f811ae ytdl_hook: remove tabs
We don't allow tabs in normal source code.
2015-05-09 21:41:44 +02:00
ChrisK2 6a0a67034d ytdl_hook: Escape EDL URLs
Should prevent the EDL parser from tripping over = and , in the
URL.
2015-05-07 20:41:46 +02:00
robin 5555f6fc2c ytdl_hook.lua: Change format options when vid is "off"
This will change the format option to "bestaudio/best" instead of
passing the "-x" argument to yt-dl.

Prevents the video still being downloaded in the new mpv versions where
the yt-dl format is set to "best" by default.
2015-04-27 23:32:59 +02:00
Sebastian Mayr c4faab4871 ytdl: set additional properties for rtmp streams 2015-04-09 20:36:38 +02:00
robin d453600b4f ytdl_hook.lua: Disable video when vid option is "no"
When setting options like --no-video, ytdl_hook adds the "-x" argument
to youtube-dl, so that bandwith is saved by not downloading the video on
some sites.
2015-04-09 20:34:36 +02:00
Thiago Kenji Okada 633147c959 ytdl: add "--ytdl-params" option
This option allows the user to pass non-supported options directly to
youtube-dl, such as "--proxy URL", "--username USERNAME" and
'--password PASSWORD".

There is no sanity checking so it's possible to break things (i.e.
if you pass "--version" mpv exits with random JSON error).

Signed-off-by: wm4 <wm4@nowhere>
2015-02-25 22:32:48 +01:00
wm4 7cff2e4131 ytdl: add --no-warnings
Silences "[ytdl_hook] WARNING: video doesn't have subtitles", which was
an annoying and pointless message printed with almost all youtube
videos.
2015-02-24 10:58:09 +01:00
Jaime Marquínez Ferrándiz 7281a72fab ytdl: Adapt to new subtitles structure
The requested formats can be sorted by preference and the result gives now an url or the subtitles file content
2015-02-24 10:43:29 +01:00
wm4 047788e3b1 ytdl: implement user-agent and cookie overrides
For some sites, youtube-dl sends a special user-agent. If we don't send
the same user-agent, the server will reject mpv's connection attempt.
This was observed with trailers.apple.com. Fix it by forcing the
user-agent youtube-dl uses.

Some sites set cookies when doing a website access, and require the
client to provide these cookies when downloading the actual media. This
is needed at least by nicovideo.jp. Fix by adding youtube-dl's cookies
to our request headers.

Both of these require a very recent youtube-dl version (youtube-dl added
the necessary headers a few hours ago). The script still works with
older youtube-dl versions, though.
2015-01-24 20:54:35 +01:00
ChrisK2 1558938f87 ytdl_hook: Check for empty playlists
Sometimes we get empty playlists back, print a warning message
instead of crash
2015-01-16 06:59:16 +01:00
wm4 0070e39342 ytdl: silence "succeeded" message
Pretty useless by now.
2015-01-03 03:38:23 +01:00
ChrisK2 67f775bfbb ytdl: bump requrired youtube-dl version to 2014.11.26 2014-11-26 17:41:15 +01:00
ChrisK2 13845cf6fe ytdl: Try to handle multi-arc videos
this currently uses a sketchy but apparently working workaround,
which will be removed once the neccessary changes in youtube-dl
are implemented

Fixes #1277
2014-11-26 17:36:23 +01:00
ChrisK2 07ddfd4f8a ytdl: When using DASH, print actual duration
prints the actual duration as reported by youtube-dl to the
terminal when available
2014-11-26 17:17:05 +01:00
Jaime Marquínez Ferrándiz cf8efe3235 options: add --ytdl-format option for youtube-dl format
It's passed with the '--format' option to youtube-dl.

If it isn't set, we don't pass '--format best' so that youtube-dl can
use the options from its configuration file.

Signed-off-by: wm4 <wm4@nowhere>
2014-11-20 00:17:13 +01:00
ChrisK2 0f7df89468 lua: add youtube-dl hook script
This merely adds the file without using it, for the sake of retaining
authorship information.

Signed-off-by: wm4 <wm4@nowhere>
2014-11-19 18:37:39 +01:00