romanvm / service.addic7ed

Subtitles addon for Kodi Mediacenter
20 stars 13 forks source link

Remove query from file name #27

Closed quthla closed 3 years ago

quthla commented 3 years ago

This removes query from the file name and only takes the actual path for basename

romanvm commented 3 years ago

What is the purpose of this change?

quthla commented 3 years ago

It's already a few months since I applied this fix but iirc the addon would always fail to extract episode data from http URLs with query like http://hostname/dir/file?query

romanvm commented 3 years ago

Have you tested this with local paths and paths from network filesystems, like smb://foo/bar/baz.mp4?

quthla commented 3 years ago

It'll parse any url no matter the scheme and even if there are parts missing. See examples here https://docs.python.org/3/library/urllib.parse.html

quthla commented 3 years ago

parse.urlparse("smb://foo/bar/baz.mp4") ParseResult(scheme='smb', netloc='foo', path='/bar/baz.mp4', params='', query='', fragment='')

romanvm commented 3 years ago

Thank your for the explanation. I'll check it myself.

romanvm commented 3 years ago

Unfortunately I had no time to test it properly but let's assume it works. Thank you for your contribution.