Skip to content

Latest commit

 

History

History
129 lines (120 loc) · 11.7 KB

README.md

File metadata and controls

129 lines (120 loc) · 11.7 KB

Introduction

This repository contain scripts I have made for mpv media player. To add scripts from this repository, download the desired script in your mpv/scripts/ directory (click here to know more about mpv scripts).

This repository contain the following scripts:

The following scripts can conflict with each other:

  • Either install SmartCopyPaste or SmartCopyPaste-II.
  • Either install SimpleUndo or UndoRedo.

SmartCopyPaste Script

SmartCopyPaste is a script for mpv media player, the script adds a smart copy paste experience to mpv. It gives mpv the ability to load videos simply by pasting them into mpv. As for copying, pressing Ctrl+c on a video, copies the video path and its time to clipboard, which enables paste to resume or to access video with the copied time by pasting. For installation, download SmartCopyPaste.lua file into your mpv/scripts/ directory.

SmartCopyPaste Main Features

  • Copy and Paste: Adds ability to copy and paste any type of video to mpv, like (urls, video paths, or local videos)
  • youtube-dl Extension Support: Immediately paste links without finding exact video address for youtube and any other youtube-dl extension supported sites.
  • Peerflix Extension Support: Immediately paste torrent links or magnet links when proper peerflix extensions are installed.
  • Customization: In the script there are user customizable settings, such as the option to change the copy and paste command for each platform, option to add or remove file extensions and protocols that you want copying and pasting to accept, option of setting device OS manually if automatic detection fails, option to change / add more keyboard shortcuts (keybinds), and more...
  • OSD (On Screen Display): Displays any SmartCopyPaste action within mpv.

SmartCopyPaste Usage Guide

While running a video:

  • Ctrl+c to copy video path with resume time
  • Ctrl+v does the following:
    • To jump to the copied time
    • Or when different video is copied, ctrl+v will add it into playlist
  • Ctrl+Alt+c to copy video path without resume time
  • Ctrl+Alt+v to add video into playlist to play it next

While NOT running a video:

  • Ctrl+v to play the copied video with resume time if available

Sidenote:

  • MAC OS will automatically use Command instead of Ctrl key

SmartCopyPaste Compatibility

  • Windows OS (default powershell, customizable / can be changed in the settings inside the script).
  • MAC OS (default pbcopy and pbpaste, customizable / can be changed in the settings inside the script).
  • Linux OS (default xclip, customizable / can be changed in the settings inside the script).

SmartCopyPaste-II Script

SmartCopyPaste is a script for mpv media player, the script adds a smart copy paste experience to mpv. It gives mpv the ability to load videos simply by pasting them into mpv. As for copying, pressing Ctrl+c on a video, copies the video path and its time to clipboard, which enables paste to resume or to access video with the copied time by pasting. The II version contain additional features which saves your clipboard into a log file. The log adds the option to paste at any time even if clipboard was overwritten or cleared.

Basically, the II version is enhanced with a bookmark feature, copying a video will bookmark the video and time, while pasting will access the bookmark (even if clipboard is cleared). For installation, download SmartCopyPaste-II.lua file into your mpv/scripts/ directory.

SmartCopyPaste-II Main Features

  • Copy and Paste: Adds ability to copy and paste any type of video to mpv, like (urls, video paths, or local videos)
  • Bookmark: Any copy in a video is also a bookmark point, to access the bookmark simply paste.
  • Saves Clipboard to a Log File: The copies from mpv, and the pastes into mpv will be kept in a log file; log file location for Windows OS: %APPDATA%\mpv\mpvClipboard.log, for Linux OS and MAC OS: ~\.config\mpv\mpvClipboard.log. This is necessary for the bookmark feature.
  • youtube-dl Extension Support: Immediately paste links without finding exact video address for youtube and any other youtube-dl extension supported sites.
  • Peerflix Extension Support: Immediately paste torrent links or magnet links when proper peerflix extensions are installed.
  • Customization: In the script there are user customizable settings, such as the option to change the copy and paste command for each platform, option to add or remove file extensions and protocols that you want copying and pasting to accept, option of setting device OS manually if automatic detection fails, option to change / add more keyboard shortcuts (keybinds), and more...
  • OSD: Displays any SmartCopyPaste action within mpv.

SmartCopyPaste-II Usage Guide

While running a video:

  • Ctrl+c to copy video path with resume time and bookmark it
  • Ctrl+v does the following:
    • To jump to the copied time
    • Or to jump to the bookmarked position in the bookmarked video (resume)
  • Ctrl+Alt+c to copy video path without resume time and bookmark
  • Ctrl+Alt+v to add video into playlist to play it next

While NOT running a video:

  • Ctrl+v does the following:
    • To play the copied video with resume time if available
    • Or when no video is currently copied, Ctrl+v will find and play your last copied or pasted video

Sidenote:

  • MAC OS will automatically use Command instead of Ctrl key

SmartCopyPaste-II Compatibility

  • Windows OS (default powershell, customizable / can be changed in the settings inside the script).
  • MAC OS (default pbcopy and pbpaste, customizable / can be changed in the settings inside the script).
  • Linux OS (default xclip, customizable / can be changed in the settings inside the script).

SmartHistory Script

SmartHistory is a script for mpv media player, the script adds a smart history functionality to mpv. It logs videos that you opened into a log file along with the time you have reached on each video; log file location for Windows OS: %APPDATA%\mpv\mpvHistory.log, for Linux OS and MAC OS: ~\.config\mpv\mpvHistory.log. The script uses the log to provide you with various features. More details about SmartHistory are explained in the sections below. For installation, download SmartHistory.lua file into your mpv/scripts/ directory.

SmartHistory Main Features

  • Remember Last Video: It will always remember your last played video, and Ctrl+l will jump to your last played video.
  • Auto Bookmark: When you exit video, it will always remember position and Ctrl+r will resume.
  • Logs Opened Videos to a Log File: All videos opened in mpv will be logged to create a history file; log file location for Windows OS: %APPDATA%\mpv\mpvHistory.log, for Linux OS and MAC OS: ~\.config\mpv\mpvHistory.log. The format is: [date and time] of accessing video, the path, then | reached video time. This is necessary for Remember Last Video and Auto Bookmark features.
  • OSD: Displays any SmartHistory action within mpv.

SmartHistory Usage Guide

While running a video:

  • Ctrl+r to resume in any previously closed videos
  • Ctrl+l to add previously closed video into playlist
    • Useful for cases when you opened another video by accident and you want to get back to the last video

While NOT running a video:

  • Ctrl+l to load last closed video
  • Ctrl+r to load and resume last closed video

SmartHistory Compatibility

  • Works on all of mpv supported platforms.

SimpleUndo Script

SimpleUndo is a script for mpv media player, the script adds a simple undo functionality into mpv. If you accidentally seek/jump to a different time in the video, press undo Ctrl+z to return to your previous time and vice-versa. For installation, download SimpleUndo.lua file into your mpv/scripts/ directory.

SimpleUndo Main Features

  • Simple Undo: Undo accidental time jumps in videos by pressing Ctrl+z and press again to return to previous position.
  • OSD: Displays any SimpleUndo action within mpv.

SimpleUndo Usage Guide

  • Ctrl+z to undo accidental seek by returning to previous time and vise-versa.

SimpleUndo Compatibility

  • Works on all of mpv supported platforms.

UndoRedo Script

UndoRedo is a script for mpv media player, the script adds undo, and redo functionality into mpv. If you seek/jump to a different time in the video, press undo Ctrl+z to linearly undo the seeks/jumps in the video, and press redo Ctrl+y to linearly return to previous undo positions. For installation, download UndoRedo.lua file into your mpv/scripts/ directory.

UndoRedo Main Features

  • Undo and Redo: Undo any accident time jumps in the video by pressing ctrl+z and redo the jumps by ctrl+y.
  • Simple Undo: Undo accidental time jumps in videos by pressing Ctrl+Alt+z and press again to return to previous position.
  • OSD: Displays any SimpleUndo action within mpv.

UndoRedo Usage Guide

  • Ctrl+z to undo by returning to previous times.
    • Example: from second 30 jumped to minute 5, then 10, then 15. Undo will return to 10, undo again to return to 5, undo again to return to second 30.
  • Ctrl+y to redo by restoring undo times.
    • Example: from second 30 jumped to minute 5, then 10. Undo twice for second 30. Redo will restore to 5, redo again to restore to 10.
  • Ctrl+Alt+z loop between last undo and redo.
    • This is for quick undo & redo (Just like SimpleUndo) it loops between the last undo & redo.

UndoRedo Compatibility

  • Works on all of mpv supported platforms.

Misc

Visitors

:Vistors

Counting since 2021-09-25T19:04:24Z (ISO 8601)

MPV.net Support

MPV.net users must change the option input-default-bindings = no to input-default-bindings = yes located in MPV.net/mpv.conf

To-Do List

  • I am open to suggestions! Have an idea... let me know.. ;)

Changelog

  • Here you can find the full changelog for all the scripts in this repository.

Special Thanks

Below is list of contributors/ honorable mentions.

  • SmartCopyPaste Script: For the handlers that are used inside the script, which added compatibility for newer mpv versions, the method was originally forked and edited from @jonniek appendURL script. Specical thanks for his work.
  • UndoRedo Script: Credits and special thanks to @Banz99 for forking SimpleUndo script and enhance it by a table to store undo and redo values.