Eisa01 / mpv-scripts

This repository contain scripts I have made for mpv media player...
BSD 2-Clause "Simplified" License
558 stars 37 forks source link

Smartcopypaste Not Accepting Paste #3

Closed mortyobnoxious closed 4 years ago

mortyobnoxious commented 4 years ago

Hi, smart copy paste was working simply great before I guess. But now it doesn't paste URLs I copied from browser. It just remembers URLs I copied from MPV and pastes them.

Is there a version that just pastes any URL from clipboard?

Eisa01 commented 4 years ago

Can you tell me the URLs you are trying so I look into it?

mortyobnoxious commented 4 years ago

It's just weird sometimes it works but sometimes(most of the time) it doesn't.

URLs that I'm trying to paste are just regular URLs, for example Youtube URLs: https://www.youtube.com/watch?v=OzOU5Sp0LDY or any other URL.

It just doesn't paste. It pastes previously copied URL from MPV.

Eisa01 commented 4 years ago

I believe I know the cause of issue, I did a stupid thing will fix it later. Ensure thats caps lock is turned off when pasting and tell me if that fixes the issue

mortyobnoxious commented 4 years ago

Nope. When I turn off caps lock, issue persisted.

It just remembers the URL copied from MPV.

Eisa01 commented 4 years ago

Had sometime to check, the issue was not the script.

Youtube-dl has been updated, old versions wont work. Just update youtube-dl and everything will work again. https://ytdl-org.github.io/youtube-dl/download.html

mortyobnoxious commented 4 years ago

didn't work. it just remembers previously copied URL from "mpvClipboard.log".

Is there a version that just pastes whatever URL I've got in the clipboard?

Eisa01 commented 4 years ago

I am wondering if something caused the log file to break. Can you move the history log file somewhere else?

Instructions: Open run (Windows Key + R} Type the following: %APPDATA%/mpv/

Inside this folder you will find mpvClipboard.log

Now move mpvClipboard.log to desktop or something.

When you paste a video, it will now create a new mpvClipboard.log. Try it and let me know

mortyobnoxious commented 4 years ago

I did that. I actually deleted that text file multiple times but it still doesn't paste anything I copied.

After deleting that file, It doesn't prompt anything on MPV screen. Nothing happens when I paste.

Eisa01 commented 4 years ago

Can you tell me the following: Which version of mpv you are using? What other scripts you are using? Is this SmartCopyPaste or SmartCopyPaste-II?

mortyobnoxious commented 4 years ago

mpv build -- mpv-x86_64-20191124-git-b31f2f6.7z youtube-dl -- 2019.11.28

other scripts: autoload.lua autosave.lua playlistmanager.lua reload.lua titleresolver.lua youtube-quality.lua

I tried deleting all those scripts and trying to paste. It's the same. Didn't work.

I generally use "SmartCopyPaste-II" but I tried other version, too. It didn't work.

Eisa01 commented 4 years ago

Turns out that the new mpv broke something, downgrading would fix the issue. However, I am trying to find a workaround for what the update broke.

Eisa01 commented 4 years ago

I think now it should work on newer mpv versions. Test either basic version or II version and let me know https://github.com/Eisa01/mpv-scripts/tree/master/scripts

Also after reviewing the code, I could see some room of improvement in some areas. I will probably release 1.7 version soon that adds some enhancements.

mortyobnoxious commented 4 years ago

It works great now, thank you so much.

Eisa01 commented 4 years ago

You are welcome. Thanks for reporting the issue and being responsive!

mortyobnoxious commented 4 years ago

@Eisa01 hi, it's not working again, not accepting URLs and when i try to copy URL from MPV, it closes the player.

mpv build -- mpv-x86_64-20191208-git-b2b15d4.7z youtube-dl -- 2019.11.28

Eisa01 commented 4 years ago

Hmm also an issue happened to me which might be related, I will probably be able to sneak and work to resolve the issues sometime next week.

However, can you test with your clipboard having something and tell me if it works.

Copy random thing "sdfdfsdf", then open MPV, and only then try to press ctrl + c. Let me know how this goes for you.

mortyobnoxious commented 4 years ago

Nothing happens. But if i paste with ctrl+v first, then press ctrl+c, it closes the MPV window again.

Eisa01 commented 4 years ago

@mortyobnoxious Cleaned some bugs that could have been causing the issue. Update to the newest version, delete mpvClipboard.log, and then test the new script.

Once you are done, let me know how it goes for you ^ ^

mortyobnoxious commented 4 years ago

Thank you, it works now.

gbstan commented 4 years ago

On macOS it doesn't work. I suspect this is because the system doesn't find the file: mpvClipboard.log Where is this file supposed to reside on macOS? I have searched and cannot find it. What is the command: os.getenv('APPDATA')..'/mpv/mpvClipboard.log' supposed to give? Should we create this directory structure and file somewhere?

Here is are the error messages after ctrl+c:

[SmartCopyPasteII_1_8] 
[SmartCopyPasteII_1_8] stack traceback:
[SmartCopyPasteII_1_8]  ...artstan/.config/mpv/scripts/SmartCopyPasteII-1.8.lua:98: in function 'fn'
[SmartCopyPasteII_1_8]  mp.defaults:202: in function 'fn'
[SmartCopyPasteII_1_8]  mp.defaults:60: in function 'handler'
[SmartCopyPasteII_1_8]  mp.defaults:339: in function 'handler'
[SmartCopyPasteII_1_8]  mp.defaults:460: in function 'call_event_handlers'
[SmartCopyPasteII_1_8]  mp.defaults:494: in function 'dispatch_events'
[SmartCopyPasteII_1_8]  mp.defaults:453: in function <mp.defaults:452>
[SmartCopyPasteII_1_8]  [C]: ?
[SmartCopyPasteII_1_8]  [C]: ?
[SmartCopyPasteII_1_8] Lua error: ...artstan/.config/mpv/scripts/SmartCopyPasteII-1.8.lua:98: attempt to concatenate a nil value
Eisa01 commented 4 years ago

@gbstan This is because I made the script for Windows OS only, however I can probably add initial support for MAC OS x and Linux.

However, this issue is not related to this, I will be posting a script for you to try soon

sergeevabc commented 4 years ago

Windows 7, mpv 0.32.0-515-g685bd6a5f5, both scripts are not working, alas.

Eisa01 commented 4 years ago

@sergeevabc Will wait until the new stable release and then see how it goes