yuchen-lea / org-media-note

Taking interactive notes when watching videos or listening to audios in org-mode.
GNU General Public License v3.0
243 stars 35 forks source link

Fix opening mpv for URLs with % chars #57

Closed andrewzhurov closed 5 months ago

andrewzhurov commented 5 months ago

For context, when first string arg to message contains % it is treated by message as a template string and it expects more args to come. Basically, it acts as a format. Why? Go ask. Docs: https://www.gnu.org/software/emacs/manual/html_node/eintr/message.html

As a result, URLs with % in it were failing to open mpv on click due to error from message:

error: "Not enough arguments for format string"

E.g., for such a link:

[[video:https://us02web.zoom.us/rec/play/ZIwV9OI_nOvLsM4E6qcWC95qzItbgYkySNmpunguzYC7X8amtyiQD1hTCMwZ5ETLAlVRh0Sgo1qmErQa.JamVkhsxNlyjU91t?canPlayFromShare=true&from=share_recording_detail&continueMode=true&componentName=rec-play&originRequestUrl=https%3A%2F%2Fus02web.zoom.us%2Frec%2Fshare%2Fkzc-Rsm_XOBvBMoSttIupf3MO8WmP-tEopTPh7WD9qykRWT1tvBGTrDMsMN8TCLq.qf1jJEwjs8A6xhwX#0:29:47][0:29:47]] yada yada
yuchen-lea commented 5 months ago

Thank you very much, learned it

andrewzhurov commented 5 months ago

Thank you for the awesome package! Been using for a couple of days, damm convenient.