chhoumann / PodNotes

PodNotes is a plugin for Obsidian that helps the user write notes on podcasts.
https://podnotes.obsidian.guide
MIT License
220 stars 9 forks source link

getUrlExtension method slightly modified #28

Closed svenmulholland closed 2 years ago

svenmulholland commented 2 years ago

The URL of my Cortex Podcast has a url from which the file extension is not cleanly readable. For this reason a file path is generated which can not be created.

The URL of the podcast episode is the following:

https://content.libsyn.com/p/2/9/7/2976089b68a44701/Cortex_131.mp3? c_id=132998295&cs_id=132998295&response-content-type=audio%2Fmpeg&Expires=1661533184&Signature=f0yT1HUuQf3mmD25H7Z2EDegXNDGcYIgQK4KH2z- jWe4uqd7i~ZpCY~ygbKqRbVT4LHnsw48ok7sGASwizpS3N~wTWecd4NN2T3jlYFrj6o8Fa511acIOEraWc0zARFoj9pmxSZOvJZUpwD0Is4oAoNmMkCyMpz9aC0Y5W3QgHWxUfVMon58st0uEpLMJy3RGSLwnJaeNZhU1l1IvXfIFEwRTcU3t3dLk2- WLfV1fgS0hhXNH0DXNk37nyrvE5m5Tm9DM15oFsNQlujB24mMGxZcEeD~8ELdxGIzZMgb3Jm0nnNkV~RbInyrLfqMgGy9vtU6DUC1UtlLYLhI~9BmQ__&Key-Pair-Id=K1YS7LZGUP96OI

The current implementation cannot read the file extension cleanly from this URL

chhoumann commented 2 years ago

Hi @svenmulholland,

Thank you for taking the time to do this! This change unfortunately causes other functions to stop working. I've made a simple fix using regular expressions, which seems to work with a variety of podcasts from my tests.

Fixed in 2.1.4.

svenmulholland commented 2 years ago

Hi @chhoumann,

I must confess that I have not checked for side effects, I have only tested the function with the podcasts I subscribe. Thanks for addressing this and thanks for the plugin ;-) Keep up the good work...

chhoumann commented 2 years ago

Thank you!

I'm glad you like the plugin.

Perhaps I should create an automated test suite. There are a ton of cases to address. Not all feeds use the same formats, so it could be useful.

svenmulholland commented 2 years ago

Definitely, a test suite is worth its weight in gold.