[vlc-devel] [PATCH] Fix bug with VLSub '401 Unauthorized' error

Alon Sirota sirotaalon at gmail.com
Sat Aug 15 07:05:59 CEST 2020


Using the 'LogIn' XML-RPC with a none-English language cause results in
no subtitles being listed and Error message: 'Error: code '401
Unauthorized (200)'.

Steps to reproduce bug:
1) Open any video file with vlc
2) Open VLSub extension
3) Select 'Hebrew' from the 'Subtitles language:' dropdown menu
4) Click 'Search by hash' or 'Search by name'

I reordered the parameters in the 'LogIn' call to meet with the API
documented in:
https://trac.opensubtitles.org/projects/opensubtitles/wiki/XMLRPC#LogIn
which specifies: LogIn( $username, $password, $language, $useragent )
Notice how $language and $useragent were out of order, which caused th
as the useragent, which probably isn't registered.
---
 share/lua/extensions/VLSub.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/lua/extensions/VLSub.lua b/share/lua/extensions/VLSub.lua
index 2edc73ecdc..85c14f09d0 100644
--- a/share/lua/extensions/VLSub.lua
+++ b/share/lua/extensions/VLSub.lua
@@ -1113,8 +1113,8 @@ openSub = {
         return {
           { value={ string=openSub.option.os_username } },
           { value={ string=openSub.option.os_password } },
-          { value={ string=openSub.conf.useragent } },
           { value={ string=openSub.movie.sublanguageid } },
+          { value={ string=openSub.conf.useragent } },
         }
       end,
       callback = function(resp)
-- 
2.28.0



More information about the vlc-devel mailing list