Replies: 1 comment 1 reply
-
I started to occasionally get an error message for failure to extract metadata even though the function was still working and pasting correctly. So I started to look into it and it had to do with the on_stderr callback function. So I fixed it, now not only do i not get errors again, it processes everything much faster and now it will retrieve the metadata and paste all the info in about 1-2 seconds. the only thing that needs to be changed in the above function is the on_stderr callback at the bottom. Just needs to be changed to this.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, linkarzu.
Thanks for all your videos, you have really helped dial in my nvim setup, especially for note taking in .md
I made this really cool function I thought you might like but thought it was probably too big to place as a YT comment. This function allows you to paste a YT url from clipboard and then it will use the cli tool yt-dlp to do an api call and extract the meta data for the video in json, I have it setup to paste the url and in the text section for the url link in .md and it places the Channel Name, Video Title, and upload date. It then adds the thumbnail image on the next line. I like to have access to the thumbnail images because it helps me remember the video easier as i am scrolling through videos I save for topics in notes.
Two things to note:
Here is a screenshot of what it looks like when I copy an YT link to clipboard and then paste in .md file using just my keybinding mpy I have my keys set like ".md related" "pasting urls" "YT" because i have other url pasting functions also depending on the site I want to paste from.
Here is the function, Let me know if you like it. I have been using it a lot and have not had any errors or issues on any of the urls I have pasted.
Beta Was this translation helpful? Give feedback.
All reactions