emericg / OpenSubtitlesDownload

Automatically find and download the right subtitles for your favorite videos!
https://emeric.io/OpenSubtitlesDownload
GNU General Public License v3.0
607 stars 66 forks source link

For subtitles with the same file name, the script chooses always the first regardless of the user's choise #79

Closed AmitGolden closed 3 years ago

AmitGolden commented 3 years ago

I was given these options:

>> Available subtitles:
[1] "Loki.S01E05.Journey.Into.Mystery.1080p.DSNP.WEB-DL.DDP5.1.H.264-EVO.srt" > "Language: English" 
[2] "Loki.S01E05.Journey.Into.Mystery.1080p.DSNP.WEB-DL.DDP5.1.H.264-EVO-HI.srt" > "HI" > "Language: English" 
[3] "Loki.S01E05.720p.WEB.H264-EXPLOIT.srt" > "Language: English" 
[4] "Loki.S01E05.720p.WEB.H264-EXPLOIT-HI.srt" > "HI" > "Language: English" 
[5] "Loki.S01E05.Journey.Into.Mystery.1080p.DSNP.WEB-DL.DDP5.1.H.264-EVO.srt" > "Language: Hebrew" 
[6] "Loki.S01E05.Journey.Into.Mystery.720p - 1080p.DSNP.WEB-DL.x264.Dual.Audio.Hindi+English.ESubs-HI.srt" > "HI" > "Language: English" 
[7] "The.Job.S01E05.AC3.DVDRip.XviD-LOKi.srt" > "Language: English" 
[8] "damages.105.ws.dsr-loki.en.srt" > "Language: English" 
[9] "Mad.Men.105.lok.VO.srt" > "Language: English" 
[10] "entourage.s01e05.dvdrip.xvid-loki.srt" > "Language: Hebrew" 
[11] "Weeds 105 Lude Awakening.en.srt" > "Language: English" 
[12] "entourage.105.dvdrip-loki.srt" > "Language: English" 
[13] "Entourage.S1E05.DVDRip-LOKi.srt" > "Language: English" 
[14] "Loki.S01E05.Journey.Into.Mystery.720p - 1080p.DSNP.WEB-DL.x264.Dual.Audio.Hindi+English.ESubs.srt" > "Language: English" 
[15] "Mad Men - 1x05 - 5G.LOKi.English.orig.Addic7ed.com.srt" > "Language: English" 
[16] "Entourage.S01E05.DVDRiP.XviD-LOKi.srt" > "Language: Hebrew" 
[17] "Over.There.S01E05.WS.DSR.XviD-LOKi.sub" > "Language: Hebrew" 
[18] "Over.There.S01E05.WS.DSR.XviD-LOKi.sub" > "Language: Hebrew" 
[0] Cancel search
>> Enter your choice (0-18): 5

and I chose 5, but the script kept on downloading the first on the list.

I did some debugging and found out that it's because options 1 and 5 have the same filename, although in different languages. The script finds the index by the file name only so the first one was always selected.