Commit Graph

90 Commits

Author SHA1 Message Date
torque 4ff29f33b0 Lua: add unpack shim for Lua 5.2/5.3 compatibility.
The global unpack function got moved to table.unpack in Lua 5.2, and
it's only available as the global if 5.2 is built with compatibility
enabled (the default). Lua 5.3 does not build with 5.1 compatibility by
default.

Fixes #1648.
2015-03-06 12:28:20 +01: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 9cba451949 lua: do not use math.pow()
It's the first thing that breaks with Lua 5.3. I don't know if there
are other failures because I don't care enough.
2015-01-25 01:23: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
ChrisK2 70f43db95b OSC: Reset all styles for idle message 2015-01-16 06:40:32 +01:00
wm4 a6997be61b osc: fix disabling OSC
Upon the "DEL" key binding or the "disable-osc" message, the OSC should
stay permanently invisible. This was recently broken (not sure by what),
because other code accidentally reenables it anyway, which resulted in
the OSC appearing again when moving the mouse.
2015-01-15 20:09:32 +01:00
wm4 0070e39342 ytdl: silence "succeeded" message
Pretty useless by now.
2015-01-03 03:38:23 +01:00
ChrisK2 03a0d74da7 OSC: idlemessage: fix alignment 2015-01-02 19:39:01 +01:00
ChrisK2 7f584f68bf OSC: add osc-message script command (wip) 2015-01-02 16:48:16 +01:00
ChrisK2 4e013afd37 OSC: display "drop files here" message when idle + forced-window
This currently doesn't work properly on OSX due to some bugs.
2015-01-02 16:48:16 +01:00
Avi Halachmi (:avih) 39e04e9294 options: deprecate 'lua' based options/dirs for 'script'
- --lua and --lua-opts change to --script and --script-opts
- 'lua' default script dirs change to 'scripts'
- DOCS updated

- 'lua-settings' dir was _not_ modified

The old lua-based names/dirs still work, but display a warning.

Signed-off-by: wm4 <wm4@nowhere>
2014-12-15 04:39:56 +01:00
wm4 eb36bd6945 lua: don't ignore key press events for script key bindings
Meh.
2014-12-10 18:36:05 +01:00
ChrisK2 f299debaa0 osc: improve slimbox layout and minor code cleanups 2014-12-05 19:37:31 +01:00
ChrisK2 e883c48caa assdraw: Properly approximate circle for rounded box
source: http://spencermortensen.com/articles/bezier-circle/
2014-12-05 19:37:31 +01:00
wm4 f95a4bceaa osc, dvd, bd: fix mouse state when changing menu modes
The flags weren't correctly set, and the mouse cursor remained visible
after leaving menu mode.

This was apparently broken in 0.7.0 too.

Fixes #1316.
2014-12-05 16:04:04 +01:00
wm4 7aa91af8a7 dvd, bd, osc: disable OSC while a menu is active
They interfere.

It turns out that commit b6ca4a48 actually broke this in weird ways, but
this solution is better anyway.
2014-12-04 18:32:14 +01:00
wm4 8fc3d7dc39 lua: fully cleanup removed key bindings
This is basically cosmetic; it was leaking the old handler functions.
2014-12-03 23:01:19 +01:00
wm4 b6ca4a48e1 osc: always force mouse_move binding
So the OSC will still appear when using --no-input-default-bindings. It
also means it may override a user's mouse_move binding, but I guess
users who don't want the OSC should just use the --no-osc option.
2014-12-02 20:36:55 +01:00
wm4 3295caca3d lua: add a function that formats Lua values as strings
Yep, Lua is so crappy that the stdlib doesn't provide anything like
this.

Repurposes the undocumented mp.format_table() function and moves it to
mp.utils.
2014-11-29 00:03:46 +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
wm4 0c5fd5a047 lua: remove redundant call 2014-11-24 16:47:13 +01:00
wm4 89c1525585 lua: always handle key repeat on the script side
Simpler, and leaves the decision to repeat or not fully to the script
(instead of requiring the user to care about it when remapping a script
binding).
2014-11-24 16:47:03 +01:00
wm4 2a017734a5 lua, ipc: remove leftovers
MPV_EVENT_SCRIPT_INPUT_DISPATCH is now unused/deprecated.

Also remove a debug-print from defaults.lua.
2014-11-24 10:33:55 +01:00
wm4 ae5df9be98 input, lua: redo input handling
Much of it is the same, but now there's the possibility to distinguish
key down/up events in the Lua API.
2014-11-23 15:13:35 +01:00
wm4 4cdd346246 input: set mouse area by default for all input
Otherwise, mouse button bindings added by mp.add_key_binding() would be
ignored.

It's possible that this "breaks" some older scripts using undocumented
Lua script functions, but it should be safe otherwise.

Fixes #1283.
2014-11-23 09:10:51 +01:00
wm4 00626817c8 lua: add a way to add repeatable key bindings
For these, autorepeat is enabled.
2014-11-21 00:01:59 +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
ahoka b4a147bbe2 man: document osc seekbarstyle option 2014-11-15 20:20:54 +01:00
ahoka e7b45b1efa osc: add validation for string user options 2014-11-15 20:20:52 +01:00
ahoka 6de303c339 osc: add seekbarstyle option 2014-11-15 20:20:50 +01:00
ChrisK2 223d9b6bc9 osc: make text squuezing layout dependent
Wether and when the text of a button should be squeezed when it
gets too long can now be configured in the layout:

lo.button.maxchars = <number>
nil = no squeezing (default)

If the button text has more than <maxchars> characters, it will
be squeezed to the estimated width of <maxchars>.
2014-10-24 01:56:15 +02:00
ChrisK2 bff5948f00 osc: make tooltip_an default property 2014-10-24 01:16:04 +02:00
Martin Herkt 5a3c6563e4 osc.lua: add “bottombar” and “topbar” layouts 2014-10-23 13:02:32 +02:00
wm4 40d6b5ca85 lua: add convenience function for hooks
So the user doesn't have to care about the awkward low-level details.
2014-10-21 00:38:56 +02:00
ChrisK2 1c9f30cca7 osc: update cache display
now similar to what the status line displays
2014-09-25 11:57:49 +02:00
Otto Modinos 33a63d8e6e options.lua: call msg.debug after resolving 'identifier' 2014-09-16 17:34:08 +02:00
ChrisK2 4386b80f2e osc: Use osd-font for playlist buttons
Now that we use the symbols from the font, we should also
actually use the font.
2014-08-22 23:50:50 +02:00
wm4 e2d27cded7 osc: revert disabling use_suspend
It was an unintended/accidental change.
2014-08-21 22:46:33 +02:00
ChrisK2 03f97e4cae osd+osc: Add left-arrow to osd-font
For use as playlist navigation button in OSC, now the osd-font
carries all symbols needed by the OSC.
2014-08-21 18:45:41 +02:00
ChrisK2 364e06261a osc: Overhaul (wip)
Code reorganized to make layouts exchangeable
alternative test layout can be tested with
layout=slimbox
in the OSC config

timers are now used to properly animate the fade out when the
player is paused

duplicate seeks are discarded again
2014-08-15 15:24:22 +02:00
wm4 8f77d9df4a lua: allow disabling suspend
I'd like to enable this by default, but unfortunately the OSC seems to
have some problems with it.
2014-08-14 19:30:35 +02:00
ChrisK2 48f4f791f4 osc: Do precise seeks on simple clicks on seekbar 2014-07-29 19:26:32 +02:00
ChrisK2 1e8b98af73 osc: improve previous commit 2014-07-10 11:22:05 +02:00
ChrisK2 549afdb9c5 osc: round displayed cache value
Fixes #919
2014-07-10 11:17:51 +02:00