feat: add -C/--copy-link to copy video link #1402
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-C or --copy-link to copy video link
Type of change
Description
This feature adds the option
-C
or--copy-link
, and it takes the link that would otherwise be passed to mpv, vlc, or a downloader, and copies it to the system clipboard. I have added support for:$WAYLAND_DISPLAY
and$DISPLAY
, fails if both are unset)pbcopy
)C:\Windows\System32\clip.exe
)termux-clipboard-set
from thetermux-api
package)it throws an error on iOS and prints the link instead, and for everything else it defaults to linux behaviour.
I have tested this on windows, linux (arch, running hyprland), and iOS. I'm planning on testing MacOS as well, but I have to wait a bit for that.
For any future issues with this feature or issues caused by this feature you're allowed to ping/assign me to solve it (seems logical to me, if I add a feature and it breaks I have to solve it ofc :D).
Note I have not checked all things in the checklist below, and for what I didn't check I appended
(I have not tested)
to the item. These items were difficult enough for me to skip because I don't think the features would break due to this addition.-r
seems to be broken on master already (got from AUR), so I don't know what went wrong there. I'll make a bug report if needed.Checklist
-c
history and continue work-d
downloads work-s
syncplay works (I have not tested)-q
quality works (probably)-v
vlc works-e
select episode works-S
select index works-r
range selection works (master seemed to be broken already?)--skip
ani-skip works (I have not tested)--skip-title
ani-skip title argument works (I have not tested)--no-detach
no detach works--dub
and regular (sub) mode both work-h
help info is up to dateAdditional Testcases