Commit Graph

226 Commits

Author SHA1 Message Date
Jagannathan Tiruvallur Eachambadi 46bfa3726f
ytdl_hook: add a header to support geo-bypass
youtube-dl supports bypassing some geographic restrictions by
setting X-Forwarded-For header when used with geo-bypass and
geo-bypass-country.
2017-07-16 13:20:17 +01:00
Ricardo Constantino db60cbb80a
ytdl_hook: actually load the script-opts
Also, comma-separated list doesn't actually work, even quote-surrounded.
Switch to using | instead.
2017-07-11 23:42:22 +01:00
Ricardo Constantino 042e98f4c9
ytdl_hook: add option to exclude URLs from being parsed
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"
2017-07-11 14:18:29 +01:00
Ricardo Constantino b1165ce3a2
ytdl_hook: add times for ytdl and hook running on debug-level
Not really important, but still interesting to know.
2017-07-11 14:16:35 +01:00
Ricardo Constantino 41b3b11669
ytdl_hook: add pre-parsed chapters, if available
Available since 2017.05.07 but only on certain extractors.
2017-07-02 21:15:15 +01:00
Martin D 30cd963b25 ytdl_hook: don't override start time set by saved state
This affects resuming playback from a watch_later directory so that you can resume playback even for URLs that have a start parameter.
2017-06-09 11:13:24 +01:00
Ricardo Constantino 289b11553b
ytdl_hook: don't override user-set start time 2017-06-08 19:45:49 +01:00
nodiscc 969c25d2f7 OSD message: "Drop files or URLs to play here."
Add "or URLs" to the default OSD message when mpv is launched without parameters.
Since this works flawlessly with youtube-dl integration, the fact that you can drop URLs directly to the window should be advertised more.
2017-05-31 12:56:14 +01:00
Ricardo Constantino ce78f1222f
ytdl_hook: rework edl joining to use lua tables
Seems much more resource efficient than concatenating a string.
2017-05-04 17:10:07 +01:00
Ricardo Constantino 18703b55d8
osc: also add processing for axis_up/down events
Considered semantically equivalent with mouse_btn3/4.

This is a preemptive fix for upcoming changes to AXIS_* events.
2017-04-25 15:42:09 +01:00
Ricardo Constantino 3526b95aaf
ytdl_hook: treat single-entry playlists as a single video 2017-04-23 01:53:59 +01:00
Ricardo Constantino d5517f0d9f
ytdl_hook: move single video code to a separate function 2017-04-23 01:53:57 +01:00
Avi Halachmi (:avih) 150c988e88
osc: add user_opts.boxmaxchars for box layout title limit
The default of 80 is conservative to allow relatively wide fonts, but
with many common fonts a bigger number can be used without overflow.
2017-04-19 20:35:58 +01:00
Ricardo Constantino 05c8707a0b
osc: add volume icons to osd font and use them
Glyphs taken and based on U+1F507 to U+1F50A from Symbola, which
is available under public domain: http://users.teilar.gr/~g1951d/
2017-04-19 20:18:23 +01:00
Ricardo Constantino 9d6c208afa
osc: move volume left of fullscreen button 2017-04-19 20:18:23 +01:00
Ricardo Constantino fe937e866d
osc: bottom/topbar: add fullscreen button 2017-04-19 20:18:23 +01:00
Ricardo Constantino a477c864a4
osc: add volume button
Click to toggle mute, mouse wheel to change volume.
OSD is shown on volume change.
2017-04-19 20:18:23 +01:00
Ricardo Constantino 00ab5a15be
osc: support handling mouse wheel events 2017-04-19 20:18:23 +01:00
Ricardo Constantino e870b7ad66
osc: simplify checks in key handler
Use a helper function for these safety checks.
2017-04-19 20:18:23 +01:00
Ricardo Constantino 82bf4567f9
osc: fix last potential race condition on key events 2017-04-19 20:18:15 +01:00
wm4 4c516a064a osc: use "loop-playlist" instead of "loop" property 2017-04-11 12:44:41 +02:00
Ricardo Constantino 07ee7fb2c3
osc: escape ASS and strip newlines on title 2017-03-27 18:00:56 +01:00
Ricardo Constantino dc00ad537f
osc: make title configurable and use property expansion on it 2017-03-27 18:00:56 +01:00
Ricardo Constantino ebf61267f4
Revert "osc: make the title toggleable between media-title and filename"
This reverts commit 6573b73462.
2017-03-27 18:00:54 +01:00
Ricardo Constantino 6573b73462
osc: make the title toggleable between media-title and filename
Close #4221
2017-03-26 14:41:03 +01:00
Ricardo Constantino aae0833fc6
osc: fix PlayResX undefined warning when aspect is 0 2017-03-24 16:23:39 +00:00
Ricardo Constantino bc8710a98d
osc: bottom/topbar: don't clip title vertically 2017-03-24 16:16:12 +00:00
Ricardo Constantino aee08e3f51
osc: bottom/topbar: increase timecodes width a bit
Compensates for wider fonts like DejaVu Sans Mono.
Further compensate for the minus sign in the right timecode by 10px.

Closes #3952
2017-03-24 16:16:11 +00:00
Ricardo Constantino 03b2710dc8
osc: refactor cache status display
This removes the twitch of the right-aligned cache status.
2017-03-24 16:16:10 +00:00
Ricardo Constantino bcb2db078c
osc: refactor osc message scaling
Will still hide playlist items with long enough filenames and osd-font-size
but not as soon.

osc messages should now preserve their scaling with fullscreen toggling and
cycling through audio-only files and files with video.

Closes #4081, #4083, #4102
2017-03-24 16:16:07 +00:00
Akemi 55fb4cb3f6 osc: fix window dragging with showwindowed=no
initialise OSC with a zero mouse area so mp_input_test_dragging returns
a proper value.

Fixes #1819
2017-02-27 23:55:30 +01:00
Ricardo Constantino 6ac3d77e90
ytdl_hook: support livestream segmented DASH VODs
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.
2017-02-10 20:24:03 +00:00
Ricardo Constantino 5fbad204a6
ytdl_hook: reenable support for length-less segments in EDL
They're unsupported only in MP4 DASH mode.
2017-02-06 16:50:28 +00:00
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 bbf01346ff
osc: allow playlist buttons when looping
Closes #4092
2017-02-01 13:26:38 +00:00
Ricardo Constantino 9831d3ada6
osc: box: clip with ellipsis after too much stretching 2017-01-31 18:54:40 +00:00
Ricardo Constantino ee000f2133
osc: bottom/topbar: clip title instead of stretching 2017-01-31 18:54:40 +00: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
Roland Hieber 194b26536b osc: fix crashes related to field eventresponder being nil
I'm still getting some crashes after issue #3210 was fixed in commit
5beb230690. It's hard to reproduce those
crashes, they happen maybe once a month, so I guess it could be a race
condition. But in any case, I don't see anything wrong in applying some
defensive programming here.

For reference, here is what was happening on 0.23.0-1 from Debian
testing:

  Playing: ytdl://usL5CeP_row
   (+) Video --vid=1 (*) (h264)
    (+) Audio --aid=1 --alang=und (*) (aac)
    [osc]
    [osc] stack traceback:
    [osc]	  @osc.lua:2074: in function 'process_event'
    [osc]	  @osc.lua:2246: in function 'cb'
    [osc]	  mp.defaults:107: in function 'fn'
    [osc]	  mp.defaults:60: in function 'handler'
    [osc]	  mp.defaults:339: in function 'handler'
    [osc]	  mp.defaults:448: in function 'call_event_handlers'
    [osc]	  mp.defaults:485: in function 'dispatch_events'
    [osc]	  mp.defaults:441: in function <mp.defaults:440>
    [osc]	  [C]: in ?
    [osc]	  [C]: in ?
    [osc] Lua error: @osc.lua:2074: attempt to index field 'eventresponder' (a nil value)

Note that the location is different from where issue #3210 happens.

Signed-off-by: Roland Hieber <rohieb@rohieb.name>
2017-01-25 07:58:45 +01:00
Olivier Perret 348c610b68 lua: allow unregistration of idle handlers 2017-01-15 17:02:21 +01:00
Ricardo Constantino 321dd794c8
osc: bottombar/topbar: make chapter markers slightly bigger
1px squares to 2px triangles and layout=box markers from 1px
squares to 2x1px rectangles.

While we're at it, wrap a few lines to 80col again.
2016-12-25 15:44:11 +00:00
pavelxdd f53b2952eb osc: replace length property with duration
Length property is deprecated and no longer works. This fixes
a bug when the total file duration wasn't visible if the
option to display milliseconds was activated.
2016-12-04 13:18:19 +01:00
Ricardo Constantino 796b48b2a3
osc: don't hide playlist buttons, just disable
Having empty space before the title in layout=*bar looks worse
than the floating buttons in layout=box.

Also disable both playlist buttons selectively according to the
current position.
2016-12-02 16:59:40 +00:00
Ricardo Constantino a7a919f93f
osc: topbar: use same styles as bottombar 2016-12-02 16:59:32 +00:00