-u and -p are not honored or working
Rouzax opened this issue · comments
When I edit the python file and add my credentials it does work but calling the cli to a folder gives an error
currently, on Python 3.8.6
C:\GitHub\OpenSubtitlesDownload>python OpenSubtitlesDownload.py --cli -l eng -l dut -a -x -u username -p password "C:\Temp\TV\A Very English Scandal\Season 01"
>> OpenSubtitles.org servers refused the connection: 401 Unauthorized.
- You MUST use a valid OpenSubtitles.org account!
- Check out <a href="https://github.com/emericg/OpenSubtitlesDownload/wiki/Log-in-with-a-registered-user">how and why</a> here
Unexpected error (line 825): <class 'AttributeError'>
C:\GitHub\OpenSubtitlesDownload>>> OpenSubtitles.org servers refused the connection: 401 Unauthorized.
- You MUST use a valid OpenSubtitles.org account!
- Check out <a href="https://github.com/emericg/OpenSubtitlesDownload/wiki/Log-in-with-a-registered-user">how and why</a> here
After editing the python file
C:\GitHub\OpenSubtitlesDownload>python OpenSubtitlesDownload.py --cli -l eng -l dut -a -x "C:\Temp\TV\A Very English Scandal\Season 01"
>> Downloading 'English' subtitles for '"A Very English Scandal" Episode #1.2'
Unexpected error (line 825): <class 'AttributeError'>
C:\GitHub\OpenSubtitlesDownload>Unexpected error (line 825): <class 'AttributeError'>
>> Downloading 'English' subtitles for '"A Very English Scandal" Episode #1.3'
Unexpected error (line 825): <class 'AttributeError'>
C:\GitHub\OpenSubtitlesDownload>
I end up with these.
A Very English Scandal - S01E01 - [1080p WEB-DL h264][NTG].mkv
A Very English Scandal - S01E02 - [1080p WEB-DL h264][NTG].mkv
A Very English Scandal - S01E02 - [1080p WEB-DL h264][NTG].srt
A Very English Scandal - S01E03 - [1080p WEB-DL h264][NTG].mkv
A Very English Scandal - S01E03 - [1080p WEB-DL h264][NTG].srt
Yes indeed, two different bugs actually, one of them from the last commit.
I've fixed both already but I've got myself pissed off at the code quality so I started a more significant rewrite to (hopefully...) avoid problems in the futur... The end tomorrow ^^
The credential where not passed to child instances, now it should be ok.
The AttributeError was the result of wonky handling of multiple languages used simultaneously (which wasn't really supported anymore, but everyone seems to be using this feature anyway).
The latest commit is pretty big, and while the code should be better in the long term, there is always the possibility to break a small thing now. This script has a lot of settings, and by mixing these settings together there is a lot of edges cases that are not tested often...
Let me know how it goes!
Get a different error now
PS C:\GitHub\OpenSubtitlesDownload> python OpenSubtitlesDownload.py --cli -l eng -l dut -a -x -u username -p password 'C:\Temp\TV\A Very English Scandal\Season 01'
usage: OpenSubtitlesDownload.py [-h] [--cli] [-g GUI] [-l [LANG]] [-i] [-s SEARCH] [-t SELECT] [-a] [-o OUTPUT] [-x]
[-u USERNAME] [-p PASSWORD]
searchPathList [searchPathList ...]
OpenSubtitlesDownload.py: error: unrecognized arguments: --x
usage: OpenSubtitlesDownload.py [-h] [--cli] [-g GUI] [-l [LANG]] [-i] [-s SEARCH] [-t SELECT] [-a] [-o OUTPUT] [-x]
[-u USERNAME] [-p PASSWORD]
searchPathList [searchPathList ...]
OpenSubtitlesDownload.py: error: unrecognized arguments: --x
Unexpected error (line 768): <class 'AttributeError'>
Trying to write out the command full results in:
PS C:\GitHub\OpenSubtitlesDownload> python OpenSubtitlesDownload.py --cli --lang eng --lang dut --auto --suffix --username USERNAME --password PASSWORD 'C:\Temp\TV\Mocro Maffia\Season 03'
usage: OpenSubtitlesDownload.py [-h] [--cli] [-g GUI] [-l [LANG]] [-i] [-s SEARCH] [-t SELECT] [-a] [-o OUTPUT] [-x]
[-u USERNAME] [-p PASSWORD]
searchPathList [searchPathList ...]
OpenSubtitlesDownload.py: error: unrecognized arguments: --x
>> No subtitles found for this video:
Mocro Maffia - S03E01 - [1080p.WEB-DL.h264][YOiNK].mkv
PS C:\GitHub\OpenSubtitlesDownload>
Sorry that was a typo...
Sorry took a while to test, but it looks to be working now.
Thanks for testing!